Data compression on Disk
Dgraph Alpha lets you configure the compression of data on disk using the
--badger.compression option. You can choose between the
Zstandard compression algorithms, or choose
not to compress data on disk.
--badger.compression_leveloption used in earlier Dgraph versions.
The following disk compression settings are available:
||Data on disk will not be compressed.|
||Use Zstandard compression, with a compression level specified (1-3).|
||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:
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.