Engine: live
CockroachDB, inside
How a distributed SQL database keeps its rows on one node: as sorted keys with MVCC timestamps, in a log-structured merge tree written by Pebble. Drop a store's files and see them, down to the bytes and back up to the rows.
Store viewerDrop a store's files: the LSM tree, every block and key, blob files, the WAL, and the SQL tables rebuilt from them. Nothing is uploaded.How it is storedThe keyspace, rows as keys, MVCC timestamps, values and column families, the schema in system tables, and Pebble's columnar files.
Start here
- Open the sample store: one CockroachDB node with a music catalogue of three tables.
- Click SQL tables, then
music.albums: rows rebuilt from the files. Click keys on a row to see its keys and every MVCC version, and which file each came from. - Back on the store view, open 000032.sst and a data block: the roach key, MVCC timestamp and value of each row, and how the block stores them in columns.
- Open a
.logfile: the writes not yet flushed to a table.
CockroachDB stores data in Pebble, an LSM tree in the same family as LevelDB and RocksDB; the RocksDB section explains the shared ideas.