
Ask HN: Writing my own Relational Database - tosh
I’d like to learn more about relational databases and was wondering if there are any Norvig-style tutorials or textbooks that guide you through a naive implementation.<p>Do you have any pointers? How would you go about it?
======
gjvc
Try reading the SQLite source and tests. The postgres source is also
surprisingly accessible.

------
andreasgonewild
If you really mean relational, and not SQL; then all you need is columns,
tables and records. Just do it, once you have a stupid implementation of your
ideas running you'll know what information to look for. I've been cooking my
own relational persistence engines for quite a while now, here is the latest
incarnation if anyone is interested in seeing the idea cut down to its core
with optional encryption on top:

[https://github.com/andreas-gone-
wild/snackis/tree/master/src...](https://github.com/andreas-gone-
wild/snackis/tree/master/src/snackis/db)

------
segmondy
[https://www.seas.upenn.edu/~zives/03f/cis550/codd.pdf](https://www.seas.upenn.edu/~zives/03f/cis550/codd.pdf)

[https://www.amazon.com/Relational-Model-Database-
Management-...](https://www.amazon.com/Relational-Model-Database-Management-
Version/dp/0201141922)

------
jwilliams
This is a really great idea. I wrote my own (very domain-specific database)
7-8 years ago and it was a really fulfilling project.

Good luck with it. If you do find anything or start your own, please report
back.

------
brett40324
If this is a serious undertaking, you should read 'the red book'
[http://www.redbook.io](http://www.redbook.io)

