views:

781

answers:

9

So lets say that you want to learn some stuff about database internals. What's the best source code to look at? the best books to buy?

I was talking about this with a buddy the other day and he recommended:
Art of Computer Programming, Volume 3: Sorting and Searching

What other books would help me learn about all the File IO and memory issues, pages, locking, etc.... ?

+3  A: 

The SQLite source is very approachable to learn about database implementations.

PostgreSQL is a very well written piece of software, with higher complexity than SQLite.

Yann Ramin
I guess I was looking for the right client/server database to look at. Since SQLite is embedded or bound to usually by a single client I'm not sure there is much to learn here about sessions, users, and conflicting requests/locking.
tyndall
I wonder if Postgres is too complicated a place for me to start.
tyndall
+2  A: 

A colleague and I got a great deal of information out of Database in Depth: Relational Theory for Practitioners Very low level stuff but it sounds like that is the sort of thing you are looking for.

Trey
It is a great book, but hardly at the file I/O level.
Jonathan Leffler
+1  A: 

Here's an interesting read about SQLOS, which drives Microsoft SQL Server 2005+.

unforgiven3
+1  A: 

Make sure that whatever you get covers relational algebra and relational calculus. No point delving into database internals if you don't have the basic theoretical background. Past that, any college style databases textbook will probably suffice.

Promit
+4  A: 

If you are really serious, and although a tough read none other by the late and great Jim Gray and Reuter:

Transaction Processing, Concepts and Techniques

Again if serious, do not bother with anything else.. it's out of this world and certainly out of mySQL chasing by IBM or Oracle..

rama-jka toti
oh that does look good. +1
tyndall
+5  A: 

Textbook: Database Management Systems by Ramakrishnan and Gehrke.

Or: Architecture of a Database System by Hellerstein, Stonebraker, and Hamilton.

Production Code: PostgreSQL

(I like the PG code better than SQLite , it's far more complete and, I think, better organized. SQLite is awesome for what it does, but there is a lot it doesn't take on).

Extra Credit: Readings in Database Systems, 4th edition edited by Hellerstein.

SquareCog
In terms of documented code, BerkleyDB has it best of all of them if you ask me..
rama-jka toti
That may be true but it's not a relational database in the sense I think the original poster meant it.
SquareCog
Does not necessarily have to be traditional relation database. If there are still some basic concepts I could grok from it. +1
tyndall
+1  A: 

In depth information about internals is database specific, here's a source on SQL Server 2008: http://www.amazon.com/Microsoft%C2%AE-SQL-Server%C2%AE-2008-Internals/dp/0735626243

HLGEM
+1  A: 

Not everybody likes his style, but I find that Joe Celko does a fine job of explaining the set-based logic that drives SQL databases. If you already have a little SQL experience under your belt, you should read SQL for Smarties.

Vincent Buck
That's an interesting book, but it doesn't address the file i/o and memory management issues the question asks about.
Jonathan Leffler
+1  A: 

Take a look at Database Systems: The Complete Book by by Hector Garcia-Molina, Jeffrey D. Ullman, Jennifer D. Widom. It is specifically about the internals of the DBMS.

The answer by SquareCog also contains sensible suggestions; I've not looked at the two books mentioned (though the Stonebreaker "Architecture" book is only 136 pages according to Amazon, which seems a tad lightweight).

Jonathan Leffler
SquareCog
Jonathan Leffler