The Guts n’ Glory of Database Internals

A year ago Oren Eini (a.k.a @ayende) wrote a series dubbed “The Guts n’ Glory of Database Internals”.

Instead of just explaining how databases work, He incrementally builds a database from scratch. He goes over most database essentials, so once done you’ll be able to understand how databases actually work. If you haven’t taken any database courses at Uni, this is a must in my opinion.

The series is built around a “book keeping’ system. The problem? We need to keep track of users and how often they log into the system

He begins at persisting the data to a simple csv file, and then raises issues with this solution. The next part in the series addresses those issues and raises new ones: from selection time, concurrency, durability, logging and more.

Each part builds upon the previous and most parts take around 5 minutes to read.
The series is made up of 20 parts and takes ~ 1.5hrs to read from start to finish. Not so bad, right?

By the way, @ayende writes really well, so it’s also fun to read:

  1. Persisting information | 6 minutes
  2. Searching information and file format | 4 minutes
  3. The LSM option | 3 minutes
  4. B+ Tree | 11 minutes
  5. Seeing the forest for the trees | 4 minutes
  6. Managing Records | 7 minutes
  7. Managing Concurrency | 6 minutes
  8. Understanding durability with hard disks | 6 minutes
  9. Durability in the real world | 4 minutess
  10. Getting durable, faster | 3 minutes
  11. Writing to a data file | 3 minutes
  12. The enemy of thy database is… | 4 minutes
  13. The communication protocol | 4 minutes
  14. Backup, restore and the environment… | 4 minutes
  15. The curse of old age… | 5 minutes
  16. What the disk can do for you | 2 minutes
  17. What goes inside the transaction journal | 8 minutes
  18. Log shipping and point in time recovery | 3 minutes
  19. Merging transactions | 4 minutes
  20. Early lock release | 2 minutes