~learn.
0:00 / 1:19
W01 · Data at scale

Just use PostgreSQL? Not at 100 million records.

transcript

Where does your data live? Easy. Just use PostgreSQL. Great answer. Until it meets four numbers.

100 million records. 10,000 requests a second, from users on three continents. And 99 point 99 percent uptime. Now just use PostgreSQL isn't an answer.

And your data isn't fair. 0.01 percent of short links get 90 percent of the traffic. Every other link shares what's left. Then one link goes viral. A million hits a second, on a single key.

Your rate limiter loses a Redis node. Over-allow, or under-allow? A datacenter fails over. What does your user see? A user shares a brand new link. A friend clicks, on an async replica. What happens?

A developer asks one thing. PostgreSQL, or MongoDB? A systems engineer asks first. What are the access patterns? What consistency do we actually need? What happens when a node fails? Only then: here's how we store it.

Five days. Split it. Copy it. Throttle it. Survive the hot key. Then a session store. This is the week you stop using databases, and start designing storage.

Full breakdown in the lecture.