TLDR Tech / Data
How MVCC and Transactions Work in RocksDB
RocksDB tags keys with increasing sequence numbers, so readers snapshot a consistent view while writers append without blocking. Pessimistic transactions lock on write - optimistic ones check conflicts at commit using pre-hashed mutexes. TiDB and CockroachDB skip native transactions and build their own layers.
Read the full story