Day-7 AWS-CSA
1] What is Scalability in AWS
Scalability in Amazon Web Services (AWS) refers to the ability of cloud resources to automatically adjust based on workload demands, ensuring high availability and cost efficiency. AWS provides both vertical and horizontal scalability to meet different application needs.
Types of Scalability in AWS
1. Vertical Scalability (Scaling Up)
2. Horizontal Scalability (Scaling Out)
Examples of Scalability in AWS
2] What is High Availability in AWS ?
High Availability (HA) in AWS refers to designing systems that remain operational with minimal downtime, even during failures. AWS achieves HA by distributing resources across multiple data centers and automatically handling failures.
Key Aspects of High Availability in AWS
AWS Services for High Availability
Example of High Availability in AWS
3] What is Load balancing in AWS ?
Load Balancing in AWS is the process of distributing incoming network traffic across multiple resources (such as EC2 instances, containers, or IP addresses) to ensure better performance, high availability, and fault tolerance. AWS provides a fully managed service called Elastic Load Balancer (ELB) to handle load balancing automatically.
Types of Load Balancers in AWS
AWS offers different types of Elastic Load Balancers to suit various use cases:
Benefits of Load Balancing in AWS
? High Availability – Distributes traffic across multiple instances to prevent failures.
? Scalability – Works with Auto Scaling to handle traffic spikes dynamically.
? Security – Integrates with AWS WAF and supports SSL termination for secure connections.
? Performance Optimization – Ensures even distribution of workloads, preventing bottlenecks.
Example of Load Balancing in AWS
Imagine a web application running on multiple EC2 instances across multiple Availability Zones (AZs):
1?? Users send requests → Requests hit an Application Load Balancer (ALB)
2?? ALB routes traffic → Based on URL path, it forwards requests to appropriate EC2 instances
3?? Auto Scaling → Automatically adds or removes instances based on traffic demand
4?? Health Checks → If an EC2 instance becomes unhealthy, ALB routes traffic to healthy instances
4] Why use a load balancer ?
A load balancer is essential for modern applications to ensure they are fast, reliable, and scalable. Here’s why you should use a load balancer:
1. High Availability
2. Scalability
3. Improved Performance
4. Fault Tolerance
5. Security
6. Flexible Routing
7. Simplified Management
Real-World Example:
For an e-commerce website, a load balancer ensures:
领英推荐
5] Application Load balancer
What is an Application Load Balancer (ALB)?
An Application Load Balancer (ALB) is a Layer 7 (HTTP/HTTPS) load balancer that routes traffic based on content, hostnames, paths, and query parameters. It’s designed for modern web applications, microservices, and API-based architectures.
?? Key Features:
? Intelligent routing (Path-based, Host-based)
? WebSockets & HTTP/2 support
? Sticky Sessions & SSL termination
? Integrated security with AWS WAF ? Auto Scaling & High Availability
Why Use an Application Load Balancer?
?? 1. Intelligent Request Routing (Content-Based Routing)
ALB allows you to route traffic based on:
?? Path-based routing: /login → Auth service, /orders → Orders service ?? Host-based routing: api.example.com → API service, app.example.com → Frontend service
? Example: A microservices-based app routes:
?? 2. Load Balancing Across Multiple Targets
ALB can distribute traffic across multiple target types:
? Example: A multi-region e-commerce app routes users to the nearest AWS region for better performance.
?? 3. Auto Scaling & High Availability
ALB works with Auto Scaling to add or remove instances automatically, ensuring the app handles sudden traffic spikes smoothly.
? Example: During Black Friday sales, new EC2 instances launch as traffic increases, and ALB distributes requests evenly.
?? 4. Enhanced Security & SSL Termination
ALB supports SSL/TLS termination, which secures incoming traffic before forwarding it to backend servers. It also integrates with AWS Web Application Firewall (WAF) to block malicious requests.
? Example: A banking website uses HTTPS with ALB to protect sensitive transactions.
?? 5. Sticky Sessions (Session Persistence)
ALB supports sticky sessions (session affinity), ensuring a user’s requests are always directed to the same server.
? Example: An online shopping cart stays consistent by directing all requests from the same user to a specific EC2 instance.
?? 6. WebSocket & HTTP/2 Support
ALB supports WebSockets for real-time applications and HTTP/2 for faster performance.
? Example: A live chat application uses WebSockets via ALB for real-time messaging.
How Does an Application Load Balancer Work?
1?? Client Request → ALB receives a request.
2?? Routing Decision → ALB checks the request (host, path, query params, headers).
3?? Target Group Selection → ALB forwards the request to the right target group (EC2, ECS, Lambda).
4?? Health Check → ALB ensures only healthy targets receive traffic.
5?? Response to Client → The backend processes the request and sends a response.
Use Case Scenarios for ALB
? Microservices Architecture – Routes different paths to different services (/api/users, /api/orders).
? Secure Web Applications – Uses HTTPS, WAF, and sticky sessions for user sessions.
? Serverless Apps – Routes traffic to AWS Lambda without needing EC2 instances.
? Containerized Apps (ECS, EKS) – Balances load across Docker containers.
6] What is Application load balancer target Groups
A Target Group is a collection of backend resources (EC2 instances, Lambda functions, IP addresses, or containers) that receive traffic from an Application Load Balancer (ALB).
Each Target Group has health checks, which monitor the availability of the backend targets and route traffic only to healthy targets.