Maps each key to the offset of its latest value in the log.
All writes are appended sequentially. Updates don't modify existing entries.
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.
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!
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.
Over time, the log grows with duplicate keys. Compaction keeps only the latest value for each key, removing stale entries and reclaiming space.