Orders service — cloud architecture
How the orders service is deployed on AWS, and the request path through it.
What shaped it
SECTION 01 · Drivers
Requirements and NFRs
Elastic checkout
Handle 10× spikes on launch days.
NFR: scale
Durable orders
No order is ever lost once accepted.
NFR: durability
Low latency
Return under 800ms at p95.
NFR: latency
Context
SECTION 02 · C4 model
Who uses the orders service
C4 · CONTEXT
1places order2charges3publishes events
PersonSoftware SystemExternal System
Topology
SECTION 03 · Architecture
AWS deployment
INFRA
Key request
FLOW
Stack choices
| Concern | Choice | Why |
|---|---|---|
| Compute | ECS Fargate | No node management; scales to zero off-peak |
| Database | RDS Postgres | Strong consistency for orders |
| Events | Managed event bus | Decouples downstream consumers |
SECTION 06 · Note
Trade-offs
Warning
Fargate cold starts add ~1s on scale-out — pre-warm before known spikes. RDS is a single-writer; shard only if write volume demands it.