DOCUMENTARCHITECTURE · AWS

Orders service — cloud architecture

How the orders service is deployed on AWS, and the request path through it.

What shaped it
01 · Drivers
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
Orders service — cloud architecture2 / 6
Context
02 · C4 model
SECTION 02 · C4 model

Who uses the orders service

C4 · CONTEXT
C4 diagramPersonShopperSoftware SystemOrders serviceExternal SystemPayments providerExternal SystemEvent bus123
1places order2charges3publishes events
PersonSoftware SystemExternal System
Orders service — cloud architecture3 / 6
Topology
03 · Architecture
SECTION 03 · Architecture

AWS deployment

INFRA
Layered architectureorders · us-east-1EdgeComputeDataCloudFrontCDNALBApplication LBOrders APIECS FargateEvent workerECS Fargateorders-dbRDS PostgrescacheElastiCache
Orders service — cloud architecture4 / 6
Key request
04 · Sequence
SECTION 04 · Sequence
FLOW
Sequence diagramClientOrders APIorders-db1POST /orders2INSERT order3201 Created
Orders service — cloud architecture5 / 6
Stack choices
05 · Note
SECTION 05 · Comparison
ConcernChoiceWhy
ComputeECS FargateNo node management; scales to zero off-peak
DatabaseRDS PostgresStrong consistency for orders
EventsManaged event busDecouples 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.
Orders service — cloud architecture6 / 6
1 / 6
Document