This project deploys a multi-tier web application architecture on Amazon Web Services (AWS) using Amazon Elastic Compute Cloud (EC2) instances. The architecture leverages various AWS services to achieve high availability, scalability, and security.
- Frontend (React) : https://github.com/youtubeMini/WhizStream_Frontend
- Backend (Nodejs) : https://github.com/youtubeMini/WhizStream_Backend
- S3 Presigned URL (Lmabda) : https://github.com/youtubeMini/s3-signed-url-lambda
- Video Processing (Ec2) : https://github.com/youtubeMini/video_processing
Key Components:
- Regions: The application is deployed across multiple isolated AWS regions for redundancy.
- Public and Private Subnets: Public subnets host resources accessible from the internet, while private subnets hold application logic and databases for security.
- Auto Scaling Groups: These groups automatically manage EC2 instances to handle varying traffic loads.
- Web Application Tiers: The architecture follows a three-tier structure:
- Frontend tier (public subnet) for handling user requests and delivering content.
- Backend tier (private subnet) for processing requests and interacting with the database.
- Database tier (private subnet) with a master-read replica configuration for data management.
- API Gateway: Acts as a single entry point for API requests, routing them to backend services.
- Load Balancers: Distribute traffic across multiple EC2 instances for high availability.
This section outlines the process for uploading videos to Amazon S3 storage and processing them using AWS Lambda functions.
Workflow:
- Lambda (generate URL): An AWS Lambda function is invoked, perhaps to generate a pre-signed URL for uploading the video.
- Upload video to S3 directly: Videos are uploaded directly to an S3 bucket using a presigned URL which is generated by the Lambda function.
- Request Pre-Signed URL: An S3 pre-signed URL is generated to control access permissions for uploading the video.
- Send message to Queue: A message is sent to an SQS queue, and EC2 autoscaling, EC2 process the uploaded video.
- Send Email Notification: An email notification is sent, upon successful video processing.
- Sent Push Notification to App: A push notification is sent to an app to inform users about video processing completion.
This section describes the continuous integration and continuous delivery (CI/CD) pipeline implemented for this project using Github Action. The pipeline automates the process of building, testing, and deploying the application to Amazon EC2 instances.
Pipeline Stages:
- Github: The pipeline starts with code changes being pushed to master branch of github.
- Build: A build stage is triggered, by the github action. This stage builds the docker image and it will be pushed to the Docker Hub.
- Build succeeded (Yes): If the build is successful, the pipeline progresses to the deployment stage.
- Build failed (No): In case of build failures, the pipeline halts, and notifications are sent to developers for troubleshooting.
- Deploy: The deployment stage utilizes Github action to deploy the application to EC2 instances.
- Deployment succeeded (Yes): Upon successful deployment, the pipeline completes.
- Deployment failed (No): If deployment fails, notifications are sent, and rollback mechanisms might be initiated to revert to a previous version.