System Design Problem

Design a Time-Series Database

Commonly Asked By:InfluxDataDatadogPrometheusAWS

  • Ingest time-stamped data points at high throughput (metrics, IoT, financial ticks)
  • Write format: (metric_name, tags, timestamp, value)
  • Query by metric name + tag filters + time range
  • Aggregation queries: avg, sum, min, max, percentile over time windows
  • Downsampling: automatically roll up high-resolution data for older data
  • Retention policies: auto-delete data older than configured retention
  • Tag-based indexing: efficiently filter by any combination of tags
  • Support rate, derivative, moving average, and other time-series functions
  • Alerting integration: trigger alerts based on threshold queries

Time-series database architecture based on the Prometheus TSDB model: WAL → in-memory HEAD block → immutable blocks on disk → compaction → downsampling to object store.

Loading...