Skip to content

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

Meta Engineering 11 min read Announcement mediumAdept

Introducing OpenZL: An Open Source Format-Aware Compression Framework

OpenZL is Meta's open source lossless compression framework for structured data. It applies a configurable graph of reversible transforms, such as array-of-structs to struct-of-arrays, delta, transpose and tokenize, to expose order before entropy coding. An offline trainer builds plans from SDDL format descriptions or parsers, and each frame embeds its resolved decode recipe, so one universal decoder handles every format and plan. On the Silesia sao file it reaches a 2.06x ratio at 340 MB/s compression and 1200 MB/s decompression, versus 1.31x for zstd -3 and 1.64x for xz -9. It falls back to zstd on unstructured text, and CSV parsing caps compression speed at about 64 MB/s.

Assumes: lossless compression basicsentropy codingcolumnar data layouts

Related posts

  • Five Methods For Database Obfuscation

    ClickHouse hardMaster

    ClickHouse needed publishable benchmark data that kept the properties driving analytical query performance in its private web analytics dataset: compression ratio, per-column and cross-column cardinality, and value distributions such as power laws. The post compares approaches to obfuscating that data. Hand-written probabilistic models in C++ were too laborious and specific to one dataset. An LSTM that generated TSV dumps produced gigabyte-sized models, ran at about 100 rows per second and distorted character frequencies. Mutating the literals inside LZ4-compressed data preserved compression ratio and decompression speed while removing every original byte, guided by heuristics that keep structure such as valid UTF-8.

  • Compressing nginx logs 170x with column storage

    ClickHouse mediumAdept

    Parsing nginx access logs into typed columns in ClickHouse and tuning storage raises compression from roughly 38x (ZSTD on the raw file) to about 178x on a 66.7M-line, 20 GB dataset. Regex extraction into separate columns alone reaches 56x. Choosing tighter types (IPv4, UInt16/UInt32), LowCardinality dictionary encoding for columns under ~100k distinct values, and codecs such as Delta plus ZSTD lifts it to 92x. Picking an ordering key that groups low-cardinality, high-volume columns so similar values sit together pushes it past 170x, though production keys must also balance query access patterns.

  • Superpack: Pushing the limits of compression in Facebook’s mobile apps

    Meta Engineering hardMaster

    Superpack is Meta's asymmetric compressor that combines compiler analysis with data compression, cutting Android app size by over 20% on average versus default Zip compression for apps like Facebook, Instagram, WhatsApp and Messenger. Grouping instructions by AST type yields longer LZ matches and shorter distances, with hierarchical compression folding the split/no-split decision into the optimal parse. Compiler-derived contexts such as opcodes lower the entropy of literals, and unstructured data like Dex references is turned into small register-based programs, which makes compression a register allocation problem. It targets Dex, ARM machine code and Hermes bytecode, is written in OCaml (compressor, SMT-based parsing) and C (decompressor), and trades slow compression for fast decompression, so it does not suit streaming use.

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

  • Speeding up LZ4 in ClickHouse

    ClickHouse hardMaster

    LZ4 decompression often tops ClickHouse query profiles because highly compressible, cached columnar data shifts the cost onto CPU, yet storing data uncompressed proved impractical due to disk space. LZ4 is an LZ77 variant whose compressed blocks alternate literals and matches within a 64 KB sliding window, and whose compressor finds matches through a hash-based "cache table". Decompression speeds up when generic memcpy is replaced by inlined over-copying routines such as wildCopy8, which may safely read and write extra bytes inside buffer bounds. The fast decoder skips bounds checks on match copies, so untrusted input needs checksums, guard pages or the safe decoder.

The quest for software engineering knowledge.

Look:
Layout: