Skip to content

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

Datadog Engineering 12 min read Case study hardMaster

How we extended Apache DataFusion to execute one query across many machines

Datadog built Distributed DataFusion, an open source Rust framework that extends Apache DataFusion's physical execution model so a single interactive query can run across many machines while keeping latency roughly flat as data grows. It reuses DataFusion's partitioning model and adds stages, tasks and network nodes such as NetworkCoalesce and NetworkShuffle. With these it distributes sorts, hash-partitioned aggregations, partitioned and broadcast joins, unions and tree-reduce aggregations, all as streaming execution without intermediate materialization. Datadog chose to extend DataFusion over adopting ClickHouse, Spark, Ballista or Trino because it needed extensibility, low latency, and Arrow/Substrait integration. Some heavy production queries now run up to 10× faster at the same total cost, and the planner keeps small queries on one node to avoid network, serialization and coordination overhead.

Assumes: query execution planshash partitioning and shufflesApache ArrowSQL aggregations

Related posts

  • Composable data management at Meta

    Meta Engineering easyNovice

    Meta has been decomposing its many monolithic data engines (ETL, interactive, streaming, ML preprocessing) into reusable components: language frontend, IR, optimizer, execution library and runtime. Velox, its open-source engine- and dialect-agnostic execution library, is the centerpiece. It uses columnar/vectorized execution, compressed execution via encodings, lazy materialization and adaptive filter/join ordering, and has delivered 3-10x efficiency gains in Presto (Prestissimo) and about 3x in Spark via Gluten. To restore interoperability, Meta upstreamed StringView, ListView and Run-End-Encoding into Apache Arrow. Next steps are the Nimble file format for wide AI/ML tables and hardware-accelerated data systems.

  • Retail data, reimagined: How Increff rebuilt its BI platform with ClickHouse

    ClickHouse mediumAdept

    Increff, a retail SaaS provider for brands like Puma and Adidas, replaced a BI stack of Pandas transformations, a serverless SQL warehouse and Superset after a client with 5x larger data caused query slowdowns and concurrency limits. The rebuilt platform uses DuckDB for most transformations, ClickHouse Cloud for warehousing and Redis caching for dashboards. It handles around a billion records at the same performance as before, with sub-second queries and 70–80% shorter data preparation times. Further tuning included a star schema with daily/weekly/monthly aggregated fact tables, time-based partitioning, LowCardinality and unsigned integer types, Jinja-templated Superset queries to drop unneeded joins, and explicit PREWHERE clauses.

  • Join me if you can: ClickHouse vs. Databricks vs. Snowflake - Part 1

    ClickHouse easyNovice

    ClickHouse Cloud ran a third-party, join-heavy coffee-shop star-schema benchmark (17 queries, originally built to compare Databricks and Snowflake) with no query rewrites or tuning, and came out faster and cheaper at every scale from 721 million to 7.2 billion rows. At the 500m scale most queries finish in under a second, 3–5× faster than the alternatives. At the 1b scale one query joins, aggregates and sorts 1.7 billion rows in half a second where the other systems take 5–13 seconds. The setup used shared-data compute warehouses with parallel replicas on 2–16 nodes, reported the best of 5 warm runs, and is reproducible from a public repo and S3 dataset.

  • How Bullet uses ClickHouse Cloud to give DeFi's fastest exchange real-time analytics

    ClickHouse mediumAdept

    Bullet, a Rust-based DeFi perpetuals exchange running as an app-specific rollup on Solana with ~500μs p50 order processing, indexes 150M+ rows per hour of sequencer events into ClickHouse Cloud for trade history, real-time analytics and monitoring. Events flow from a Rust WebSocket indexer through Kafka (AWS MSK), where Redpanda Connect classifies and routes them into per-event-type ClickHouse tables; ReplacingMergeTree keyed on event number and transaction hash makes the pipeline idempotent so reindexing and backfills deduplicate automatically. Moving off Databricks removed an hourly-batch-to-DynamoDB serving layer, cut query latency from 10-15 seconds to milliseconds, and replaced a 20-30 minute leaderboard cron job with a refreshable materialized view running every 10 minutes. Data freshness improved from 1-2 hours to under 5 seconds at comparable cost with 1,000x more data.

  • Introducing Velox: An open source unified execution engine

    Meta Engineering hardMaster

    Velox is Meta's open source C++ execution engine that unifies the data-plane components (expression evaluation, aggregation, joins, sorting, I/O, resource management) shared by engines like Presto, Spark and PyTorch's TorchArrow. It takes an optimized plan as input and runs it on a single host. It uses an Arrow-compatible columnar vector layout with multiple encodings, vectorized expression evaluation with dictionary peeling and common subexpression elimination, and runtime optimizations such as dynamic filter pushdown and adaptive prefetching. Replacing Presto Java workers with the Velox-based Prestissimo gave up to an order of magnitude speedup on CPU-bound TPC-H queries and 6-7x average speedups on production interactive workloads. Spark integrates Velox through Intel's Gluten via JNI using Arrow and Substrait.

The quest for software engineering knowledge.

Look:
Layout: