---
title: "Timeseries indexing at scale"
description: "Datadog replaced its timeseries index, which auto-generated materialized indexes from a log of slow queries, with an inverted index that unconditionally indexes every metric;tag pair, much like search engines map words to documents."
url: "https://swe.quest/articles/timeseries-indexing-at-scale-cbd6b9bd5fe12d35"
canonical: "https://www.datadoghq.com/blog/engineering/timeseries-indexing-at-scale/"
source: "Datadog Engineering"
published: "2024-06-28"
difficulty: "medium"
kind: "Case study"
reading_minutes: 20
tags: ["storage-engines","search","databases","observability","scalability"]
---

# Timeseries indexing at scale

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2024-06-28, 20 min read, Case study. Original: [https://www.datadoghq.com/blog/engineering/timeseries-indexing-at-scale/](https://www.datadoghq.com/blog/engineering/timeseries-indexing-at-scale/)

## Summary

Datadog replaced its timeseries index, which auto-generated materialized indexes from a log of slow queries, with an inverted index that unconditionally indexes every metric;tag pair, much like search engines map words to documents. The original Go service used SQLite for index definitions and the query log and RocksDB for Tagsets, Metrics and Indexes. It worked for predictable programmatic queries, but unpredictable user queries fell back to full scans, causing timeouts and manual index toil. The next-gen design drops SQLite, keeps RocksDB, and answers tag filters by intersecting posting lists of timeseries IDs. The two generations are compared on performance and reliability.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Search](https://swe.quest/tags/search.md) (Backend & APIs)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)

## Prerequisites

- key-value stores
- inverted indexes
- timeseries metrics with tags ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))

## Keywords

Datadog, RocksDB, SQLite, Kafka, inverted index, Go

## Related posts

- [Evolving the Backend Storage for Platform Metrics](https://swe.quest/articles/evolving-the-backend-storage-for-platform-metrics-0fb82a7939c98396.md): Heroku Engineering · 2024-05-09 · Medium · 6 min read · Databases, Distributed databases, Observability, Cloud platforms, Schema migrations
  Heroku migrated the time-series store behind MetaaS, its internal metrics service, from self-managed Apache Cassandra to AWS DynamoDB without user-visible impact.
- [10x improved response times, cheaper to operate, and 30% storage reduction: why Instabug chose ClickHouse for APM](https://swe.quest/articles/10x-improved-response-times-cheaper-to-operate-and-30-storage-reduction-why-e1588b943b919f57.md): ClickHouse · 2022-05-03 · Medium · 11 min read · Analytics & OLAP, Observability, Schema migrations, Databases, Scaling
  Instabug moved its mobile APM backend (about 3 billion events per day at roughly 2 million per minute) from Elasticsearch to self-managed ClickHouse after shard tuning and daily indexes failed to keep up with reads and writes.
- [Evolving our real-time timeseries storage again: Built in Rust for performance at scale](https://swe.quest/articles/evolving-our-real-time-timeseries-storage-again-built-in-rust-for-performance-cbd41a18b9630cd7.md): Datadog Engineering · 2025-08-04 · Hard · 21 min read · Storage engines, Rust, Performance engineering, Databases, Concurrency
  Datadog's sixth-generation real-time timeseries database (RTDB) is a Rust rewrite that unifies two earlier engines, one for scalar metrics and one for DDSketch distributions, after earlier generations built on Cassandra, Redis, MDBM, a Go B+ tree and RocksDB.
- [Clever ingests 200x more logs at the same cost with ClickHouse Cloud](https://swe.quest/articles/clever-ingests-200x-more-logs-at-the-same-cost-with-clickhouse-cloud-cafdd48afca59e57.md): ClickHouse · 2026-06-30 · Medium · 8 min read · Observability, Analytics & OLAP, Cost optimization, System design
  Clever replaced a split Datadog/Athena logging setup with ClickHouse Cloud.
- [Bloom filters: the niche trick behind a 16× faster API](https://swe.quest/articles/bloom-filters-the-niche-trick-behind-a-16-faster-api-f8c936f8ee9c7bb2.md): incident.io · 2025-11-14 · Medium · 16 min read · PostgreSQL, Data structures, Performance engineering, API design
  incident.io cut P95 latency of its alert-filtering API for large organisations from 5s to 0.3s by pushing JSONB attribute filters into Postgres using bloom filters.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
