1. 3
  1.  

  2. 1

    Database Internals is a really good book, and goes into much more detail. (Though you‘ll still have lots to learn, or figure out on your own, if you try building your own.)