I was wondering about how databases like MySQL and SQLite are developed to run as quickly and as well as they do.
I'm looking for answers to questions like:
- How is SQL token-ized? Do you build an AST and compile/interpret like any other language?
- How should one handle connections to the database? TCP? IPC? How do big-name databases do it?
- How is the data is these fast relational databases stored? I know SQLite uses a flat file -- seems like a synchronization nightmare.
Obviously, I don't expect anyone to just explain all of relational database theory to me -- but I've been looking around and I'm really at a loss for references to start learning about this stuff.
To answer the inevitable "why don't you just use MySQL?": (a) because I'm curious and (b) maybe someday I'll want to design my own database with a specific use in mind.
EDIT: I guess I should've made this more clear. I realize this is a broad topic. I am not looking for someone to say "oh, you design a database by..." If this is a topic covered in a large number of books, what are those books? If this is covered well in a P.h.D. thesis you know of, what is that thesis? I am very aware that this is a broad topic -- I'm not asking for a specific answer for a broad question, I'm asking for specific resources for a broad question. As always, thanks for all the help!