databasekey-value-storeleveldbrocksdb

leveldb why do we need sequence number


the sequence number does give a versioning information, but why do we need that? The SST structure itself already tells you which one is newer and which one is older: when we do compaction, record from L level always overwrite the one in L + 1 level, if they have the same user key.


Solution

  • For RocksDB, the sequence number is used for a few features, including Snapshot, Transactions, etc.