Data Compression
We’re overhauling Dgraph’s docs to make them clearer and more approachable. If you notice any issues during this transition or have suggestions, please let us know.
Dgraph Alpha lets you configure the compression of data on disk using the
--badger
superflag’s compression
option. You can choose between the
Snappy and
Zstandard compression algorithms, or choose
not to compress data on disk.
This option replaces the --badger.compression_level
and
--badger.compression
options used in earlier Dgraph versions.
The following disk compression settings are available:
Setting | Notes |
---|---|
none | Data on disk will not be compressed. |
zstd:level | Use Zstandard compression, with a compression level specified (1-3). |
snappy | Use Snappy compression (this is the default value). |
For example, you could choose to use Zstandard compression with the highest compression level using the following command:
This compression setting (Zstandard, level 3) is more CPU-intensive than other options, but offers the highest compression ratio. To change back to the default compression setting, use the following command:
Using this compression setting (Snappy) provides a good compromise between the need for a high compression ratio and efficient CPU usage.
Was this page helpful?