What is Badger

BadgerDB is an embeddable, persistent and fast key-value (KV) database written in pure Go. It is the underlying database for Dgraph, a fast, distributed graph database. It’s meant to be a performant alternative to non-Go-based key-value stores like RocksDB.

Github repository

https://github.com/dgraph-io/badger

Configuration

You can find the configuration for Badger here or check the values table below.

Values

Key nametyperequired
Dirstring
ValueDirstring
SyncWritesbool
NumVersionsToKeepint
ReadOnlybool
InMemorybool
MetricsEnabledbool
NumGoroutinesint
MemTableSizeint64
BaseTableSizeint64
BaseLevelSizeint64
LevelSizeMultiplierint
TableSizeMultiplierint
MaxLevelsint
VLogPercentilefloat64
ValueThresholdint64
NumMemtablesint
BlockSizeint
BloomFalsePositivefloat64
BlockCacheSizeint64
IndexCacheSizeint64
NumLevelZeroTablesint
NumLevelZeroTablesStallint
ValueLogFileSizeint64
ValueLogMaxEntriesuint32
NumCompactorsint
CompactL0OnClosebool
LmaxCompactionbool
ZSTDCompressionLevelint
VerifyValueChecksumbool
EncryptionKey[]byte
EncryptionKeyRotationDurationtime.Duration
BypassLockGuardbool
DetectConflictsbool
NamespaceOffsetint
ExternalMagicVersionuint16