Building a Well-Architected Microservices Application and a CI/CD Pipeline with AWS Services

Linet KendiLinet Kendi
5 min read

Architecture Diagram

Project Overview and Objectives

In this project, we will leverage at least 11 AWS offerings to build a microservices and continuous integration/continuous development (CI/CD) solution.

By the end of this project, we will have accomplished the following:

  • Deployed a Node.js web application to run and connect to a relational database AWS RDS.

  • Used AWS Cloud9 integrated development environment (IDE) as our platform and built a code repository.

  • Split a monolithic application into separate containerized microservices.

  • Used Amazon ECR to store and version control containerized microservice Docker images.

  • Created code repositories using AWS CodeCommit.

  • Created a serverless cluster using Amazon ECS with Fargate engine.

  • Configured an Application Load Balancer and multiple target groups to facilitate autoscaling.

  • Created a code pipeline using AWS CodePipeline to run our blue/green deployment.

  • Use the code pipeline and repository for CI/CD by iterating on the application design facilitating seamless updates.

Detailed overview of the AWS service used and how they enable us meet the aws Well architected best practices.

AWS Well-Architected Framework

The AWS Well-Architected Framework provides a consistent approach to evaluate architectures and implement scalable designs. It is built around six pillars: operational excellence, security, reliability, performance efficiency, cost optimization, and sustainability1.

Services and Their Contributions

  1. AWS Cloud9

    • Purpose: Integrated Development Environment (IDE)

    • Contribution: AWS Cloud9 provides a cloud-based IDE that allows you to write, run, and debug your code with just a browser. This service supports operational excellence by enabling efficient development and collaboration.

  2. AWS CodeCommit

    • Purpose: Source Control Service

    • Contribution: CodeCommit is a fully managed source control service that hosts secure Git-based repositories. It supports the security pillar by ensuring that your code is securely stored and managed.

  3. Amazon ECR (Elastic Container Registry)

    • Purpose: Container Registry

    • Contribution: ECR is a fully managed Docker container registry that makes it easy to store, manage, and deploy Docker container images. It supports reliability by ensuring that your container images are consistently available.

  4. Amazon ECS (Elastic Container Service) with Fargate

    • Purpose: Container Orchestration

    • Contribution: ECS with Fargate allows you to run containers without managing servers or clusters. This service supports cost optimization and performance efficiency by automatically scaling your applications based on demand.

  5. Application Load Balancer

    • Purpose: Traffic Distribution

    • Contribution: The Application Load Balancer distributes incoming application traffic across multiple targets, such as AWS Fargate instances, in multiple Availability Zones. It enhances reliability and performance efficiency by ensuring high availability and fault tolerance.

  6. AWS CodePipeline

    • Purpose: Continuous Integration and Continuous Delivery (CI/CD)

    • Contribution: CodePipeline automates the build, test, and deploy phases of your release process. It supports operational excellence by enabling continuous delivery and integration, ensuring that your application is always in a deployable state.

  7. AWS CodeBuild

    • Purpose: Build Service

    • Contribution: CodeBuild is a fully managed build service that compiles source code, runs tests, and produces software packages. It supports operational excellence by providing a scalable and efficient build process.

  8. AWS CodeDeploy

    • Purpose: Deployment Service

    • Contribution: CodeDeploy automates application deployments to various compute services such as EC2, Fargate, and Lambda. It supports reliability and operational excellence by ensuring consistent and repeatable deployments.

  9. Amazon RDS (Relational Database Service)

    • Purpose: Managed Relational Database

    • Contribution: RDS makes it easy to set up, operate, and scale a relational database in the cloud. It supports reliability and performance efficiency by providing automated backups, patching, and scaling.

  10. Amazon CloudWatch

    • Purpose: Monitoring and Observability

    • Contribution: CloudWatch provides monitoring for AWS cloud resources and applications. It supports operational excellence and reliability by offering insights into system performance and operational health.

  11. AWS IAM (Identity and Access Management)

    • Purpose: Access Control

    • Contribution: IAM enables you to manage access to AWS services and resources securely. It supports the security pillar by ensuring that only authorized users and applications can access your resources.

By following the AWS Well-Architected Framework, We will ensure that our Microservices application meets the highest standards of operational excellence, security, reliability, performance efficiency, cost optimization, and sustainability.

Project Cost Estimate

Why use Blue/green Deployment for a microservices application Architecture?

What is Blue/Green Deployment?

Blue/Green Deployment is a release management strategy that involves running two identical production environments: Blue (the current version) and Green (the new version). The idea is to switch traffic from Blue to Green once the new version is ready and tested, ensuring a smooth transition with minimal disruption1.

Benefits of Blue/Green Deployment

  1. Zero Downtime

    • One of the most significant advantages is the ability to deploy new features or updates without any downtime. Users continue to interact with the Blue environment while the Green environment is being prepared. Once ready, traffic is seamlessly switched to Green1.
  2. Easy Rollback

    • If any issues arise with the new version, rolling back to the previous stable version (Blue) is straightforward. This reduces the risk associated with deployments and ensures a quick recovery.
  3. Improved Testing and Validation

    • The Green environment allows for thorough testing and validation before going live. This includes performance testing, user acceptance testing, and more, ensuring that the new version meets all requirements.
  4. Reduced Risk

    • By isolating the new version in the Green environment, any potential issues are contained and do not affect the live environment. This isolation helps in identifying and resolving problems early.
  5. Enhanced User Experience

  • Users experience a seamless transition with no interruptions, leading to a better overall experience. This is particularly important for applications with high availability requirements.

Why is it Ideal for Microservices?

Microservices architecture involves breaking down an application into smaller, independent services. This modularity aligns perfectly with the Blue/Green Deployment model:

  • Independent Updates: Each microservice can be updated independently, allowing for more granular control over deployments.

  • Scalability: Microservices can be scaled individually, and Blue/Green Deployment ensures that scaling operations do not disrupt the overall application.

  • Resilience: The ability to quickly switch between environments enhances the resilience of the application, making it more robust against failures.

Challenges Faced:

  • Implementing Blue/Green Deployment: Understanding how to set up correct target points.

Next Steps:

  • Set up security considerations for the CI/CD Pipelines.

  • Optimize costs on the RDS instance.

0
Subscribe to my newsletter

Read articles from Linet Kendi directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Linet Kendi
Linet Kendi

Cloud and Cyber Security enthusiast. I love collaborating on tech projects. Outside tech, I love hiking and swimming.