Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What'd be a good open-source database for learning database design? (Designing the DBMS, not normalizing tables/etc)

As stated in the question, I'm not looking for help on database design in the terms of creating tables, normalization, etc.

As a programming project, I'm looking to write my own DBMS. This is for a learning experience more than anything, so reinventing the wheel is kinda the purpose.

I started my search by looking at SQLite - I found my and old SVN branch from 2001~2004, which is amazingly commented, but it's still a lot to digest all at once. But even so, I've been going through it for about an hour or two, and my head is already on hyperdrive with ideas.

So I'm asking here hoping to see if anyone knows of a small and very basic DBMS that I could get some ideas or inspiration from as far as query parsing, storing data, building a search, etc.

Thanks!

like image 817
RichA Avatar asked Feb 16 '11 06:02

RichA


2 Answers

I have been told that the PostgreSQL source code is very well documented and structured.
But it obviously does not qualify as a "small basic DBMS".

Apart from that the only "small" ones that I'm aware of are Java based DBMS:

  • TinySQL
  • SmallSQL

Not sure if a Java based implementation will help you.

like image 95
a_horse_with_no_name Avatar answered Nov 15 '22 00:11

a_horse_with_no_name


There is Edward Sciore's SimpleDB (not related to Amazon's SimpleDB), "A Simple Java-Based Multiuser System for Teaching Database Internals". It's in Java, but I think that the ideas will translate fairly easy to C.

From http://www.cs.bc.edu/~sciore/simpledb/intro.html:

SimpleDB is a multi-user transactional database server written in Java, which interacts with Java client programs via JDBC. The system is intended for pedagogical use only. The code is clean and compact. The APIs are straightforward. The learning curve is relatively small. Everything about it is geared towards improving the experience of a database system internals course. Consequently, the system is intentionally bare-bones. It implements only a small fraction of SQL and JDBC, and does little or no error checking. Although it is a great teaching tool, I can't imagine that anyone would want to use it for anything else.

There is a book too:

Database Design and Implementation

like image 25
Thomas Padron-McCarthy Avatar answered Nov 14 '22 22:11

Thomas Padron-McCarthy