Home›Design›Amazon, add to cart and check out
Design · System design X-ray

Amazon: add to cart, then check out

The Dynamo paper started with the shopping cart. Switch between 2007, when a cart had to take a write even with machines failing, and the era of DynamoDB and Prime Day. Tap any box for what it does, why it is there, and what Amazon has published, with the source. Where Amazon has said nothing, the box says so.

The X-ray

Follow one request

Press a request to watch it travel. Facts come from Amazon and AWS publications, listed at the end. Boxes marked generic describe a role, not Amazon's design.

The story

From a cart that must never refuse a write to Prime Day

The cart is the problem

It is 2007. A page on Amazon.com is built by calling over 150 services. One of them owns the cart. The Dynamo paper starts there: customers should be able to view and add items even if disks are failing. Werner Vogels describes the rule behind it: each service has a team that is completely responsible for it, you build it, you run it, and nobody reads its database from outside.

Always writeable

So Dynamo gives up something to keep the cart open. It keeps three copies. A write succeeds when two have it. If a node is down, another node holds the write with a hint and hands it back later. If two writes land on different copies, vector clocks show the conflict and the cart service merges the versions. The paper is open about the cost: a deleted item can come back.

Running it yourself does not scale

Dynamo worked, but each team ran its own installation. DynamoDB is the managed version: many customers share it, and AWS handles provisioning, failures and upgrades. Each partition has replicas in different zones and a leader. A write is acknowledged once two of three replicas have it.

Leaving Oracle

In 2019 Amazon\'s consumer business turned off its final Oracle database. Nearly 7,500 databases and 75 PB moved to DynamoDB, Aurora, RDS and Redshift. Database costs fell over 60%, latency 40%, and admin overhead 70%. The choice followed the data: the Financial Ledger and Wallet went to DynamoDB, Buyer Fraud to Aurora. Amazon has not published the checkout path, so this page shows checkout as a generic role.

Prime Day

AWS has published the peaks every year. DynamoDB peaked at 89.2 million requests a second in 2021, 146 million in 2024, 151 million in 2025 and 192 million in 2026. In 2026 it served over 59 trillion requests in four days, still with single-digit millisecond responses.

Changes ship in small steps

Amazon\'s Builders\' Library describes the pipeline. A change goes to one box serving at most about ten percent of requests, then a low-traffic Region, then busier ones, one zone at a time. Alarms roll it back by themselves. A typical pipeline reaches all Regions in about four or five business days.

The design docs behind it

Each part of this system has its own design doc: Store orders and inventory · Product catalog · Accounts and sessions. The whole story starts at System design 1: one server.

Decisions you can reuse

What to take from it

One owner per piece of data

Other services call the cart service. They do not read its database. That lets the owner change storage freely.

Choose availability on purpose

For a cart, a refused write loses a sale. Dynamo accepts writes and sorts out conflicts later. See System design.

Plan for conflicts

If copies can diverge, the app needs a merge rule. For carts it is a union, and the cost is that a deleted item can come back.

Keep money paths stricter

The cart can be eventually consistent. Ledgers and payments need transactions or a quorum acknowledgement before you answer. Amazon has not published its checkout path, so treat this as a design rule, not a claim about Amazon.

Roll out in small steps

One box, then one zone, then one Region, with alarms that roll back by themselves.

Pick the store per data shape

Key lookups in DynamoDB, transactional records in Aurora. See Database families.

Part 3 of 4 · Design · 28 pagesAll pages

Which database does my application need? What kind of application data goes in which database, and why, as design docs, plus the anti-patterns and the decisions behind them.