Estimating with honest assumptions

Lesson 2 of 26 · A method you can repeat · 2 min · Free Watch this lesson free

How big is it? "Big" is not an answer, and a made-up precise number is worse. A good estimate is a short chain of assumptions you state out loud, so anyone can challenge one link without throwing away the rest.

The goal is the order of magnitude: tens of requests a second or tens of thousands, gigabytes or terabytes. That is enough to choose between designs.

Load for lumen

Here are Lumen's assumptions, and they are only assumptions. Forty thousand people use it on a given day, and each makes ten requests. That is four hundred thousand requests a day. A day has eighty-six thousand four hundred seconds.

So the average is about four point six requests a second. Traffic is never flat, so assume the peak is five times the average. That factor is a rule of thumb you replace with real data as soon as you have any. It gives about twenty-three a second.

Storage and the surprise

Now storage. Assume five million documents averaging twenty kilobytes. That is about one hundred gigabytes of raw text, which fits on a single database server without drama.

But retrieval splits each document into chunks. Assume ten per document, so fifty million chunks, each with an embedding. Assume one thousand and twenty-four numbers per embedding, stored as four byte floats. That is four kilobytes a chunk, so about two hundred gigabytes of vectors, double the text.

Reading the result

Twenty-three requests a second is small for the web tier. The expensive part is that each request may call a language model, so model capacity and cost, not the web servers, are what we must size.

And two hundred gigabytes of vectors matters because a fast vector index wants to sit in memory. That single number could push us toward a dedicated search tier. This is what estimation is for: it points at the decision.

The idea to keep

Write down your assumptions, keep the arithmetic simple, and then ask which number dominates. Round hard, and say the rounding out loud. Next, we turn those requirements and numbers into something concrete: the API and the data model.

This is the narration of a video lesson from System design for senior engineers, AI systems included. In the video it is animated, and you can pause it to ask a question.