napkin-math
Napkin Math
Use rough orders of magnitude to find the limiting resource before coding. Bias to useful bounds, not faux precision.
Process
-
Name the path - turn the request into one concrete operation: request, job, sync, import, query, deploy, render, or checkout. Done when the hot path is a short ordered list.
-
Attach units - write input assumptions in visible units: RPS, rows, bytes, objects, users, fanout, regions, retries, retention, concurrency. Done when every variable has a unit and a rough value.
-
Load current numbers - when any estimate depends on hardware, network, storage, serialization, compression, or cloud cost, read
sirupsen/napkin-math, especially its README tables, unless repo-local production measurements are more relevant. Done when the numbers used are either copied from the repo-local system or traced to the napkin-math reference. -
Budget each step - estimate latency, throughput, and cost for each step using the numbers below, napkin-math, or repo-local measurements. Done when each step has an optimistic and pessimistic bound.