To provide TrueProdigy with a more robust and scalable solution, Cloud303 implemented a containerized architecture using Amazon Elastic Container Service (ECS). Here's a more technical deep dive into the solution:
Containerization and Task Definitions
Cloud303 began by containerizing the Jaspersoft web application, ActiveMQ, and scalable- query-engine services. Docker was used to create images for each service, defining their dependencies and configurations. These images were then stored in Amazon Elastic Container Registry (ECR).
Task definitions were created for each service, specifying the Docker image, resource allocation, and environment variables. These task definitions were used to launch containers on the ECS cluster.
ECS Cluster and Services
An ECS cluster was set up using Amazon Elastic Compute Cloud (EC2) instances as the compute platform. This cluster was designed to host the three services: Jaspersoft web app, ActiveMQ, and scalable-query-engine.
ECS services were created for each of the three components, referencing their respective task definitions. The services were responsible for running and maintaining the desired number of tasks (containers) based on the specified task definition.
Networking and Load Balancing
A Virtual Private Cloud (VPC) was created with isolated subnets for the application, database, and load balancer layers. The application and load balancer layers were spread across multiple Availability Zones (AZs) to ensure high availability.
The Jaspersoft web app was exposed to the private network using a private Application Load Balancer (ALB), which was responsible for distributing traffic across multiple tasks (containers) running in different AZs. Target groups were configured for each service, with health checks to monitor the status of the tasks. Session stickiness was enabled to maintain user sessions across multiple requests.
Amazon MQ and PostgreSQL Database
Amazon MQ, a managed messaging service, was used to deploy and manage the ActiveMQ service. This allowed TrueProdigy to take advantage of the scalability and reliability offered by the managed service.
A PostgreSQL database was deployed in a private data subnet, spanning multiple AZs, for storing Jaspersoft configurations. This setup ensured high availability and redundancy for the database layer.
Auto Scaling and Capacity Providers
An Auto Scaling Group (ASG) was configured for the ECS cluster, with the desired capacity set based on TrueProdigy's requirements. ECS capacity providers were associated with the ASG, allowing the ECS services to scale the underlying EC2 instances as needed.
Task-level auto-scaling was also configured for the Jaspersoft web app and scalable-query-engine services. This allowed the services to scale the number of tasks (containers) based on predefined CloudWatch metrics, such as CPU and memory utilization.
To streamline the development and deployment process, Cloud303 implemented a CI/CD pipeline using AWS CodePipeline, CodeBuild, and GitHub. This pipeline allowed TrueProdigy's developers to automatically build, test, and deploy new versions of their application upon committing changes to their GitHub repository. The pipeline consisted of the following stages:
Source: Code changes were fetched from the GitHub repository.
Build: AWS CodeBuild built the Docker images for the Jaspersoft application, ActiveMQ, and scalable-query-engine services.
Test: Automated tests were run to ensure application quality and stability.
Deploy: The new Docker images were pushed to Amazon ECR, and the ECS services were updated to use the latest images.
This CI/CD pipeline ensured that TrueProdigy could rapidly develop their application while maintaining high availability and reliability.