๐Ÿ›ข๏ธ Interactive visualization of storage engines ๐Ÿ›ข๏ธ

๐Ÿ’พ Write Operations

๐Ÿ” Read/Delete Operations

๐Ÿ› ๏ธ Database Operations

Log Entries: 0
Index Entries: 0
Current Offset: 0

๐Ÿ—‚๏ธ Hash Index (In-Memory)

Maps each key to the offset of its latest value in the log.

No active keys in index

๐Ÿ“ Append-Only Log

All writes are appended sequentially. Updates don't modify existing entries.

No entries yet. Add some data!

๐Ÿ“– How It Works

Writes (SET)

New entries are always appended to the end of the log. Updates don't modify existing entriesโ€”they add new ones. The hash index is updated to point to the new offset.

Reads (GET)

First, look up the key in the hash index (O(1)). The index returns an offset. Then, read the value from that offset in the log. Very fast!

Deletes

Append a special "tombstone" marker to the log and remove the key from the hash index. The old entry stays in the log until compaction.

Compaction

Over time, the log grows with duplicate keys. Compaction keeps only the latest value for each key, removing stale entries and reclaiming space.