{
  "slug": "rollback-journal",
  "term": "Rollback journal",
  "aliases": [
    "SQLite rollback journal",
    "Rollback-mode journal"
  ],
  "definition": "A rollback journal is an undo log that preserves original database content so an incomplete transaction can be reversed.",
  "note": "SQLite records original page content and the database's starting size before overwriting stored pages. Recovery restores those pages and, when necessary, the original file length. [sqlite-atomiccommit] This differs from SQLite WAL mode, which appends changed pages and a commit record to a separate log. [sqlite-wal] Keeping a journal in memory does not provide crash recovery, and disabling journaling removes rollback protection. [sqlite-tempfiles] Journal presence alone does not identify an incomplete transaction; SQLite checks whether the journal is hot. [sqlite-locking] See the comparison of recovery boundaries. [hesela-wal] A disposable process-exit observation demonstrates journal retention after commit and rollback of unfinished writes; it is not a power-loss test. [hesela-journal-observation]",
  "status": "shipping",
  "advantages": [
    {
      "text": "Preserves before-images needed to undo changes from an interrupted transaction.",
      "citationIds": [
        "sqlite-atomiccommit"
      ]
    }
  ],
  "limitations": [
    {
      "text": "Recovery depends on the journal remaining available and on working filesystem locks and synchronization.",
      "citationIds": [
        "sqlite-locking"
      ]
    },
    {
      "text": "Rollback-mode synchronous=FULL does not guarantee power-loss durability on every filesystem; EXTRA adds protection for DELETE-mode commits.",
      "citationIds": [
        "sqlite-synchronous"
      ]
    }
  ],
  "related": [
    "hot-journal",
    "sqlite-super-journal",
    "write-ahead-log",
    "database-checkpoint",
    "crash-consistency",
    "fsync",
    "persistence-ordering"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "sqlite-atomiccommit",
      "title": "SQLite: Atomic Commit In SQLite",
      "url": "https://sqlite.org/atomiccommit.html",
      "accessed": "2026-10-14"
    },
    {
      "id": "sqlite-locking",
      "title": "SQLite: File Locking And Concurrency In SQLite Version 3",
      "url": "https://sqlite.org/lockingv3.html",
      "accessed": "2026-10-14"
    },
    {
      "id": "sqlite-tempfiles",
      "title": "SQLite: Temporary Files Used By SQLite",
      "url": "https://sqlite.org/tempfiles.html",
      "accessed": "2026-10-14"
    },
    {
      "id": "sqlite-wal",
      "title": "SQLite: Write-Ahead Logging",
      "url": "https://sqlite.org/wal.html",
      "accessed": "2026-10-14"
    },
    {
      "id": "sqlite-synchronous",
      "title": "SQLite: PRAGMA synchronous",
      "url": "https://sqlite.org/pragma.html#pragma_synchronous",
      "accessed": "2026-10-14"
    },
    {
      "id": "hesela-wal",
      "title": "Hesela: WAL, checkpoints and torn pages, SQLite commit scope",
      "url": "https://hesela.com/analyses/wal-checkpoints-torn-pages/#sqlite-commit-scope",
      "accessed": "2026-10-14"
    },
    {
      "id": "hesela-journal-observation",
      "title": "Hesela: SQLite journal-lifecycle observations, measured synthetic workload and explicit limits",
      "url": "https://hesela.dev/research/sqlite-journal-observation.json",
      "accessed": "2026-10-14"
    }
  ],
  "updated": "2026-10-14"
}
