Module Objective: Design a microservices or serverless architecture using AWS Lambda, Amazon API Gateway, and container orchestration services.
Builds on Modules 4 and 12: Microservices and serverless designs are what decoupling (Module 12) looks like applied to the compute layer (Module 4) itself.
Monolithic vs. Microservices Revisited
Building on AWS Academy Cloud Foundations Module 9, this module applies the monolith-vs-microservices trade-off concretely: breaking the café's single application tier into independently deployable services — ordering, inventory, notifications — each owned and scaled separately.
AWS Lambda in Depth
Building on AWS Academy Cloud Foundations Module 6, AWS Lambda is applied here as the compute primitive for individual microservices or event-driven tasks — each function handling one narrow responsibility, triggered by an API call, a queue message, or an S3 event.
| Trigger Source | Example Use in the Café Architecture |
|---|---|
| Amazon API Gateway | Handling an HTTP request from the ordering app |
| Amazon SQS | Processing a queued order from Module 12's decoupled design |
| Amazon S3 event | Resizing an uploaded product image automatically |
Amazon API Gateway
Amazon API Gateway provides a managed front door for APIs — handling request routing, authorization, throttling, and monitoring — commonly placed in front of a set of Lambda functions to expose them as a coherent, secured API.
| API Gateway Feature | What It Provides |
|---|---|
| Request routing | Maps an incoming HTTP request to the correct backend Lambda function |
| Authorization | Integrates with IAM or Amazon Cognito (Module 8) to control who can call an API |
| Throttling | Protects backend services from being overwhelmed by request spikes |
Container Orchestration Revisited
Building on AWS Academy Cloud Foundations Module 6, Amazon ECS, Amazon EKS, and AWS Fargate are applied here for microservices that need more control over runtime and dependencies than Lambda's execution model allows, while still avoiding the operational overhead of managing EC2 instances directly.
Serverless Application Patterns
Bringing this module's services together, a common serverless microservices pattern uses API Gateway for the front door, Lambda for business logic, DynamoDB for low-latency data access, and the SQS/SNS/EventBridge integration services from Module 12 to connect services asynchronously.
Key Terms for Module 13
- microservice
- An independently deployable service handling one narrow responsibility within a larger application
- Amazon API Gateway
- A managed service that handles routing, authorization, and throttling for APIs, often in front of Lambda
- serverless microservices pattern
- A common design combining API Gateway, Lambda, and DynamoDB, connected via SQS/SNS/EventBridge
- event-driven trigger
- A source, such as an API call, queue message, or S3 event, that invokes a Lambda function
Review Questions
- What operational cost does splitting a monolith into microservices introduce, even as it improves independent scalability?
- What are three different event sources that can trigger an AWS Lambda function?
- What role does Amazon API Gateway typically play in front of a set of Lambda functions?
- When might a container-based microservice on ECS or EKS be a better fit than a Lambda function?