Document or reconsider SQLite synchronous=0 in production #20

Closed
opened 2026-02-20 06:52:55 +00:00 by cal · 1 comment
Owner

`app/db_engine.py:36` — `pragmas={"synchronous": 0}` means no fsync on writes. On crash, database could be corrupted. Combined with WAL mode, this may be intentional but should be documented.

Priority: medium

\`app/db_engine.py:36\` — \`pragmas={"synchronous": 0}\` means no fsync on writes. On crash, database could be corrupted. Combined with WAL mode, this may be intentional but should be documented. **Priority**: medium
cal added the
bug
tech-debt
labels 2026-02-20 06:52:55 +00:00
cal added the
ai-working
label 2026-03-04 01:31:18 +00:00
cal added
ai-pr-opened
and removed
ai-working
labels 2026-03-04 01:32:34 +00:00
Author
Owner

PR #49 opened: #49

Added a block comment in app/db_engine.py above the SQLite pragmas explaining:

  • synchronous=0 skips fsync for dev write performance, with data-loss risk on hard crash
  • WAL journal mode partially mitigates the corruption window
  • This setting only applies in local dev; production always uses PostgreSQL
PR #49 opened: https://git.manticorum.com/cal/paper-dynasty-database/pulls/49 Added a block comment in `app/db_engine.py` above the SQLite pragmas explaining: - `synchronous=0` skips fsync for dev write performance, with data-loss risk on hard crash - WAL journal mode partially mitigates the corruption window - This setting only applies in local dev; production always uses PostgreSQL
cal closed this issue 2026-03-10 18:26:25 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-database#20
No description provided.