SysPad › Examples › E-commerce checkout
E-commerce checkout
Amazon-style storefront: CDN with an edge function for header/redirect checks, WAF + ALB, a web tier, product search, a cart cache, an orders DB and inventory store (in a VPC), an async fulfilment queue, and Stripe.
A VPC-grouped data tier, a CDN-edge function ahead of the origin, and a write-heavy checkout path that pushes the orders DB to a bottleneck.
- Throughput: 18,000 req/sec
- First to saturate: Orders DB
- Estimated cost: $89k/mo
How it works
- CDN
- Four in five product-page requests never reach the origin. The hit rate is the biggest single lever in this design: every point it drops lands on the web tier and the databases behind it.
- Redirect Rewriter
- Rewrites old product-URL slugs before the cache lookup. A CloudFront Function rather than Lambda@Edge: sub-millisecond, no network access needed, and a fraction of the price.
- Web Tier
- Stateless pods that orchestrate rather than compute: every request here fans out to search, cart, orders or payments. Because it holds no session state, it can scale from 4 replicas to 30 without coordination.
- Cart / Session
- Holds cart and session state outside the web tier so any pod can serve any request. Every page view touches it, which is why it carries several times the traffic the checkout path does.
- Orders DB
- Sized deliberately small against checkout load, and it shows: each order writes twice while order tracking reads from the same instance, so two separate journeys stack here and this saturates before anything else.
- Inventory
- Decremented by the fulfilment worker, not by the checkout request, so a stock write never sits in the customer path.
- Fulfilment Queue
- The checkout response returns as soon as the order is durable. Packing, the inventory decrement and the notification all run off this queue, so a slow worker never shows up as checkout latency.
Request flows
Checkout
- DNS
- WAF
- Load Balancer
- Web Tier
- Cart / Session
- Orders DB
- Payments
- Fulfilment Queue
- Fulfilment Worker
- Inventory
- Order Notifications
Browse & search
- DNS
- WAF
- Load Balancer
- Web Tier
- Cart / Session
- Product Search
- Inventory
Order tracking
- DNS
- WAF
- Load Balancer
- Web Tier
- Orders DB