Skip to content

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

Datadog Engineering 21 min read Case study hardMaster

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

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.

Assumes: Kafka partitionsconsistent hashingmulti-tenant data pipelinesexactly-once semantics

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

  • Rapidly scaling online storage to serve over 1 billion ChatGPT users (Part II)

    OpenAI mediumAdept

    OpenAI's Habitat storage platform went from one shared Azure Cosmos DB container, to per-use-case dedicated containers, and back to a shared multi-tenant container. Shared containers suffered from logical partition key collisions, noisy neighbors on physical partitions, and "weak partitions" whose throughput shrank as storage-driven splits divided fixed RU/s. Dedicated containers fixed isolation but lost the smoothing effect of aggregate load, which pushed capacity planning onto every product team and caused launch-day SEVs. Hot-key throttling, QoS request tiering and a new serverless mode built with Azure (10K RU/s per physical partition, plus RU-usage-based splits) made shared tenancy work. Failover and failback outages at 20M+ QPS scale also led to co-managed operations with Azure, including joint monitoring and production-sized test accounts.

  • How we built reliable log delivery to thousands of unpredictable endpoints

    Datadog Engineering mediumAdept

    Datadog's Log Forwarding avoids head-of-line blocking from Kafka's per-partition FIFO ordering by moving logs out of Kafka early into cloud object storage, grouped by destination. A stager service reads logs from Kafka and writes slice files of individually compressed per-destination slices, which it uploads and registers in a metadata store before committing Kafka offsets. A leader-elected planner builds lightweight forwarding tasks from eligible slices based on each destination's batching settings. Shipper workers range-read only the slices they need, send them to the endpoint and retry failures with exponential backoff, which gives per-endpoint isolation without a Kafka topic per destination and scales horizontally to gigabytes per second.

The quest for software engineering knowledge.

Look:
Layout: