Mehdi Akiki

Posts tagged "sqlite"

  • Published on

    Investigation · Part 18 of 20 · What survives a crash

    Checksums: Catching Corruption the Disk Did Not Report

    I flipped one bit in four files. My log's CRC caught it and then threw away nine good records, SQLite returned the changed value and its integrity check said ok, gzip reported a CRC error, and the text file changed silently. Where checksums belong, and what ext4 checks itself.
  • Published on

    Investigation · Part 15 of 20 · What survives a crash

    Durability Settings That Trade Your Data for Speed

    SQLite synchronous, PostgreSQL synchronous_commit, MySQL innodb_flush_log_at_trx_commit, Redis appendfsync: each one decides how much a crash may lose. I put them in one table, with a column for each kind of crash. Only SQLite is measured here; the others are their documentation.
  • Published on

    Investigation · Part 14 of 20 · What survives a crash

    SQLite WAL Mode: Fewer fsyncs, a Different Promise

    In WAL mode, a SQLite commit with synchronous=FULL is one frame and one fdatasync, and with NORMAL it is no sync at all. I followed both with strace on my laptop, measured them, and quote what the documentation promises after an application crash and after a power loss.
  • Published on

    Investigation · Part 13 of 20 · What survives a crash

    How SQLite Commits a Transaction, Followed With strace

    One INSERT in SQLite's default rollback journal mode makes four sync calls on my laptop. I followed every write with strace, compared FULL, EXTRA, NORMAL and OFF, and found the one directory sync that FULL leaves out, as the SQLite documentation says.