Title: I&#x27;ve been messing around with writing a toy database for fun&#x2F;learning, and realised I&#x27;ve got a fairly big gap in my knowledge when it comes to dealing with performance and durability when dealing with file reads&#x2F;writes.<p>Example of some questions I&#x27;d like to be able to answer or at least make reasonable decisions about (<i>note</i>: I don&#x27;t actually want any answers to the above now, they&#x27;re just examples of the sort of thing I&#x27;d like to read in depth about, and build up
some background knowledge):<p><pre><code>  * how to ensure data&#x27;s been safely written (e.g. when to flush, fsync, what
    guarantees that gives, using WAL)
  * blocks sizes to read&#x2F;write for different purposes, tradeoffs, etc.
  * considerations for writing to different media&#x2F;filesystems (e.g. disk, ssd, NFS)
  * when to rely on OS disk cache vs. using own cache
  * when to use&#x2F;not use mmap
  * performance considerations (e.g. multiple small files vs. few larger ones,
    concurrent readers&#x2F;writers, locking, etc.)
  * OS specific considerations
</code></pre>
I recall reading some posts (related to Redis&#x2F;SQLite&#x2F;Postgres) related to this, which made me realise that it&#x27;s a fairly complex topic, but not one I&#x27;ve found a good entry point for.<p>Any pointers to books, documentation, etc. on the above would be much
appreciated.
Upvote: