I'm looking at implementing an RDBMS. Are there any good resources out there about how a database works internally, and the kinds of things I'd need to know when starting out to build my own? (Please no comments about whether it's a practical idea or not - just imagine it's for a hobby project or something).
Again - interested in the RDBMS design, not the Database design. And efficiency is very important (it seems like it's reasonably easy to design some kind of relational database like structure if I don't care about speed).
There are a few textbooks about this sort of stuff out there, when I was in college, we did this for a class project. This book should really help you on your way Database Systems: The Complete Book
I forgot to mention it, but my code is on googlecode here: cs4420-dbase
Please forgive the fact it is written in java, but I was outvoted by my teammates on that decision. but the basic ideas are all still there. It handles file creation and handling as well as a simple SQL parser and optimizer. It handles basic indexing (b-tree) and "memory" management. Please forgive some of the lack of commenting and strange commenting, many late nights were spent on that project.
I'd suggest starting with Introduction to Database Systems and Transactional Information Systems. They should both have bibliographies to take you further.
Building a RDMS is not trival, you need to combine classic CS knowledge from several fields together with deep knowledge about harddrives, OS specifics, filesystems, memory, cpu, caches to make it efficient.
A good article about architecture we are required to read is:
http://www.nowpublishers.com/product.aspx?product=DBS&doi=1900000002
For theoretical knowledge about databases I would recommend to buy a book on this topic, I can only talk about the book I use for this, which is Database Systems an Application-Oriented Approach by Kifer, Bernstein and Lewis.
You might want to look at some opensource databases for ideas.
I recently came to the same question, and like others, struggled a bit finding a book that helped in building an actual RDBMS from scratch (minimal, of course). Contrary to what occurs in other CS areas (OS, Compilers, etc); the Databases area seems to have fewer resources in this regard. Probably because RDBMS are among the hardest to grasp and implement ;-|
Nevertheless, I finally found what appears to be a satisfying answer. Sciore's book "Database Design and Implementation":
http://www.wiley.com/WileyCDA/WileyTitle/productCd-EHEP000711.html
The first two parts are dedicated to learning to use RDBMS, which you probably know already. But the last two parts cover implementation details; and the interesting thing is that a minimal RDBMS (SimpleDB) is used to illustrate the concepts, and also can serve as the platform to perform programming exercises. The Wiley site has a quote that says it better:
"Comes with SimpleDB, a free-to-download, fully functional simplified database system that is (unlike commercial DB systems) small, easily readable and easily modified. SimpleDB can be used as the platform on which students complete homework projects and implement the concepts covered in the book."
Do not bother by the fact the sample RDBMS is written in Java; that has the advantage (IMHO) of hiding the low-level details of implementing in C/Unix. If you come like me from the applications world, you may be unfamiliar with system-programming stuff; but learning the RDBMS implementation concepts in a high level language like Java, can serve as a good bridge for the transition.
The Wiley site allows to buy an electronic version of the book, but the source code is available regardless you buy it. I can not post more than two links, but just google this term (including double quotes), and you will easily find the SimpleDB home page (where you can download it):
"The SimpleDB Database System"
If you are unsure about buying the book (which like other core-CS books, are not cheap for the student); probably you can start reading the code and this introductory article:
http://www.cs.bc.edu/~sciore/papers/SIGCSE07.pdf
If you find it appealing, buying the book may be a good investment.
Hope that helps, Cheers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With