Based on the SAP-C02 exam guideReport an error
Week 8 examined how serverless and event-driven architecture collaborate. Lambda (cold start, concurrency, VPC ENI), Step Functions (state machine, Saga, Distributed Map), EventBridge (Bus, Pipes, Scheduler), AppSync (GraphQL + Subscription), SQS/SNS/Kinesis/MSK (messaging, streaming) — six domains appear independent but production nearly always combines two or three. That's exactly what SAP-C02 exams target. "Lambda alone isn't enough," "Step Functions alone isn't enough" — the ability to identify keyword combinations and judge which tool combination fits best matters.
Today consolidates week 8 into 12 comprehensive scenarios. Each scenario asks not single tools but complex patterns, and explanations clarify why answers are correct and alternatives wrong using SAP exam decision criteria. Re-reading these scenarios before the exam redraws the entire domain's decision tree in your mind.
"Cold start + zero cost" → SnapStart (Java/Python/.NET)
"Cold start + predictable traffic" → Provisioned Concurrency + Auto Scaling
"Lambda + DB connection too many" → RDS Proxy
"One function impacting others" → Reserved Concurrency
"Java/Python Lambda 20%↓ cost" → Graviton2 ARM switch
"ML model 1GB+ Lambda" → Container Image (10GB limit)
"Long-term workflow + compensate" → Step Functions Standard + Catch
"High frequency, short workflow" → Step Functions Express
"Human approval / external callback" → .waitForTaskToken
"Wait for ECS/EMR/Glue job complete" → .sync
"1M S3 objects in parallel" → Distributed Map + Express child
"1M user schedules" → EventBridge Scheduler
"SaaS partner event receive" → EventBridge Partner Bus
"Queue → workflow, code-free" → EventBridge Pipes
"Event replay, reprocess" → EventBridge Archive + Replay
"Rich filter + diverse targets" → EventBridge Custom Bus + Rule
"GraphQL + real-time + mobile + auth" → AppSync + Cognito
"Order + dedup payment queue" → SQS FIFO
"Simple fan-out + very high throughput" → SNS Topic + SQS subscription
"Replay + multi-consumer" → Kinesis Data Streams + EFO
"Auto-save to S3/Redshift/OpenSearch" → Kinesis Firehose
"Kafka standard + portability" → MSK
"Isolate failed after 5 retries" → DLQ + maxReceiveCount
"Batch partial failure retry only" → Lambda ESM ReportBatchItemFailures
Click a choice to reveal the answer and explanation.
Question 1
Global OTT service receives 50,000 viewer events/sec: (1) instant real-time recommendation model (2) 7-day raw event S3 preservation for ML retraining (3) analytics hourly aggregation for BI dashboard. Three downstream must process simultaneously without latency impact. Best architecture?
Question 2
Java Spring Boot Lambda cold start averages 4 sec. 1M daily calls, 5% cold ratio. Ops must reduce to <1sec without extra cost. Init has DB connection pool + UUID-based instance ID. Best combo?
Question 3
Payment → inventory deduct → shipping schedule workflow averages 30sec to days (external carrier response wait). Shipping failure requires payment refund + inventory restore. External carrier responds async via webhook. Best architecture?
Question 4
1M-user SaaS sends daily summary emails at each user's preferred time (timezone + time). User setting changes apply immediately. Best architecture?
Question 5
Filter DynamoDB Streams events (change events), routing only matching patterns to Step Functions workflow. Want to avoid Lambda code and operations. Best architecture?
Question 6
E-commerce fans out OrderPlaced event to 5 downstream (analytics, shipping, CRM, alerts, audit). Throughput 5,000/sec. Each downstream processes at own pace; failed messages permanently isolated for analysis. Best architecture?
Question 7
Lambda function connects to RDS PostgreSQL inside VPC. Concurrent executions spike to 1,500, getting "FATAL: too many connections". RDS max_connections=200. Best fix?
Question 8
Mobile chat app uses GraphQL backend, receives message real-time push. Cognito user auth, DynamoDB storage, offline sync needed. Best backend?
Question 9
1M CSV files in S3, each processed by Lambda. Per-file time 5–30 sec. Results aggregate to different S3 bucket. Best pattern?
Question 10
Black Friday sale starts; Lambda concurrent execution spikes 0→5,000 in 5 minutes. us-east-1 burst limit 3,000. Must handle without throttle; exact start time known. Best architecture?
Question 11
Global SaaS receives Stripe webhook + Shopify webhook simultaneously, routes amount > $1,000 to Step Functions workflow, rest to Lambda. Avoid webhook receiver operations. Best architecture?
Question 12
Fintech receives payment transactions in SQS, Lambda processes. Batch size=10; one failure triggers full batch retry (default), but idempotent-broken downstream causes duplicates. Retry only failed messages?
[Client]
│ GraphQL
▼
[AppSync] ──Subscription(WebSocket)── Real-time mobile/web
│ Mutation, direct resolver
▼
[DynamoDB] ──Streams──► [EventBridge Pipes]
│ Filter
▼
[EventBridge Custom Bus]
│ Rule
┌─────────────────┼─────────────────┐
▼ ▼ ▼
[Step Functions] [SNS Topic] [Kinesis Data Streams]
├─ Standard (1yr) │ Fan-out │ Retention 24h~365d
├─ Express (5min) │ Filtering │ EFO multi-consumer
├─ Saga(Catch) └─ 5 SQS │
├─ Distributed Map │
├─ .sync (job wait) ▼
└─ .waitForTaskToken (external callback) [Firehose] ──► S3/Redshift
[Lambda]
├─ Concurrency 3 types (account/Reserved/Provisioned)
├─ SnapStart (Java/Python/.NET, free)
├─ Hyperplane ENI (VPC), RDS Proxy connection
├─ Destinations (OnSuccess/OnFailure → SNS/SQS/EB/Lambda)
├─ Container Image 10GB (block-level lazy loading)
└─ Graviton2 ARM 20%↓
[EventBridge Scheduler] ──► 1M+ user schedules
[EventBridge Partner Bus] ──► Stripe/Shopify/Datadog direct
[EventBridge Archive + Replay] ──► Event reprocessing
[Schema Registry] ──► Evolution management + code binding
Next week (Week 9): Data Architecture — Data Lake (S3 + Lake Formation + Glue), Redshift (RA3 + AQUA + Spectrum), EMR (Spark/Hive on EC2/EKS), Athena (Iceberg + federated query), MSK Connect, Lakeformation permission model, Migration to Data Lakehouse.