Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Datadog Engineering 27 min read Deep dive hardMaster

Inside Husky’s query engine: Real-time access to 100 trillion events

Husky, Datadog's third-generation event store, serves interactive queries over more than 100 trillion events through four multi-tenant services: a planner that splits queries into time-based steps, orchestrators that fetch fragment metadata from FoundationDB and prune with zone maps, a metadata service, and readers that execute against fragments in blob storage. Zone-map pruning cuts downstream work by about 30% on average and up to 60% for structured events. Readers use a Volcano-style iterator model over small row groups of a few hundred rows. Lazy decoding, min/max metadata and cost-ordered predicate evaluation let them skip whole row groups and columns. Text and wildcard search run on per-fragment segments holding posting-list bitsets and n-grams, keeping blob reads and compute to a minimum.

Assumes: columnar storage formatsquery execution operatorsinverted indexesobject storage

Related posts

  • Introducing Husky, Datadog’s third-generation event store

    Datadog Engineering mediumAdept

    Husky is Datadog's third-generation event store, an unbundled, schemaless, vectorized column store that separates compute from storage on top of S3 and a FoundationDB-backed metadata store. The first-gen Logs system broke down through multi-tenant cascading failures. The second gen fixed that with custom sharding but couldn't handle tenant bursts or new product needs, so ingestion was split into stateless Writers, LSM-style distributed Compactors and Readers that coordinate through a strictly serializable metadata store. Because query capacity is decoupled from ingestion, queries can burst across many Readers or be isolated by product or tenant, for example keeping automated monitor queries apart from human ones.

  • Husky: Efficient compaction at Datadog scale

    Datadog Engineering hardMaster

    Husky, Datadog's observability event store layered over object storage, keeps query cost low by controlling fragment count and layout through streaming compaction. Writers flush small sorted fragments into time-bucketed tables. Compactors lazily run size-tiered k-way merges, waiting until a few dozen fragments are available, which cuts CPU and object-store API costs by an order of magnitude. Metadata is swapped atomically in FoundationDB. A custom columnar format with per-column headers and fixed-size row groups lets each compaction use one GET per input, saturate the CPU and run in bounded memory, and sort schemas let queries skip fragments using only their metadata.

  • Husky: Exactly-once ingestion and multi-tenancy at scale

    Datadog Engineering hardMaster

    Husky, Datadog's columnar event store, achieves exactly-once ingestion and cost-efficient multi-tenancy by routing events deterministically to Kafka partition groups (shards), so deduplication only has to happen within a shard. Time-bounded, immutable Shard Placements are allocated per tenant by a Sharding Allocator that uses FoundationDB transactions to give every Shard Router node the same answer. An Autosharder resizes each tenant's shard count from byte-throughput metrics. Consistent hashing with wraparound and shard exclusions keeps placement churn minimal, and a balancer counters hotspots. Limiting how many tenants each writer handles also cuts the number of blob-storage files and compaction work.

  • Fast, Feature Rich and Mutable : ClickHouse Powers Darwinium's Security and Fraud Analytics Use Cases

    ClickHouse easyNovice

    Darwinium, a digital risk and fraud platform, chose ClickHouse to back interactive security and fraud analytics over large, wide, long-retention event data. Its reasons were simpler ingestion than immutable HDFS-style pipelines, AggregatingMergeTree tables that maintain rollups without a separate pipeline, and a single server absorbing thousands of writes per second on ~3k-column rows at under 5% CPU. Map, Array and JSON types absorb fast-changing model signals without schema churn, and tiered SSD-to-S3 retention, sharding and replication handle cost and availability. Group-by queries on a 40M-row, ~3k-column table under varying analyst concurrency are charted as evidence of sub-second interactive performance.

  • Front-end observability at scale: How OpenReplay captures billions of daily events in real time with ClickHouse

    ClickHouse easyNovice

    OpenReplay, a self-hosted session replay and product analytics platform, moved behavioral event storage from Postgres to ClickHouse. Session search dropped from roughly 3–10 seconds to about one second, and ~1 TB event tables compressed to 1–2 GB. ClickHouse's TTL replaced weekend-long delete-and-vacuum retention jobs. A chain of materialized views off a single flat events table cut pipeline changes from two days to half a day, and native JSON makes custom event properties queryable as columns. Each customer deployment runs on a single vertically scaled ClickHouse instance, ingesting up to billions of events and ~6 TB per day, because avoiding sharding keeps self-hosted operations lean.

The quest for software engineering knowledge.

Look:
Layout: