news.volyx.in

Build your own database (nan.fyi)

547 points by nansdotio · 277 days ago · 93 comments on HN

Article summary

The article provides a step-by-step guide to building a key-value database from scratch, exploring how to store data persistently and efficiently look it up later. It discusses the challenges of updating and deleting records in a file-based database and introduces the concept of append-only files and indices to improve performance. The article also touches on the trade-offs between memory usage and performance when using an index. The database design is simplified and explained through examples and animations.

Main themes

  • Database design
  • Key-value stores
  • Append-only files
  • Indices and performance
  • Data persistence
  • Efficient lookup

What commenters say

  • The problem of storing data persistently and efficiently looking it up later is a single problem with two interconnected aspects.
  • The statement 'store data persistently and then efficiently look it up later' implies two separate problems, not one.
  • A write-only database, where data is written but never read, would be equivalent to writing to /dev/null and has limited utility.
  • The article's use of 'lorem ipsum' examples can make the content less engaging and less realistic.
  • The design and animations in the article are visually appealing and effective in explaining complex concepts.
  • A database that only writes data without allowing reads would have limited practical applications, such as logging or backups, but would not be useful for most use cases.
  • The concept of reconstructing past memory states is not a primary concern for database design, but rather a byproduct of storing and retrieving data.
  • The problem of storing data persistently and efficiently looking it up later is a fundamental challenge that encompasses multiple sub-problems and trade-offs.