A really simple SQL database.
A good way to understand the system is to start from the lowest level layers and build your way up from there. The layers are listed here in that order:
file
- read pages from disk and write them back to disklog
- read and write log recordsbuffer
- maintain a cache of frequently accessed pagestx.recovery
- provide durability for changestx.concurrency
- implement locking needed to guarantee atomicity for changestx
- tie recovery and concurrency properties togetherrecord
- provide structure on top of raw pages to represent database recordsmetadata
- maintain metadata about structure of different database objectsquery
- queries and query plans expressed in relational algebraparse
- parsing SQL statementsplanner
- translate parsed SQL trees into relational algebrajdbc
- JDBC wrapper on top of everything else
The implementation takes heavy inspiration from Edward Sciore's SimpleDB, augmented by implementations of various exercises in his textbook Database Design and Implementation.