Task Statement 2.1: Design scalable and loosely coupled architectures.
📘AWS Certified Solutions Architect – (SAA-C03)
Serverless computing allows you to build and run applications without managing servers. This means AWS handles the infrastructure, scaling, and maintenance automatically. You just focus on your code or tasks.
Two main AWS serverless services you should know for the exam:
- AWS Lambda
- AWS Fargate
Let’s go into detail.
1. AWS Lambda
What it is:
AWS Lambda is a serverless compute service that lets you run code without provisioning or managing servers. You only pay for the compute time you use.
Key Exam Points:
- Event-driven: Lambda functions are triggered by events, like:
- An object uploaded to S3
- A new message in SQS
- An API call via API Gateway
- Automatic scaling: AWS automatically scales the number of function instances depending on traffic.
- Short-lived functions: Best suited for tasks that run quickly (up to 15 minutes max execution).
- Stateless: Each execution is independent; Lambda does not store state between executions.
Common IT Use Cases:
- Processing logs uploaded to S3.
- Transforming data from one format to another.
- Running backend code for APIs with API Gateway.
- Performing asynchronous tasks like sending notifications.
Exam Tips:
- Remember Lambda scales automatically – you don’t need to set servers or clusters.
- Trigger → Function → Output is the typical pattern.
- You cannot run long-running processes (>15 mins) in Lambda.
2. AWS Fargate
What it is:
AWS Fargate is a serverless container service. It lets you run Docker containers without managing the underlying EC2 servers.
Key Exam Points:
- Works with Amazon ECS (Elastic Container Service) and EKS (Elastic Kubernetes Service).
- You define CPU, memory, and container image; Fargate handles the infrastructure.
- Pricing is based on vCPU and memory used per second.
- Good for longer-running tasks or applications that require full containers.
Common IT Use Cases:
- Running microservices in containers without provisioning EC2 instances.
- Hosting containerized backend APIs or batch jobs.
- Running scheduled jobs like nightly data transformations.
Exam Tips:
- Fargate is ideal when you need containerization but no server management.
- Lambda is better for event-driven short tasks, while Fargate is better for continuous or long-running containerized workloads.
3. Serverless Patterns
Serverless architecture often follows specific patterns that make it scalable and loosely coupled:
a. Event-Driven Pattern
- How it works: Components react to events instead of polling or waiting.
- Example IT pattern:
- New file uploaded → S3 triggers Lambda → Lambda processes file → Results stored in DynamoDB
- Benefits: No idle servers; scales automatically with events.
b. Microservices Pattern
- How it works: Break applications into small independent services.
- Each microservice can be serverless, like:
- Lambda functions for business logic
- Fargate containers for stateful services
- Benefits: Services can scale independently; easy to update without affecting the whole system.
c. Queue-Based Asynchronous Pattern
- How it works: Decouples components using queues (like SQS).
- Example IT pattern:
- Frontend pushes tasks to SQS
- Lambda or Fargate picks up tasks and processes them
- Benefits: Smooth handling of traffic spikes; prevents overload.
d. Backend-for-Frontend (BFF) Pattern
- How it works: Different frontends (mobile, web, IoT) have specific backend endpoints via Lambda or Fargate.
- Benefits: Optimized response for each client type; serverless endpoints scale automatically.
4. Advantages of Serverless
- No server management – AWS handles it.
- Automatic scaling – from zero to thousands of requests.
- Cost-effective – pay only for usage, not idle servers.
- Faster development – focus on code, not infrastructure.
5. Limitations / Exam Cautions
- Lambda: Limited to 15-minute execution; stateless; limited concurrency unless configured.
- Fargate: Slightly slower to start than Lambda (cold start for containers); costs can be higher for very small workloads.
- Serverless is not ideal for legacy monolithic applications that require stateful, long-running processes.
6. Key Exam Tips & Memorization
- Lambda → short-lived, event-driven functions.
- Fargate → long-running, containerized workloads.
- Event-driven & queue-based patterns → decoupled and scalable.
- Microservices pattern → each service scales independently.
- Cost model: Pay per execution (Lambda) or per vCPU & memory usage (Fargate).
✅ Summary Table for Exam
| Feature / Pattern | AWS Lambda | AWS Fargate |
|---|---|---|
| Compute Type | Function | Container |
| Ideal Use | Event-driven, short tasks | Long-running, containerized apps |
| Scaling | Automatic, per request | Automatic, per container |
| Max Runtime | 15 mins | No strict limit |
| Cost Model | Pay per execution | Pay per vCPU & memory |
| Example Pattern | Queue-based, event-driven | Microservices, backend services |
