DOCUMENTARCHITECTURE · AWS

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
C4 diagramPersonShopperSoftware SystemOrders serviceExternal SystemPayments providerExternal SystemEvent bus123
1places order2charges3publishes events
PersonSoftware SystemExternal System

Topology

SECTION 03 · Architecture

AWS deployment

INFRA
Layered architectureorders · us-east-1EdgeComputeDataCloudFrontCDNALBApplication LBOrders APIECS FargateEvent workerECS Fargateorders-dbRDS PostgrescacheElastiCache

Key request

SECTION 04 · Sequence
FLOW
Sequence diagramClientOrders APIorders-db1POST /orders2INSERT order3201 Created

Stack choices

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.