HandbookXV the PantheonBack-of-the-envelope estimates
XVthe Pantheon, Design the systemBack-of-the-envelope estimates
In plain words
A back-of-the-envelope estimate multiplies a few rough numbers, such as users, requests per user and bytes per record, to find the scale a design must handle before you commit to it.
Where you see it
Someone proposes storing every deploy log line in Harbor's main Postgres database. Five minutes of arithmetic: 50,000 deploys a day, 2,000 lines each, 200 bytes a line, kept for 90 days. That's about 1.8 TB, which changes the conversation before any code exists.
What goes wrong
- False precision
1,157.4 writes a second suggests a certainty you don't have. Round to one or two significant figures; the question is whether it's a thousand or a million.
- Planning for the average
Traffic arrives in peaks: Monday mornings, launches, retries after an outage. Multiply the average by a peak factor, and check the design holds at the peak.
- Hiding the assumptions
An estimate with no visible inputs can't be checked or updated. Put each assumption on its own line, so someone who knows better can change one number.
What to tell your agent
Quick check
Sign in to earn +10 XP for itHarbor's API gets 100 million requests a day. Roughly how many is that per second, on average?