~learn.
0:00 / 1:13
Side quest 34 · Amazon Prime Day

You deleted it from your cart. It came back.

transcript

You remove a phone case from your cart. Later, it's back. Amazon's 2007 Dynamo paper said this could happen. And accepted it.

The rule: Add to Cart can never be forgotten or rejected. Not even when data centres are being destroyed by tornados.

On the bus, your phone adds headphones. One bar of signal. At home, your laptop removes the case. From an older copy.

Last write wins? Your headphones vanish. A lost add. So Dynamo merged by union. Every item from both. The headphones survive. And the deleted case comes back.

Amazon watched the cart for 24 hours. 99.94 percent saw one version. A tiny fraction saw two to four. Usually busy robots, rarely humans.

But here's the fix. Give every add its own tag. A remove deletes only the tags it saw. Merge all tags, minus removed ones. Headphones in. Case out. Keep removed tags as tombstones, until every copy catches up.

Never lose an add. And never bring back a remove.

Full breakdown in the lecture.