A model serves 1,000 requests per second, and you log 1 KB (kilobyte, 1,000 bytes) per prediction (inputs, output and model version). How much storage does this take per day, per 30 days and per year (365 days), why do we log predictions at all, and how can you cut the cost?

ML system design, Estimation
Level L2 Elementary. Length Short. Nature Mat Mathematical.

What's being asked

Whether you can convert QPS (queries per second) and record size into daily, monthly and yearly storage, and explain why logs exist and how to keep costs under control.

Key idea

Multiply requests per second by the number of seconds in a day (86,400) and the bytes per log entry. At 1,000 QPS and 1 KB per record, logs grow by 86.4 GB (gigabytes) per day, so teams use sampling and retention policies rather than keeping everything forever.

Steps

  1. Find requests per day: one day has 24×60×60=86,400 seconds, so 1,000 requests/s×86,400 s/day=86,400,000 predictions per day.
  2. Compute storage per day using 1 KB=1,000 bytes and 1 GB=109 bytes: 86,400,000×1,000 bytes=8.64×1010 bytes=86.4 GB/day.
  3. Compute storage for 30 days and 1 year (365 days), using 1 TB=1,000 GB (terabytes): 30×86.4 GB=2,592 GB=2.592 TB, 365×86.4 GB=31,536 GB=31.536 TB.
  4. Explain why teams log predictions: logs let you debug strange outputs, monitor input and score shifts, build fresh training datasets, and join predictions with delayed ground-truth labels (such as whether a click or fraud chargeback happened later).
  5. Describe how to cut storage cost: log a random sample (for example 1% or 10% of traffic), log compact feature IDs instead of raw payloads, compress old logs, and set a retention policy that deletes or archives logs after 30–90 days. Harder monitoring questions build on these logs to join delayed labels and track metrics such as PSI (population stability index).

Common mistakes

How long your answer should be

About 2 minutes; three clean numbers plus reasons and cost controls.

Read this

Previous in ML system design: Why does pure collaborative filtering fail on cold start, and how do you handle cold start for both new users and new items in a recommender system?
Next in ML system design: How would you design a spam filter for a small college email server that receives 5,000 emails a day, of which about 20% are spam? If your model achieves 95% recall and a 0.5% false-positive rate, how many spam emails are missed and how many legitimate emails are wrongly flagged per day?