TiKV uses RocksDB as its underlying storage engine for storing both Raft logs and KV (key-value) pairs.
TiKV creates two RocksDB instances on each Node:
- A
rocksdb
instance that stores most TiKV data - A
raftdb
that stores Raft logs and has a single column family calledraftdb.defaultcf
The rocksdb
instance has three column families:
Column family | Purpose |
---|---|
rocksdb.defaultcf | Stores actual KV pairs for TiKV |
rocksdb.writecf | Stores commit information in the MVCC model |
RocksDB can be configured on a per-column-family basis. Here's an example:
[rocksdb]
max-background-jobs = 8
RocksDB configuration options
Name | Description | Default |
---|---|---|
max-background-jobs | The maximum number of concurrent background jobs (compactions and flushes) | 8 |