Databases

Relational

  • sqlite
  • postgres
  • MySQL
    • innodb storage engine prefetches and caches itself with default 16k record size
      • dzfsprefetchdisable=1, logbias=throughput, primarycache=metadata, atime=off, xattr=sa, recordsize=16k
      • innodblogwriteaheadsize=16384, innodbdoublewrite=0, innodbchecksumalgorithm=none, innodbflushneighbors=0, innodbusenativeaio=0, innodbuseatomicwrites=0
      • increase writes by disabling disk flushing with innodbflushlogattrxcommit=0 and syncbinlog=0. ZFS disable all explicit disk flushing to any one file system by setting sync=disabled so it flushes every ~5sec
    • https://enhancedformysql.github.io/The-Art-of-Problem-Solving-in-Software-Engineering_How-to-Make-MySQL-Better/
    • TiDB
      • somewhat compatible with MySQL
      • TiKV for key value storage
      • distributed db

olap

notes

  • BTree based DB's are more cache friendly as nodes can have more than 2 children (abseil uses 62 children) unlike Binary Trees
    • binary tree's (red-black like C++ STL) are better with larger sized nodes (moving pointers) than smaller (moving values)