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:

SettingNotes
noneData on disk will not be compressed.
zstd:levelUse Zstandard compression, with a compression level specified (1-3).
snappyUse 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:

dgraph alpha --badger compression=zstd:3

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:

dgraph alpha --badger compression=snappy

Using this compression setting (Snappy) provides a good compromise between the need for a high compression ratio and efficient CPU usage.