Both of them, really. There's a lot to know if you want to build a modern database system. But no work I am aware of addresses the specific question of how to build a database system from scratch.
A reasonable approach might be to start with this high-level paper, and follow papers they reference until they get specific enough to address your specific questions:
Joseph M. Hellerstein, Michael Stonebraker, James Hamilton.
Architecture of a Database System. Foundations and Trends in Databases, 1, 2 (2007).
For the sort of low-level issues that you are interested in, it might be useful to study a well-regarded persistence package, such as Berkeley DB.
A reasonable approach might be to start with this high-level paper, and follow papers they reference until they get specific enough to address your specific questions:
For the sort of low-level issues that you are interested in, it might be useful to study a well-regarded persistence package, such as Berkeley DB.https://en.wikipedia.org/wiki/Berkeley_DB
Another system that might be worth studying is SQLite.
https://www.sqlite.org/index.html