Skip to content

System Design ‐ Landscape

FullstackCodingGuy edited this page Jan 2, 2025 · 16 revisions

Technologies

read

✅ EC2, VPC, EBS, and Load Balancers ✅ RDS, Aurora, and DynamoDB ✅ Route 53, CloudFront, and Global Accelerator ✅ Architecting for resilience, high availability, and disaster recovery ✅ Security best practices and cost optimization

Key Components

read

Principles

read
  • GraphQL

Patterns

read

Solution Design Patterns

Security

read
  • GraphQL

Best Practices

read
  • GraphQL

Reference Architecture Design

AWS EC2 - Auto Scaling Reference

Infra Setup

  1. Create VPC

  2. Create Internet Gateway (IG) to enable the VPC resources accessible via internet (option available under VPC) 2.1 Attach the newly created internet gateway (IG) to the VPC (option available under Actions menu)

  3. Create Public Subnet - atleast 2 subnets in each availability zone to ensure maximum availability of the services (under the desired VPC) 3.1 Configure 2 different IP ranges in IPv$ subnet CIDR block to differentiate (ex: subnet1: 10.0.1.0/24, subnet2: 10.0.2.0/24)

  4. Create Route Table (under VPC) - to direct network traffic based on the destination IP address, route table is also responsible for providing internet access 4.1 Subnet Association - associate the desired subnets with the route table created under the vpc 4.2 Provide routes - so that internet access is enabled for the subnet destination (ex: Destination: 0.0.0.0/0 - i.e any resources associated with the route table can be accessed via internet, all the public subnet resources will have access to internet, Target: Internet Gateway -> select the newly created internet gateway in step2)

  5. Create Target Group (under load balancing option) - it is a logical group for pointing to the ec2 instances, scaling of ec2 instances happen under this target group 5.1 Configure the http protocol and port 5.2 Select the desired VPC 5.3 Select the health check endpoint - the one from ec2 instance (webserver) 5.4 Note: Once the target group is created, you will not find any ec2 instances, because the load balancer must be created in order for displaying the ec2 instances under this target group, so go ahead and create the target group record. 5.5 once record is created, it will show Load Balancer: None Associated (initially)

  6. Create Load Balancer (under load balancing option) 6.1 Select Scheme: Internet-facing 6.2 Select the desired VPC 6.3 Select the subnets in Network Mapping (min 2 subnets needed) 6.4 Select Security Group (define the access from internet for http, https, configure inbound and outbound rules) 6.5 Configure "Listeners and routing" mapping - to point inbound traffic towards the target group

  7. Create AutoScaling Group (under Autoscaling) 7.1 Define the launch template - to launch the ec2 instance based on conditions 7.2 Define generic security group to define the inbound http:80 traffic and SSH:22 for login to ec2, example: image 7.3 associate this security group in the launch template to facilitate the ec2 launching 7.4 No need of subnet selection 7.5 Enable - auto assign public ip 7.6 Use script under user data - to install the default packages such as web server and create a dummy html page to serve as index page, which will also be helpful for health check. example: image 7.7 Once the launch template is configured, select that and click next 7.8 Configure the VPC 7.9 Select the Availability zones, subnets 7.10 Attach to the existing Load balancer which we created in prev step and target group 7.11 Turn on elastic load balancing health checks 7.12 Configure the Capacity: Desired: 2, Min:1, Max:3 7.13 Configure Scaling Policies (metric type: Average CPU Utilization)

Once the capacity configuration is updated, it will take a while to update the scaling configuration and create the ec2 instances accordingly. Further you can open the Ec2 instances page and see how many instances are running.

AWS Disaster Recovery (DR) Plan image
Clone this wiki locally