Ash HN: What are some good resources on building a relational database?
I was hoping to build a simple relational database as a side project, focussing mainly on learning how the internals and the algorithms used work, as I never plan to make this a published product of any sort.
So far I have the CMU Advanced DB course (https://15721.courses.cs.cmu.edu/spring2024/) and the Database Internals book.
While I'm learning a lot about how databases work, I have no clue how to start writing my own, so I was wondering if there were any resources for building a relational database, I've only found some for KV Stores. Hopefully something less intimidating to get started than having to read SQLite code.
15 comments
[ 4.4 ms ] story [ 56.4 ms ] threadYou can widen the search a bit by taking out 'implementation' and trying some other terms like 'book', 'internals', etc.
That class drops a few buzz words in its advert: OLAP and dirty!
What sort of "simple" RDBMS are you envisioning that is different from the current lot?
One could probably go quite a ways in bare python with lists of dataclasses and pickles, never mind the performance.
That's your backend.
Then you might find some prior art in the way of a SQL parser for a front end.
Then there's also some projects who have tried to port or re-create SQLite in Rust.
They publish their latest course videos every year, during the year. Andy Pavlo is highly knowledgeable about the field.
I know you mentioned about RDBMS, but may I introduce you to a structured path for building a KV Store, which can be a foundation for a RDBMS? My project is in TDD fashion with the tests. So, you start with simple functions, pass the tests, and the difficulty level goes up. When all the tests pass, you will have written a persistent key-value store.
https://github.com/avinassh/py-caskdb
https://15445.courses.cs.cmu.edu
Lectures start next month. Or you can watch previous years. Learn to walk before you run.