Ayende Rahien has a series of posts on rolling your own database platform (based on a talk in which he says don’t do that): post 1, post 2, post 3, post 4, post 5, post 6, post 7.
It’s a very interesting look at some of the design decisions necessary for a database, even if it doesn’t follow the relational model.