TiKV uses RocksDB internally to store Raft logs and key-value pairs.

    TiKV creates two RocksDB instances on each Node:

    • A rocksdb instance that stores key-value data.
    • A raftdb that stores Raft logs and has a single column family called raftdb.defaultcf.

    The rocksdb instance has three column families:

    Column familyPurpose
    rocksdb.defaultcfStores actual KV pairs for TiKV
    rocksdb.lockcfStores transaction lock
    rocksdb.writecfStores transactions’ commit and rollback record

    RocksDB can be configured on each column family. Here’s an example:

    1. [rocksdb.writecf]
    2. whole-key-filtering = false

    You can find all the RocksDB configuration options here.