KatInterview

Build a Time-Series Telemetry Platform for Microservice Fleets

System DesignModel answer
MediumModel answerSystem Designsystem-designtime-seriesingestion-pipeline

Last updated

Design a platform that ingests a million telemetry points per second, keeps 30 days of history, and serves dashboard aggregations in under half a second while staying highly available.

Scenario

Your organization runs thousands of microservices. Each one regularly emits numeric measurements such as CPU utilization, request latency, and error counts. You are asked to design a central telemetry platform that gathers these measurements, keeps them for a month, and powers dashboards that engineers rely on during incidents.

What the platform must do

  1. Ingest. Services push measurements over an HTTP endpoint (for example POST /v1/metrics).
  2. Retain. Keep every measurement for 30 days.
  3. Query. Offer a read API that returns aggregated values over a chosen time window, such as "average latency of service X during the past hour".

Quality targets

  • Throughput: sustain about 1 million data points per second.
  • Read latency: typical dashboard queries finish in under 500 ms.
  • Availability: the platform is itself the tool used to diagnose outages, so it must remain highly available.

What to cover in your answer

  1. Data model: how a single measurement and its identifying labels are represented.
  2. Architecture: the main components from the entry point through to the query layer, and how data flows between them.
  3. Storage approach: which kind of database you choose and why, plus how data is compressed and downsampled as it ages.
  4. Trade-offs: how you balance consistency against availability in a system dominated by writes.

Support your choices with rough capacity estimates.

Hints

Hint 1

Start with arithmetic: points per second times seconds per day, then bytes per point before and after compression. Also estimate how many distinct series exist given the reporting interval.

Hint 2

Put a durable buffer (a partitioned log) between the stateless ingestion tier and the storage tier so bursts and storage restarts do not lose data. Think about what the partition key should be.

Hint 3

Decide which aggregates survive downsampling. Averages of averages and averaged percentiles are wrong, so keep components (sum, count, min, max) or mergeable sketches, and have the query layer pick a resolution based on the requested window.

Hint 4

For the consistency discussion, ask what is worse for an on-call engineer: a dashboard a few seconds stale, or a gap in the data. Then explain how idempotent writes make retries safe.