Skip to content

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

Datadog Engineering 18 min read Case study hardMaster

Husky: Efficient compaction at Datadog scale

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.

Assumes: columnar storage formatsLSM-style compactionobject storage basics

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.

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

    Datadog Engineering hardMaster

    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.

  • 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.

  • The State of SQL-based Observability

    ClickHouse easyNovice

    Observability is increasingly treated as a SQL analytics problem, with OLAP column stores like ClickHouse replacing the NoSQL backends (Cassandra, Elasticsearch, Splunk) that dominated after Twitter's 2013 observability stack. OpenTelemetry standardizes collection, ClickHouse handles storage, and Grafana handles visualization and alerting. ClickHouse's case rests on columnar compression (around 14x on logs), S3-backed separation of storage and compute, materialized views for structuring logs at insert time, and approximate aggregate functions. One cited experiment handled 14TiB of logs for about $300 a month, with the tradeoff that object storage gives up some query speed for simpler operations.

  • Building an Observability Solution with ClickHouse at Dash0

    ClickHouse hardMaster

    Dash0 stores all OpenTelemetry metrics, logs and spans in ClickHouse, using PostgreSQL only for customer settings, so signals can be joined and correlated in one system. The setup tiers storage with 1-2 days on local disk, then AWS S3 plus a local cache, driven by TTL moves, and keeps metrics for 13 months. Tables are ordered by a ResourceHash before Timestamp for better filtering and compression, with daily partitions bounding time ranges, and the cluster runs as a single shard with multiple replicas. Metric metadata is deduplicated into an AggregatingMergeTree table keyed by MetricHash with FirstSeen/LastSeen tracking, and queries against it must use GROUP BY or FINAL because merges are not guaranteed to have happened.

The quest for software engineering knowledge.

Look:
Layout: