Online store
0-day streakReview

Your progress

Level 1

0 XP100 XP to level 2
0day streak
0best streak
0topics started
0cards reviewed
    Review cards

    Progress is stored only in this browser. No account is required.

    Design an online store (Amazon): the 60-second story

    Design an online store

    One product page. Six services. A fifth of a second.

    Price from the best of six sellers, “only 3 left”, “get it by Thursday”. Each fact lives in a different system.

    2.3M/s

    internal calls at a sale peak

    230,000 product pages a second, ten times the daily average, each fanning out to about 10 internal calls and waiting for its slowest.

    One call in 100 is slow. How many pages are?

    The page waits for its slowest call. At 20 calls, 18% of pages wait on a slow one. At 150, 78%.

    A call is late. Does the page wait?

    Bad: Wait for every call

    Slow recommendations set the page’s time.

    Good: Deadlines and cut-offs

    Cut optional rows at 100 ms, critical at 150. Never drop or invent the price.

    Around 2001, Amazon’s caches failed together. Then the database.

    Every web server fell back to the database. It locked up; the website and fulfilment centres stopped. Never fall back to the source.

    3.6M badge lookups a second. Ask inventory, and you repeat 2001.

    Push, don’t pull

    Inventory pushes changes into an in-memory stock view; pages read only that. Inventory down? Badges freeze; pages stay up.

    430

    stuck orders an hour from 0.01% failed writes

    At 1,200 orders a second, write then publish: crash in between and the order never ships. Commit it with an outbox row instead.

    Midnight: 10× traffic in one step

    1. Pre-scale to 15×; losing a zone leaves 10×
    2. Warm caches, freeze deploys that week
    3. Shed crawlers and recommendations first, never checkout
    4. Cells: a bad deploy hurts a quarter, not all

    Remember

    The page is a read model: pushed by events, served under deadlines, seconds stale. Checkout is the truth; orders leave through an outbox.