1. Understanding Mysql Internals
Currently I have no idea how a DBMS and its internal structure works. The best DBMS I heard of is mysql, so I decided to learn more about mysql internal components and how its data engine works.
For now I will only explore parts enough to complete my assignments but I would definitely would like to go deeper in this topics and keep evolving notes about internal working of DBMS.
NOTE: Target is not to imitate the architecture of mysql, but to create my own architecture, I want to learn about internal working just to know components of a DBMS. Also it sounds super cool and I love finding out how things work under the hood.
Okay... I tried to understand a little bit about mysql internal structure and it turns out I can't understand anything ๐. I tried reading its manual and other articles; mysql is too big and too complicated to understand in such a small amount of time. I've decided to understand something smaller like sqlite.
Sqlite has follow overview:
You can read more about all these components from here: https://www.sqlite.org/arch.html
The main components and ideas which i can pick from here to develop a minimal DBMS for assignment is Tokenizer, parser. - for me these sounds like part of compiler. Lets read more about parsers and tokenizer from compilers concepts, this will help to me build a good minimal query compiler for the assignment.
Conclusion:
The project structure which I am currently thinking is:
- compiler: All classes and code for taking the query from input and getting the data from the file
- tokenizer
- parser
- code generator (lets see if we will need this)
- core: all the core code of the project for file manipulation, storing data in files, delimiter handling etc.
- frontend: all code for taking the input from user and returning the result back.
- Accessories: all general reusable classes and interfaces which doesnt belong on other categories
Resources:
- Nice articles on databases: (includes lot of writing from scratch) https://notes.eatonphil.com/tags/databases.html
- Build an sqlite clone from scratch: https://cstack.github.io/db_tutorial/
- https://www.amazon.com/_/dp/1492040347
- Amazing course and notes by stanford uni - https://web.stanford.edu/class/cs346/2015/
0. Desing your own DBMS - Intro Data warehousing and Data management