BUILD YOUR OWN DATABASE
This article goes over how to build a key-value database from scratch. It starts with a simple file-based approach for storing data, but explains its inefficiency for updates and deletes. It then introduces append-only files, compaction strategies to manage file size, and indexing to improve search performance. Finally, it explains how these techniques combine to form a Log-Structured Merge Tree (LSM Tree), used in many real-world key-value databases.