There's a chapter everyone who prepared for a system design interview has read: "Back-of-the-envelope estimation" in Alex Xu's System Design Interview . Divide DAU by 86,400, double it for peak, multiply out the storage for a few years β and you get "1,160 writes per second, 11,600 reads, 36.5 TB". I could do that arithmetic too. Then I asked myself a simple question: "and will Postgres actually take it?" β and realised I didn't know. I knew how to compute the load. I had no idea what happens to the database when that load arrives.
So instead of guessing, I measured. I took the system from chapter 8 of the same book β the URL shortener β built it in Docker on my laptop, worked out from the book what it should sustain, and pointed a load generator at it. Below: the estimate, the stand, the numbers, and what I learned from them.β¦