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.

⚠️ Warning — Microservices Aren't Free Splitting a monolith into microservices trades deployment simplicity for independent scalability and fault isolation — it's a deliberate architectural choice with real operational cost, not an automatic improvement.

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 SourceExample Use in the Café Architecture
Amazon API GatewayHandling an HTTP request from the ordering app
Amazon SQSProcessing a queued order from Module 12's decoupled design
Amazon S3 eventResizing an uploaded product image automatically
✅ Tip — Lambda Fits Naturally with Decoupling Because Lambda functions are inherently short-lived and stateless, they pair naturally with the queue- and event-based patterns from Module 12 — a queue message or event triggers exactly the function needed to handle it.

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 FeatureWhat It Provides
Request routingMaps an incoming HTTP request to the correct backend Lambda function
AuthorizationIntegrates with IAM or Amazon Cognito (Module 8) to control who can call an API
ThrottlingProtects backend services from being overwhelmed by request spikes
🔵 Note — API Gateway + Lambda Is a Common Serverless Pair This combination — API Gateway handling the HTTP layer, Lambda handling the logic — is one of the most frequently referenced serverless patterns on the SAA-C03 exam.

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.

✅ Tip — Lambda vs. Containers Is About Fit, Not Superiority Short-lived, event-driven tasks tend to fit Lambda well; longer-running processes, or those needing specific runtime dependencies, often fit containers on ECS/EKS with Fargate better. Neither is universally "more serverless" or better architected.

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.

🔵 Note This pattern is often summarized as the combination behind many production serverless applications on AWS — worth recognizing as a named, reusable design rather than reasoning about each service from scratch every time.

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

  1. What operational cost does splitting a monolith into microservices introduce, even as it improves independent scalability?
  2. What are three different event sources that can trigger an AWS Lambda function?
  3. What role does Amazon API Gateway typically play in front of a set of Lambda functions?
  4. When might a container-based microservice on ECS or EKS be a better fit than a Lambda function?