Chaos Engineering

Introduction to Real life Application

Introduction to Our Real Life Application

In this hands-on lab, you will deploy a microservices-based pet adoption website on AWS and run Fault Injection Simulator (FIS) experiments. The application showcases pets available for adoption, complete with images, pricing, and details, and leverages AWS services for high availability, scalability, and resilience.

Note

This tutorial uses real AWS resources and may incur charges. Clean up your environment after completion to avoid unexpected costs.

The complete source code for each microservice is available on GitHub. This lab is adapted from the AWS Workshop Studio and provides step-by-step instructions to replicate the environment in your AWS account.

The pet adoption system follows microservices principles and is composed of three core services. Each service uses multiple AWS components to ensure redundancy, scalability, and secure data handling.

MicroserviceComputeHigh AvailabilityAuto ScalingCore Services
Pet Adoption WebAmazon EKS (2 EC2 worker nodes)Multi-AZ EC2 spreadEC2 Auto Scaling GroupApplication Load Balancer (ALB)
Pet Search APIAmazon ECS (2 EC2 instances)Multi-AZ EC2 spreadEC2 Auto Scaling GroupALB, DynamoDB (metadata), Amazon S3 (images)
Pet Payment APIAWS Fargate (2 tasks)ALB balanced tasksFargate Auto ScalingAPI Gateway, AWS Lambda, Amazon Aurora PostgreSQL

1. Pet Adoption Web Microservice

  • Compute: Runs on an Amazon EKS cluster backed by two EC2 worker nodes.
  • High Availability: EC2 instances are distributed across two separate Availability Zones.
  • Traffic Distribution: Incoming web traffic is routed through an Application Load Balancer (ALB).
  • Scalability: The EC2 nodes are managed by an Auto Scaling group that scales out based on CPU and network utilization.

2. Pet Search API Microservice

  • Compute: Deployed in an Amazon ECS cluster on two EC2 instances.
  • High Availability: Instances run across two Availability Zones for fault tolerance.
  • Traffic Distribution: An ALB fronts the ECS service to balance search requests.
  • Scalability: The ECS cluster uses an Auto Scaling group to adjust capacity dynamically.
  • Data Storage:
    • Amazon DynamoDB stores pet metadata (name, price, availability).
    • Amazon S3 hosts pet images, enabling efficient content delivery.

3. Pet Payment API Microservice

  • Compute: Leverages AWS Fargate to run two serverless containers.
  • High Availability: Fargate tasks are spread across multiple Availability Zones and balanced by an ALB.
  • Scalability: Task counts adjust automatically via AWS Application Auto Scaling.
  • API Integration:
    1. Amazon API Gateway receives payment requests.
    2. AWS Lambda functions validate the request, fetch pet details from DynamoDB, and process images from S3.
  • Database:
    • Amazon Aurora PostgreSQL handles transactional data with a Multi-AZ configuration (one writer, one reader) for automatic failover.

The image is a diagram of a cloud architecture for a pet adoption application, showing components like a Virtual Private Cloud (VPC), availability zones, and various AWS services such as Lambda, S3, and databases. It illustrates the flow of data and services between users and the cloud infrastructure.

As illustrated above, the architecture spans multiple Availability Zones, incorporates load balancers and auto-scaling groups, and is designed to maximize uptime and resilience.

Watch Video

Watch video content

Previous
Demo Create FIS Experiment using CF