---
title: "Husky: Efficient compaction at Datadog scale"
description: "Husky, Datadog's observability event store layered over object storage, keeps query cost low by controlling fragment count and layout through streaming compaction."
url: "https://swe.quest/articles/husky-efficient-compaction-at-datadog-scale-eba7e7c7e1831aee"
canonical: "https://www.datadoghq.com/blog/engineering/husky-storage-compaction/"
source: "Datadog Engineering"
published: "2025-01-29"
difficulty: "hard"
kind: "Case study"
reading_minutes: 18
tags: ["storage-engines","analytics","observability","performance","distributed-databases"]
---

# Husky: Efficient compaction at Datadog scale

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2025-01-29, 18 min read, Case study. Original: [https://www.datadoghq.com/blog/engineering/husky-storage-compaction/](https://www.datadoghq.com/blog/engineering/husky-storage-compaction/)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Distributed databases](https://swe.quest/tags/distributed-databases.md) (Data & databases)

## Prerequisites

- columnar storage formats
- LSM-style compaction ([easy posts on Storage engines](https://swe.quest/tags/storage-engines.md?difficulty=easy))
- object storage basics ([easy posts on Storage systems](https://swe.quest/tags/storage-systems.md?difficulty=easy))

## Keywords

Husky, Datadog, FoundationDB, Amazon S3, Parquet

## Related posts

- [Introducing Husky, Datadog’s third-generation event store](https://swe.quest/articles/introducing-husky-datadog-s-third-generation-event-store-c33e11fe78ed46cc.md): Datadog Engineering · 2022-05-17 · Medium · 12 min read · Storage engines, Multi-tenancy, Distributed databases, System design, Analytics & OLAP
  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.
- [Inside Husky’s query engine: Real-time access to 100 trillion events](https://swe.quest/articles/inside-husky-s-query-engine-real-time-access-to-100-trillion-events-a64c982f47949261.md): Datadog Engineering · 2025-10-01 · Hard · 27 min read · Query engines, Storage engines, Search, Observability, Multi-tenancy
  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.
- [Husky: Exactly-once ingestion and multi-tenancy at scale](https://swe.quest/articles/husky-exactly-once-ingestion-and-multi-tenancy-at-scale-e0787135af05f4f3.md): Datadog Engineering · 2023-02-22 · Hard · 21 min read · Multi-tenancy, Distributed systems, Stream processing, Queues & messaging, Analytics & OLAP
  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.
- [The State of SQL-based Observability](https://swe.quest/articles/the-state-of-sql-based-observability-672099654427a9bd.md): ClickHouse · 2023-12-06 · Easy · 16 min read · Observability, Analytics & OLAP, Databases, Cost optimization
  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.
- [Building an Observability Solution with ClickHouse at Dash0](https://swe.quest/articles/building-an-observability-solution-with-clickhouse-at-dash0-f950ba66eb3161c6.md): ClickHouse · 2025-04-07 · Hard · 18 min read · Analytics & OLAP, Observability, Storage engines, Databases, Cost optimization
  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.

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)
