KatInterview

Design a Time-Series Metrics Collection and Alerting Platform

System DesignModel answer
MediumModel answerSystem Designtime-seriesdistributed-systemsdata-modeling

Last updated

Build a system that ingests numeric measurements from distributed services, persists them efficiently, powers query dashboards, and triggers alerts.

You need to architect a platform that handles observability data from a large-scale distributed infrastructure. Machines and applications continuously generate numeric measurements—things like throughput counters, failure rates, response times, and resource utilization figures. Your platform must ingest these observations, maintain them as queryable time-indexed data, enable visualization through dashboards, and notify operators when thresholds are violated.

The scope is broad, so you should outline the full architecture at a high level, then select one or two critical subsystems to design thoroughly.

Questions to Consider

  • Which component(s) should receive the most detailed treatment: ingestion, persistence, query execution, or alert delivery?
  • What is the scale? How many reporting entities exist, what volume of measurements does each produce per minute, and how many unique data streams result?
  • Does the architecture use a push model where sources send data, or pull where the platform scrapes endpoints?
  • What retention policy applies, and should older data be downsampled or aggregated?
  • What latency is acceptable for dashboard updates and alert firing? Can occasional data loss be tolerated?
  • Is the system limited to numeric telemetry, or must it also handle structured logs and distributed traces?
  • How are notifications delivered, and what management features (grouping, suppression, escalation) are needed?

Hints

Hint 1

Start with a clear data model: what fields identify a unique series, and how are individual observations structured?

Hint 2

Time-series workloads have distinct characteristics—mostly appends, time-range queries, and high compression potential. Storage design should exploit these patterns.

Hint 3

Alert evaluation must remain reliable even when the system is degraded or data arrives late. Consider how to detect and handle missing measurements.