Skip to content

Design a URL Shortener, stage 1 of 9: model

Estimate the load

Before drawing any boxes, work out how much traffic and data this system really has. Rough numbers are enough: you only need to know whether something fits on one machine or needs many.

System so far· 5 parts
123CLIENTClickersSERVICERedirect serviceDATABASEPostgresSERVICELinks APICLIENTCustomerdashboard

Select a component to see what it is responsible for and which state it owns.

  1. 1Redirect service → Postgres: Look up code
  2. 2Customer dashboard → Links API: Create, edit, disable
  3. 3Links API → Postgres: Insert with unique code

What you need to know

0 of 4 checks done
  1. Requirements usually come as monthly or daily totals. Systems fail per second, so convert.

    A month has about 2.6 million seconds (30 days × 86,400 seconds). Divide a monthly total by 2.6 million to get the average per second. Traffic isn't flat, so multiply by the peak factor to get the rate you actually have to handle.

  2. Work it out

    100 million new links a month. About how many links are created per second, on average?
    per second