Multi-Region Serverless Architecture Patterns Explained
Multi-region serverless means users still check out when ap-south-1 hiccups — or when latency to another continent hurts. It is Route 53/health checks, data replication choices, idempotent writes, and a rehearsed failover — not just copying a SAM stack twice.
What you'll learn in this chapter
- Name active-active vs active-passive
- Pick data patterns (Global Tables vs async)
- Wire DNS health checks thoughtfully
- State RPO/RTO with product
- Avoid split-brain writes
1. Everyday example: festival traffic + one AZ scare
Rohan in Pune (INR) serves India from ap-south-1. Leadership asks for ap-southeast-1 for SEA users and DR. Copying Lambdas is easy; copying correct stock counts without double-sell is the hard part.
DNS failover: Route 53 health checks (console/CLI). Data: DynamoDB and DynamoDB Global Tables. Compute stays Lambda per region.
2. Why multi-region?
Why do we need this?
Single-region is fine until compliance, latency, or a regional event hurts revenue. Multi-region without a data story creates silent corruption. Agree RPO (how much data loss) and RTO (how fast back) with product first.
What is it?
Active-passive = warm standby; fail over DNS. Active-active = both serve traffic; needs conflict rules. Global Tables = multi-region DynamoDB replication. Stateless Lambdas deploy in each region.
3. Vertical diagram
4. How: pattern table
How to do it (step by step)
| Pattern | When | Hard part |
|---|---|---|
| Active-passive | DR / compliance cold-ish | Health check + data lag |
| Active-active read | Read-heavy global | Cache invalidation |
| Active-active write | Rare; high bar | Conflict resolution |
| Pilot light | Cost-sensitive DR | Bring-up time vs RTO |
5. Commands
List hosted zones (DNS inventory)
aws route53 list-hosted-zones --query 'HostedZones[].{N:Name,Id:Id}' --output table
Meaning: Know where failover records would live.
Describe a DynamoDB table stream/replica feel
aws dynamodb describe-table --region ap-south-1 --table-name Orders \
--query 'Table.{S:TableStatus,R:Replicas,Stream:StreamSpecification}'
Meaning: Check replicas if Global Tables in play.
Health check list
aws route53 list-health-checks --query 'HealthChecks[].{Id:Id,Type:HealthCheckConfig.Type}' --output table
Meaning: Empty list = no automated DNS failover yet.
Lambda same name other region?
aws lambda get-function --function-name checkout-api --region ap-southeast-1 2>&1 | head -5
Meaning: Confirm twin deploy exists before claiming DR.
6. Data and idempotency
- Prefer append-only events with deterministic ids.
- Global Tables: last-writer-wins — design for it.
- Never assume sticky sessions across regions.
- Secrets and parameters replicated or fetched per region.
- Warm concurrency separately per region.
7. Industries
- Fintech (Aisha, Lagos, NGN): active-passive with strict ledger replay.
- Ecommerce (Rohan, Pune, INR): Global Tables for carts carefully; stock = hard.
- Media (Kenji, Osaka, JPY): read replicas / regional caches for assets.
- SaaS (Priya, Bengaluru, INR): tenant pin to home region + DR.
- Travel (Mei, Singapore, SGD): latency-based routing for booking reads.
8. Lab
9. Lab - design on paper first
Do this in ap-south-1 (Mumbai) unless your org forbids it. Set a budget alert first.
How to do it (step by step)
- Write RPO and RTO in one sentence with product.
- List what must replicate vs rebuild.
- Sketch DNS failover + one health check target.
- Name the idempotency key for cross-region orders.
Cleanup (stop billing)
- Do not flip prod DNS in lab.
- Delete any lab health checks.
10. Same pattern across industries
- Fintech (Aisha, Lagos): payment webhooks → SQS → Lambda; never block the bank callback thread.
- Ecommerce (Rohan, Pune): checkout API on API Gateway+Lambda; inventory fan-out on SNS.
- Healthcare (Mei, Singapore): appointment SMS via SNS; PHI stays in DynamoDB with fine-grained IAM.
- EdTech (Diego, São Paulo): nightly cleanup EventBridge → Lambda on student drafts.
- Logistics (Fatima, Casablanca): package scan events on EventBridge bus; Step Functions for customs saga.
- Media (Kenji, Osaka): S3 upload → Lambda thumbnails; fan-out to moderation + CDN invalidate.
- SaaS multi-tenant (Priya, Bengaluru): Cognito groups + DynamoDB partition per tenant.
- Gov portal (Omar, Amman): strangler fig — peel one PDF form route per sprint to Lambda.
11. Troubleshooting checklist
- Confirm region (ap-south-1 vs us-east-1 for CloudFront/ACM quirks).
- Check CloudWatch Logs for the function name and request id.
- Verify IAM execution role allows the API you call.
- For async: check DLQ depth and SQS age of oldest message.
- For APIs: curl -v and compare status, CORS headers, body.
- For workflows: open Step Functions execution event history.
- Re-read the linked deep chapter before reinventing a service.
- If cost spikes: check concurrency, retries, and provisioned capacity.
12. Common errors and fixes
Each row is a real mistake students and juniors hit. Read the fix before you panic.
| Error / symptom | Fix |
|---|---|
| Copied stack, forgot data | Plan replication or restore; test it. |
| Active-active stock double-sell | Single writer or strong conflict rules. |
| Health check on deep dependency | Check the API users hit; avoid false failovers. |
| No runbook | Write and rehearse failover steps. |
| Secrets only in primary | Replicate or create per region. |
| Ignoring eventual consistency | UX and retries tolerate lag. |
| Same IAM role ARN assumptions | Roles are regional; pipelines deploy both. |
| Never tested failover | Game day quarterly. |
| RTO fantasy | Measure restore; set honest RTO. |
13. FAQ
Q. Is multi-region required?
Only if product/compliance/latency demands — cost is real.
Q. Global Tables vs Streams+Lambda copy?
GT managed; custom = more control/complexity.
Q. What about Aurora Global?
Great for relational; different chapter — still need app failover.
Q. Pilot light vs warm standby?
Pilot = minimal; warm = almost ready — cost vs RTO.
Q. Link Route 53?
amazon-route-53-dns-routing-health-checks-and-failover-basics.
14. Interview Q&A (Beginner / Mid / Senior + MNC)
Q. Beginner: active-passive?
One region serves; other waits for failover.
Q. Beginner: RPO/RTO?
Data loss tolerance / time to recover.
Q. Mid: why idempotency multi-region?
Retries and failover can duplicate writes.
Q. Mid: health check design?
Check user-visible endpoint; sensible thresholds.
Q. Senior: conflict strategy?
LWW, CRDTs, or single-writer regions.
Q. MNC: evidence?
Game-day reports, RPO/RTO signed, DNS change tickets.
15. Tips in English, Marathi and Hindi
Ravindra Bagale's Tip (EN)
Agree RPO/RTO, pick data truth, automate DNS carefully, rehearse — then claim multi-region.
Ravindra Bagale's Tip (MR)
RPO/RTO, data truth, DNS, rehearse — मग multi-region claim.
Tip (HI)
RPO/RTO, data truth, DNS, rehearse — फिर multi-region claim।
Try at home
- Write RPO and RTO one-liners.
- List health checks in the account.
In short
- Start from a real story, then name the AWS services.
- Link existing chapters — do not copy their labs.
- Design for failure: retries, DLQ, idempotency, rollback.
- Measure before you buy provisioned concurrency or multi-region.
16. Architecture decision checklist
- Write the user journey in five bullets with no AWS names.
- Mark each step sync (user waits) or async.
- Name failure mode: retry, DLQ, compensate, or alert-only.
- Name the idempotency key for every write.
- Pick data store from access patterns (link DynamoDB modeling).
- Estimate monthly cost at 1x and 10x traffic (USD and INR).
- Confirm account concurrency and service quotas in ap-south-1.
- Decide auth: Cognito, IAM, Lambda authorizer, or none.
- Name on-call and which CloudWatch alarm pages them.
- Link the deep chapter you will not rewrite.
- Only then open console or IaC.
17. Copy-paste quick commands (read-only first)
# Region and identity
aws configure get region
aws sts get-caller-identity
# Lambda landscape
aws lambda list-functions --region ap-south-1 --max-items 20 \
--query 'Functions[].{N:FunctionName,R:Runtime,T:Timeout,M:MemorySize}' --output table
aws lambda get-account-settings --region ap-south-1
# API Gateway (HTTP APIs)
aws apigatewayv2 get-apis --region ap-south-1 --query 'Items[].{N:Name,Id:ApiId,Ep:ProtocolType}' --output table
# Queues and topics
aws sqs list-queues --region ap-south-1
aws sns list-topics --region ap-south-1 --query 'Topics[].TopicArn'
# Event buses and state machines
aws events list-event-buses --region ap-south-1
aws stepfunctions list-state-machines --region ap-south-1 --query 'stateMachines[].name'
# DynamoDB tables (names only)
aws dynamodb list-tables --region ap-south-1
Run these in a sandbox account. Prefer read-only IAM while learning.
18. More industry and stack stories
- Fintech (Aisha, Lagos, NGN): bank webhooks must return 200 fast — SQS absorbs spikes; ledger Lambda is idempotent on paymentId.
- Ecommerce (Rohan, Pune, INR): Black Friday — API Gateway throttle + SQS order intake; SNS fans inventory, email, analytics.
- Healthcare (Mei, Singapore, SGD): appointment reminders via SNS SMS; PHI only in DynamoDB with condition keys.
- EdTech (Diego, São Paulo, BRL): EventBridge nightly cleanup of draft quizzes; Lambda timeout 30s, not 15 min.
- Logistics (Fatima, Casablanca, MAD): package scans on custom EventBridge bus; Step Functions customs saga.
- Media (Kenji, Osaka, JPY): S3 → Lambda thumbnails; never write thumbs to the watched prefix.
- SaaS (Priya, Bengaluru, INR): Cognito groups + DynamoDB PK tenantId; one Lambda authorizer for all routes.
- Gov (Omar, Amman, JOD): strangler — peel one PDF form route per sprint from the monolith.
- Startup (Sofia, Sofia, EUR): start with Function URL for demos; move to HTTP API when partners need JWT.
- Retail (Luis, Mexico City, MXN): store POS sync via SQS FIFO when order matters; Standard when it does not.
- Python: handlers thin; put domain logic in plain modules for unit tests without Lambda.
- Node: prefer async/await; never block the event loop on sync DNS.
- Java: SnapStart for cold starts; keep dependencies lean.
- .NET: AspNetCoreServer for low-traffic tenants; watch package size.
- Go: single static binary; great for SQS workers.
- PHP: keep Laravel queues on ECS; Lambda for S3/webhooks glue.
19. Glossary (short)
| Term | Meaning |
|---|---|
| Cold start | First invoke pays init; later invokes reuse the env |
| Idempotency | Same request twice → same effect |
| DLQ | Dead-letter queue for failed messages |
| Choreography | Services react to events; no central conductor |
| Orchestration | Central workflow (Step Functions) directs steps |
| Fan-out | One event → many consumers |
| Fan-in | Many branches join before next step |
| Strangler fig | Peel routes from monolith gradually |
| Saga | Distributed tx via steps + compensations |
| Provisioned concurrency | Keep N envs warm; you pay for ready capacity |
20. Practice: explain out loud
- 60 seconds: everyday story for multi-region serverless.
- 60 seconds: sync vs async with a checkout example.
- 60 seconds: when you refuse Lambda.
- 60 seconds: DLQ + idempotency in one breath.
- Record once; cut fillers; record again.
21. Safe lab hygiene
- Tag every lab resource with owner and expiry date.
- Set a monthly AWS Budget alarm in INR or USD before experiments.
- Prefer read-only commands first; mutate in a sandbox account.
- Delete queues, APIs, tables you created — DynamoDB and APIGW leave footprints.
- Never put production secrets in env vars or screenshots.
- Do not enable provisioned concurrency for a hello-world.
22. How this chapter links others
- Compute depth: Lambda.
- HTTP edge: API Gateway.
- Data modeling: DynamoDB.
- Messaging: SQS/SNS.
- Events: EventBridge.
- Workflows: Step Functions.
- Project chapters (build-*): worked assemblies — link, do not paste.
23. Myths to drop
| Myth | Reality |
|---|---|
| Serverless means zero servers | Servers exist; you do not manage them |
| Always cheaper than EC2 | Steady high load can favor EC2/Savings Plans |
| No Ops needed | You own IAM, data, alarms, cost, incidents |
| One Lambda per app is fine | Bounded contexts scale better |
| Queues are optional decoration | Queues are the load leveler and blast-radius wall |
24. Error budget thinking for serverless
If your monthly error budget is 0.1% on checkout, a fan-out that retries aggressively can burn the budget with duplicate emails while money stays correct. Separate business correctness SLOs from notification SLOs.
- Write two SLOs: money-correct and notify-delivered.
- Retries on money path: bounded + idempotent.
- Retries on notify path: best-effort + DLQ.
- Page humans on money DLQ; ticket on notify DLQ.
25. Regional notes (ap-south-1)
- Build labs in Mumbai (ap-south-1) unless your org mandates elsewhere.
- Some services launch first in us-east-1 — check feature availability.
- Data residency for INR fintech may require in-region only.
- Latency to end users in India usually favors ap-south-1.
26. Naming conventions that save incidents
# Suggested prefixes
# Lambda: pay-intake-prod, pay-worker-prod
# SQS: pay-orders.fifo / pay-orders-dlq
# SNS: pay-order-events
# EB bus: pay.domain
# SFN: pay-refund-saga
# DDB: pay-orders-prod
Include env (dev/stage/prod) and domain. Future you grepping CloudWatch will thank present you.
27. Pre-mortems (ten minutes)
- Imagine tomorrow headline: double charge in AED. What broke?
- Imagine DLQ depth 50,000 after a bad deploy. How do you drain?
- Imagine Cognito outage. Do APIs fail closed or serve read-only?
- Write answers in the runbook before go-live.
28. Currency and locale in examples
Rotate currencies in designs: INR, USD, EUR, AED, NGN, BRL, JPY, SGD. Rotate names: Aisha, Rohan, Mei, Diego, Fatima, Kenji, Priya, Omar, Sofia, Luis. This keeps mental models global — not one-country samples.
29. Worked story: SEA latency + Mumbai primary
- Product sets RPO 5 min, RTO 30 min.
- Active-passive ap-southeast-1 with GT for read models.
- Route 53 failover + health on /healthz.
- Game day: promote, redrive, postmortem.
30. Anti-patterns
- Two regions writing stock without rules.
- Failover never rehearsed.
- Copying prod data to DR without encryption/access review.
Revision, interview and comparison cards
Revise this lesson in a few minutes. Save the cards on your phone or download them as PNG files. The QR code on each card opens this lesson.








