Hacker News new | ask | show | jobs
by kbradero 3604 days ago
is there a book/documents about DB internals ? I have found some books about theory but not about an actual implementation.
3 comments

Because there are many different implementations, with different trade-offs and design decisions. Also, the implementation-specific documentation is typically kept fairly close to the code, as the docs need to be kept in sync.

So for example if you need to know how indexes in PostgreSQL work, look into the READMEs in the proper directory:

b-tree indexes: https://github.com/postgres/postgres/blob/master/src/backend...

gin: https://github.com/postgres/postgres/blob/master/src/backend...

brin: https://github.com/postgres/postgres/blob/master/src/backend...

etc. The READMEs also include links to related papers etc.

hey thanks!, tho I agree with this, I was thinking, if there are books about kernel internals there may be some about db internals.

but Thanks for your links !

This is a good summary paper on the database internals and major architectural decisions: http://db.cs.berkeley.edu/papers/fntdb07-architecture.pdf
If what you are looking is a general book (not necessarily just for Postgres) I can't recommend the "Use The Index, Luke"[1] tutorial, and the accompanying book "SQL Performance Explained" by Markus Winand, enough.

It doesn't go into a lot of relational theory, but it does provide a somewhat low-level description on how indices and database data are stored, and why you want to use different kind of indices in different scenarios.

[1] http://use-the-index-luke.com

It's useful (probably more useful for most of us than any kind of deep dive into internals, at least for a first read), but I don't remember it going that deep into implementation decisions.