22

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.... ?

Yann Ramin
  • 32,895
  • 3
  • 59
  • 82
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466

9 Answers9

16

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
  • 19,421
  • 8
  • 49
  • 63
8

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
  • 1,404
  • 10
  • 16
5

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
  • 32,895
  • 3
  • 59
  • 82
  • 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. – BuddyJoe Apr 21 '09 at 03:27
  • I wonder if Postgres is too complicated a place for me to start. – BuddyJoe Apr 21 '09 at 03:34
2

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
  • 11,032
  • 1
  • 23
  • 21
2

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
  • 730,956
  • 141
  • 904
  • 1,278
  • The Stanford book covers many topics, but I found it to be very superficial on most of them.. It gives you all the pointers, but doesn't really go into details. That's why I prefer Ramakrishnan & Gehrke. It's not a bad text, though. YMMV. – SquareCog Apr 20 '09 at 23:12
  • OK - I've not seen R&G so I can't comment on it. I have the older book from Ullman et al (Database System Internals) which is several levels more detailed at the file i/o levels than some of the other recommendations. I've not compared D.S.I with DS:TCB either (nor have I looked at it for a few years now), so it could be that I have the wrong impression. – Jonathan Leffler Apr 21 '09 at 00:43
1

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

Rob
  • 25,984
  • 32
  • 109
  • 155
1

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
  • 94,695
  • 15
  • 113
  • 186
1

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
  • 16,462
  • 2
  • 21
  • 21
0

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
  • 3,497
  • 1
  • 20
  • 29