Volume 12 · Chapter 10 — System Design Case Studies
Case Study: Serverless Event-Driven Application
10.1 The Problem and Requirements
A bank wants to build a new customer feature - say a loan-application portal - with minimal operational overhead, automatic scaling, pay-per-use cost, and fast delivery, handling variable and unpredictable load. Thisserverlessscenario exercises the canonical serverless stack and event-driven patterns end to end, a frequent exam design.
10.2 The Serverless Stack
The reference serverless architecture:CloudFront + S3host the static single-page front end;Cognitoauthenticates customers;API Gatewayexposes the API (with a Cognito authorizer, throttling, and caching);Lambdafunctions implement the business logic;DynamoDB(with DAX) stores application data; andStep Functionsorchestrate the multi-step application workflow. Everything scales automatically and costs nothing when idle, with no servers to manage. This stack - S3+CloudFront (front end), Cognito (auth), API Gateway+Lambda (API), DynamoDB (data), Step Functions (workflow) - is the canonical serverless design the exam expects you to assemble.
flowchart TB User((Customer)) --> CF[CloudFront + S3 - SPA] User --> Cog[Cognito - auth] CF --> APIGW[API Gateway + Cognito authorizer] APIGW --> Lam[Lambda - business logic] Lam --> DDB[(DynamoDB + DAX)] Lam --> SF[Step Functions - loan workflow] SF --> EB[(EventBridge / SQS async)] EB --> Notif[Lambda - notifications]
10.3 Event-Driven Orchestration
The loan-application process is a multi-step workflow orchestrated byStep Functions(Standard): validate the application, run credit and fraud checks (Task states invoking Lambda), branch on the result (Choice), wait for a human underwriter approval on large loans (.waitForTaskToken), and finalize - with Retry/Catch handling failures and compensations. Around it,EventBridgeandSQSdecouple asynchronous side-effects (notifications, document generation, downstream updates) so they don’t block the customer response, andDynamoDB Streamstrigger reactive processing. This event-driven orchestration keeps the customer-facing path fast while reliably running the complex, long-running workflow behind it.
10.4 Why Serverless Here, and the Trade-Offs
Serverless fits because the workload is variable and unpredictable (loan applications aren’t steady), so automatic scaling and zero idle cost are ideal, and the team wants minimal operations and fast delivery. The trade-offs the exam expects you to name: eventual consistency in the event-driven parts, cold-start latency (mitigated with provisioned concurrency on latency-sensitive functions), Lambda’s 15-minute limit (long steps run as Step Functions with .sync or move to containers/Batch), and DynamoDB’s access-pattern-first modeling. Reserved concurrency protects downstream resources, and the whole stack deploys via SAM/CDK through the pipeline with canary Lambda deployments. This deliberate serverless design, with its trade-offs named, is exactly the professional-level architecture the certification targets.
10.5 Banking Production Notes
The bank ships the loan portal serverlessly: customers authenticate via Cognito and use an SPA served from CloudFront/S3; API Gateway (Cognito authorizer, throttling) fronts Lambda business logic backed by DynamoDB+DAX; and a Step Functions workflow orchestrates validation, credit/fraud checks, human approval via task tokens, and finalization, with EventBridge/SQS decoupling notifications and document generation. It scales automatically for application spikes, costs nothing between them, and was delivered fast with no servers to run - while correctness-critical steps use Step Functions’ error handling and DynamoDB transactions. This canonical serverless, event-driven application is the design the exam rewards for variable, low-ops, fast-delivery requirements.
10.6 Chapter Revision Notes
- Serverless stack: S3+CloudFront (SPA), Cognito (auth), API Gateway+Lambda (API), DynamoDB+DAX (data), Step Functions (workflow) - auto-scaling, zero idle cost, no servers.
- Step Functions orchestrates the multi-step workflow (Task/Choice/.waitForTaskToken for human approval) with Retry/Catch; EventBridge/SQS decouple async side-effects.
- Choose serverless for variable/unpredictable load, minimal ops, and fast delivery.
- Name trade-offs: eventual consistency, cold starts (provisioned concurrency), Lambda 15-min limit (Step Functions/containers for long steps), DynamoDB access-pattern modeling.
- Deploy via SAM/CDK through the pipeline with canary Lambda deployments; reserved concurrency protects downstreams.