AlgoMaster Logo

Design a Time-Series Database

Last Updated: December 29, 2025

Ashish

Ashish Pratap Singh

What makes time-series data special? Three characteristics shape everything about how we design for it:

  1. Append-only writes: Once a CPU measurement is recorded, you never go back and change it. Data flows in one direction, from the present into history.
  2. Time-range queries: Almost every query filters by time. "Show me CPU usage for the last hour" or "What was the p99 latency yesterday between 2pm and 3pm?" Queries that span arbitrary time ranges need to be fast.
  3. Recency bias: Recent data is queried far more often than old data. The metrics from the last hour matter more than metrics from last month. This asymmetry opens up optimization opportunities.

This problem is a common choice in system design interviews, especially for roles involving monitoring, observability, IoT, or financial systems. It tests your understanding of write-optimized storage engines, data compression techniques, and query optimization for time-based access patterns.

The challenge is not just storing data, but doing it at scale while keeping queries fast.

In this chapter, we will explore the high-level design of a time-series database.

Let's start by clarifying the requirements:

Premium Content

Subscribe to unlock full access to this content and more premium articles.