Amazon System Design: An E-Commerce Blueprint

Amazon's online store is one of the most copied architectures in tech, and for good reason. It has to show a huge catalog fast, never lose your cart, take payments safely, reserve stock correctly, and survive events like Prime Day.

Many ideas now standard across the industry came from Amazon: service-oriented architecture, small autonomous teams, and the Dynamo paper that inspired DynamoDB, Cassandra and Riak. This post walks through the architecture piece by piece.


๐ŸŽฏ Quick Answer (30-Second Read)

  • Everything is a service: catalog, search, pricing, cart, checkout, payments, inventory and orders are separate services with APIs.
  • Read path: product pages and search are cached heavily and served from many replicas and CDNs.
  • Cart: must always accept "add to cart." Amazon's Dynamo paper (2007) was built around exactly this "always writable" requirement.
  • Checkout: a workflow (saga) that reserves inventory, takes payment and creates the order, with compensation if a step fails.
  • Inventory: reserved at checkout, confirmed at payment, released on timeout.

High-Level Architecture

flowchart TB U["๐Ÿ›’ Shopper"] --> CDN["CDN
images, static assets"] U --> GW["API gateway / web tier"] GW --> CAT["Catalog service"] GW --> SR["Search service"] GW --> PR["Pricing & offers"] GW --> REC["Recommendations"] GW --> CART["Cart service"] GW --> CO["Checkout orchestrator"] CAT --> CDB[("Catalog DB + cache")] SR --> IDX[("Search index")] CART --> KV[("Key-value store
(Dynamo-style)")] CO --> INV["Inventory service"] CO --> PAY["Payments"] CO --> ORD["Order service"] ORD --> EV[["Events"]] --> FUL["Fulfilment, shipping,
notifications, analytics"]

1. The Read Path: Catalog and Search

Most traffic is browsing, not buying. Product pages combine data from many services (details, price, reviews, delivery estimate, recommendations), so:

  • Cache product data aggressively, invalidating when sellers update it
  • Serve images and static files from a CDN
  • Use a search index for queries and filters, updated asynchronously from the catalog
  • Render non-critical widgets (recommendations, "frequently bought together") so they can fail without breaking the page

2. The Cart: Always Writable

Key takeaway: Amazon's 2007 Dynamo paper described the shopping cart as a service that must accept writes even during failures, because "add to cart" failing costs sales. Dynamo chose availability over strict consistency, and merged conflicting cart versions later.

Dynamo's ideas:

  • Consistent hashing to spread data across nodes (Consistent Hashing Explained)
  • Replication to several nodes
  • Versioning to detect conflicting updates; for carts, conflicting versions are merged so added items aren't lost (occasionally a deleted item reappears, a trade-off Amazon accepted)

That's a real-world example of choosing AP in the CAP theorem.


3. Checkout: A Saga

Checkout touches inventory, payments and orders, each owned by a different service. There's no single database transaction across them, so checkout runs as a saga:

sequenceDiagram participant C as Checkout orchestrator participant I as Inventory participant P as Payments participant O as Orders C->>I: Reserve 1 ร— item (hold 15 min) I-->>C: Reserved โœ“ C->>P: Authorise โ‚น2,499 (idempotency key) alt Payment OK P-->>C: Authorised โœ“ C->>O: Create order O-->>C: Order #A123 โœ“ C->>I: Confirm reservation else Payment fails P-->>C: Declined โœ— C->>I: Release reservation (compensate) end

Each step is idempotent so retries are safe (Idempotency Explained), and every failure path has a compensating action (Event-Driven Architecture Explained).


4. Inventory: Don't Oversell

Approach How it works Trade-off
Reserve at checkout Hold stock when checkout starts, release on timeout Accurate, but abandoned checkouts hold stock briefly
Decrement on payment Only reduce stock after payment Risk of overselling popular items
Per-warehouse stock Track inventory by fulfilment centre Enables delivery promises, adds complexity

For flash sales, inventory counters become hot keys. Systems split stock into buckets or use atomic counters in fast stores to handle the burst.


5. Services and Teams

Amazon is known for organising around small teams that own services end to end ("two-pizza teams"), communicating only through APIs. This lets thousands of engineers ship independently, and it's the internal practice that later made AWS possible: Amazon's own teams were already consuming infrastructure as services.


6. Prime Day Scale

  • Prepare capacity in advance for known peaks
  • Load-test critical paths like checkout
  • Degrade gracefully: turn off non-essential features under extreme load
  • Cell-based architecture: AWS has written about splitting services into isolated "cells" so one failure affects only a slice of customers

Frequently Asked Questions

What database does Amazon use for its shopping cart?

Amazon's 2007 Dynamo paper described Dynamo, an internal key-value store built for the shopping cart and other services needing very high availability. Its ideas influenced Amazon DynamoDB and open-source databases like Cassandra, though DynamoDB is a different, managed system.

How does an e-commerce site prevent overselling?

Common approaches reserve inventory when checkout starts and release it on timeout, use atomic decrements in the inventory store, and confirm the reservation only after payment succeeds. For flash sales, inventory can be split into buckets to avoid a single hot counter.

How would you design Amazon in a system design interview?

Separate the read-heavy catalog and search path (caching, CDN, search index) from the write path (cart, checkout, payments, orders). Use a highly available store for carts, a saga with idempotent steps for checkout, inventory reservations with timeouts, and events for fulfilment and notifications.


Conclusion

Amazon's e-commerce design separates fast, cached browsing from careful, transactional buying. An always-writable cart, a saga-based checkout with idempotent steps, inventory reservations and independent services owned by small teams let it scale to Prime Day traffic, and many of these ideas now shape how the whole industry builds.


Sources

Last verified: 2 November 2026.


Related reads: How Does Amazon Make Money? ยท Stripe System Design ยท CAP Theorem Explained ยท Flipkart's Cash on Delivery Bet

I write about system design and how real products are built. Follow on LinkedIn or X, or invite me to speak.