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 diagram: 4 elements, 3 relationshipsPERSONShopperSYSTEMOrders serviceEXTPayments providerEXTEvent busplaces orderchargespublishes events
LegendPERSONpersonSYSTEMsoftware systemEXTexternal systemoutside the boundaryusesthe system in scope
Orders service — cloud architecture3 / 6
Topology
03 · Architecture
SECTION 03 · Architecture

AWS deployment

INFRA
Layered architecture: 3 layers, 6 nodesorders · us-east-1EdgeComputeDataCloudFrontCDNEDGEALBApplication LBGATEWAYOrders APIECS FargateSVCEvent workerECS FargateSVCorders-dbRDS PostgresDBcacheElastiCacheCACHE
LegendEDGEedge / CDNGATEWAYgatewaySVCserviceDBdatabaseCACHEcachecallsasync / optionalentry point
Orders service — cloud architecture4 / 6
Key request
04 · Sequence
SECTION 04 · Sequence
SEQUENCE
Sequence diagram: 3 messages between 3 actorsClientOrders APIorders-db1POST /orders2INSERT order3201 Created
Legendcallresponsethe answer the caller getsactive
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