Skip to content

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

Meta Engineering 9 min read Case study mediumAdept

Tulip: Modernizing Meta’s data platform

Meta migrated its exabyte-scale analytics logging platform from legacy Hive Text Delimited and JSON serialization to the Tulip format across more than 30,000 logging schemas, sharply cutting bytes logged per second while schema counts stayed flat. The migration relied on a mixed-mode wire format, where Tulip payloads are prefixed with the invalid UTF-8 bytes 0x80 0x00 so old and new formats can coexist on one Scribe stream. Supporting tools included format-agnostic Reader libraries and legacy-format converters in consumers, shadow loggers verified by a Spark job comparing rows by ID, a loggertail CLI for decoding streams, and rate-limited rollouts. Scaling to the long tail depended on daily automated targeting of schemas whose consumers were all ready, plus a live migration guide, support group and office hours.

Assumes: data serialization formatslogging pipelinesdata warehouse basics

Related posts

  • Tulip: Schematizing Meta’s data platform

    Meta Engineering mediumAdept

    Tulip is Meta's binary serialization protocol for analytics logging, built on Thrift's TCompactProtocol. It replaces the positional Hive Text Delimited and JSON formats, which broke when columns were inserted or deleted and offered no forward or backward compatibility. Engineers declare only field names and types, and the platform assigns field IDs in a transactionally updated serialization schema. IDs are never removed, so a type change gets a new ID and a rename is treated as a delete plus an add. Compared with the legacy formats, Tulip uses 40–85% fewer bytes and 50–90% fewer CPU cycles to (de)serialize.

  • Data logs: The latest evolution in Meta’s access tools

    Meta Engineering mediumAdept

    Meta serves per-user data logs from its Hive data warehouse, which cannot handle per-user point queries, by batching many Download Your Information requests into one full-table scan. A scheduled job collects recent requests into a batch run on the Core Workflow Service. It writes the requester IDs to a Hive table, then runs per-table and per-partition Dataswarm jobs that INNER JOIN against each table's owner column. PySpark splits the results into per-user files, and a Hack post-processing step applies privacy filters and renders readable HTML. Lessons include checkpointing for resilience against out-of-memory and timeout failures, a user-ID verification step added after a Spark partitioning bug nearly returned data to the wrong user, and an experimentation platform for testing workflow changes.

  • How trip.com migrated from Elasticsearch and built a 50PB logging solution with ClickHouse

    ClickHouse mediumAdept

    Trip.com replaced its Elasticsearch-based centralized logging platform with ClickHouse after hitting stability, ingestion and cost limits at 4PB, and has since grown it toward 50PB. The migration used a ReplicatedMergeTree schema with daily partitions, ZSTD codecs, LowCardinality columns, tag key/value arrays and tokenbf_v1 bloom-filter indexes. Kibana was extended with custom ClickHouse panels, and scripts migrated 95% of dashboards automatically. The result was over 50% storage savings and queries 4–30x faster (P90 under 300ms). Further growth caused ZooKeeper-driven DDL timeouts, which led trip.com to split into multiple clusters and to evaluate ClickHouse Cloud with SharedMergeTree.

  • Migrating Data Ingestion Systems at Meta Scale

    Meta Engineering mediumAdept

    Meta migrated tens of thousands of MySQL-to-warehouse change data capture (CDC) ingestion jobs, together moving several petabytes daily, from customer-owned pipelines to a self-managed warehouse service, and fully retired the legacy system. Each job went through shadow, reverse-shadow and cleanup phases, with promotion gated on matching row counts and checksums plus no regression in landing latency or resource use. Because CDC carries bad data forward into new partitions, bad partitions were flagged in metadata to halt delta landing or fall back to older target partitions, and backfills gave early rollback signals. Automated promotion/demotion tooling, batch selection that excluded jobs with known issues, and reuse of legacy snapshots cut expensive full dumps under limited capacity.

  • Unlocking Efficiency and Performance: Navigating the Spark 3 and EMR 6 Upgrade Journey at Slack

    Slack Engineering mediumAdept

    Slack migrated 60+ EMR clusters serving 40+ teams from EMR 5 (Spark 2.4/Hive 2) to EMR 6 with Spark 3 as the single compute engine. Old and new clusters ran side by side during the year-long move. A shared Hive Metastore upgraded from 2.3 to 3.1 via Hive Schema Tool, parallel Bazel builds for Spark 2 and 3 JARs, and an Airflow operator flag to route jobs between cluster versions made that possible. Code changes covered replacing RAND()-based skew salting with AQE, setting storeAssignmentPolicy to Legacy, and disabling convertMetastoreParquet to avoid schema-merge StackOverflowErrors. Exact-match validation with Trino except/count queries preceded the switch, and most pipelines then ran 30–60% faster (some 90%), helped by AQE skew-join handling, shuffle partition coalescing and the EMRFS S3-optimized committer.

The quest for software engineering knowledge.

Look:
Layout: