Engine: live

Redis, inside

An in-memory database still has to survive a restart. Redis writes snapshots, each key's value in the compact form it has in memory, and an append-only log of commands. Drop the files and see both, down to the bytes and back up to the keys.

RDB and AOF viewerDrop dump.rdb or an appendonlydir: every key and value, its bytes, the file's records, and the AOF replayed. Nothing is uploaded.How it is storedThe RDB file's records and lengths, listpacks, intsets, quicklists, templates, TTLs, streams, roaring bitmaps, modules, and the AOF.

Start here

  1. Open the sample: the AOF replayed, 558 keys in two databases.
  2. Click artist:7: a hash, and the listpack that holds it, entry by entry.
  3. Open AOF: the commands written after the snapshot, each rewritten into a form that replays exactly.
  4. Open dump.rdb: every record of the snapshot in order, from the header to the checksum.

Unlike the B-tree and LSM engines elsewhere on this site, Redis never reads its files while it runs: they exist to be loaded whole. That is why an RDB file has no pages or index, only a stream of records.