Simple Database Implementation for Educational Purpose [closed]
Asked Answered
C

3

7

I would like to learn Database systems implementation in Depth. Is there an open-source simple implementation of database for educational purpose that I can go through the code? Like there are a lot of OS implementation (Minix, Pintos...). I am wondering if there are similar systems for database education as well.

I read a few textbooks and they are mainly focus on theory and concepts.

Thanks a lot! Alfred

Chelate answered 20/4, 2012 at 5:55 Comment(0)
G
8

Then find some educational material :) When i was learning db concept, my professor ask us to code a simple dbms. One important reference is the Redbase:

http://infolab.stanford.edu/~widom/cs346/

Hope that helps.

Gyrate answered 20/4, 2012 at 23:25 Comment(0)
M
3

MySQL, PostgreSQL, SQlite are all opensource. You can find their source code and related documentation.
Also check NoSQL group of databases.

Menstrual answered 20/4, 2012 at 6:0 Comment(4)
Thank you! I am awarded of that. However, I think they are too complicated for beginner to read through... I am looking for one with very limited functionality but demonstrates concept.Chelate
SQLite looks good, the structure is clear. I built and looking at the code. Although it is not quite small, but it can be handled.Chelate
@AlfredZhong, SQLite is a file based database. Its currently being used with Android and HTML5 as local storage. It also has an excellent spatial extension SpatialiteMenstrual
I agree re: MySQL, Postgres & SQLite being very complex. I would recommend reading the Redis source code, as it is shorter & simpler. There is some documentation here: redis.io/topics/internals. Also Tom Martin looks a little at Redis' code here: heychinaski.com/blog/2013/10/14/a-look-at-the-redis-source-code. Another option would be LevelDB. Ayende did a great blog series reviewing the LevelDB code: ayende.com/blog/161410/….Teetotaler
U
2

What makes you think implementing a database is simple?

What parts of the database interest you? Storage management? Indexing? Query Language? Query Planning? Transactions?

Modern (even "toy") Relational systems have all of those components, which makes them rather complex from the outset. Other DBs, such dbm based databases are much simpler. Then you have things like Lucene, which is a database for documents and free form text -- conceptually simple but put a lot of effort in to scaling.

You can look at implementations of SPARQL if you're curious about query languages, as they work against RDF triple stores (which aren't super complicated).

There's also things like Prevlayer, which is an in memory database using a concept called prevalence. Probably the simplest of all of them, really when you get down to it.

Uropod answered 20/4, 2012 at 6:5 Comment(1)
Thanks! I never think a database system is simple. I am interested in all but would like to learn them one by one, not all together. If there is a system showing one of the concept, that is what I am looking for. I will look at the systems you mentioned here.Chelate

© 2022 - 2024 — McMap. All rights reserved.