← All comparisons

LZ4 vs Snappy

A side-by-side feature comparison.

Summary

LZ4 and Snappy are the two real-time compressors of choice for databases, filesystems, and streaming pipelines. Both prioritize speed over ratio. LZ4 is slightly faster and slightly better; Snappy is more deeply embedded inside the Hadoop ecosystem.

Bottom line: LZ4 for new pipelines. Snappy when working inside the Google / Hadoop world.

Feature comparison

Feature LZ4 Snappy framed
Author Yann Collet Google
Compression speed Very fast Very fast
Decompression speed Memory speed Memory speed
Compression ratio Slightly better Slightly worse
Splittable for Hadoop Yes (LZ4 frame) Yes (snappy framed)
Inside ZFS / Btrfs Yes No
Library license BSD Apache 2.0

About LZ4

LZ4 is an extremely fast compression algorithm focused on speed rather than ratio. It can compress at gigabytes per second and decompress even faster, making it the choice when CPU is the bottleneck. ZFS, the Linux kernel boot image, and many databases use LZ4 internally.

Read the full LZ4 guide →

About Snappy framed

Snappy is Google's fast compression library used inside BigTable, LevelDB, RocksDB, and many Hadoop pipelines. The framed .sz file format wraps Snappy chunks in a stream that can be split and processed in parallel — important for Hadoop's file processing model where a compressor that cannot be split forces the whole file to be processed by a single worker.

Read the full Snappy framed guide →

More comparisons