More cards: Ravi Sir's Cards.
Practice Tasks
Amravati Agro Market is a agriculture business in Amravati. Anjali Thakre looks after its IT and cloud work. They count money in INR and run their AWS resources in the ap-south-1 Region. In the tasks below you do real jobs for them using what this lesson teaches. All names, account IDs, IP addresses and numbers are made up for practice.
0 / 16
Easy RPO data loss — 1
Why: Idea.
What to do: Enter 1 if RPO is how much data loss you tolerate.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Easy RTO recover time — 1
Why: Idea.
What to do: Enter 1 if RTO is time to recover service.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Easy Active-passive — 1
Why: Idea.
What to do: Enter 1 if active-passive means one region serves.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Easy AA writes hard — 1
Why: Idea.
What to do: Enter 1 if active-active writes need conflict rules.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Easy Global Tables — 1
Why: Idea.
What to do: Enter 1 if DynamoDB Global Tables replicate multi-region.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Easy Route53 failover — 1
Why: Idea.
What to do: Enter 1 if Route 53 can fail over with health checks.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Easy LWW caveat — 1
Why: Idea.
What to do: Enter 1 if Global Tables last-writer-wins needs design care.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Medium Health user-facing — 1
Why: Idea.
What to do: Enter 1 if DNS health checks should hit user-visible endpoints.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Medium Idempotency cross-region — 1
Why: Idea.
What to do: Enter 1 if cross-region retries need idempotency keys.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Medium Data plan required — 1
Why: Idea.
What to do: Enter 1 if copying Lambdas without a data plan fails DR.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Medium Game day — 1
Why: Idea.
What to do: Enter 1 if failover must be rehearsed on a game day.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Medium Pilot light — 1
Why: Idea.
What to do: Enter 1 if pilot light trades cost for longer bring-up.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Medium RPO RTO lines
Why: Agree.
What to do: YAML: rpo_minutes: 5 and rto_minutes: 30.
- Start from the top-level keys the task names.
- Indent child keys with 2 spaces (no tabs).
- Fill in each property with the value from the task.
- Click Check answer. Key order does not matter.
Medium List hosted zones
Why: DNS inventory.
What to do: List Route 53 hosted zones
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Hard No dual stock writers — 1
Why: Idea.
What to do: Enter 1 if dual unconstrained stock writers risk double-sell.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Hard Secrets per region — 1
Why: Idea.
What to do: Enter 1 if secrets must exist or replicate per region.
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.