Skip to content

Enable SQLite WAL mode and SYNCHRONOUS=NORMAL #639

@bug-ops

Description

@bug-ops

Parent: #621

Problem

crates/zeph-memory/src/sqlite/mod.rs:38-45 — SQLite defaults to DELETE journal mode. Every write acquires exclusive lock, blocking concurrent readers. Pool size is 5.

Solution

let opts = SqliteConnectOptions::from_str(&url)?
    .create_if_missing(true)
    .foreign_keys(true)
    .journal_mode(sqlx::sqlite::SqliteJournalMode::Wal)
    .synchronous(sqlx::sqlite::SqliteSynchronous::Normal);

Impact: 2-5x write throughput improvement with near-full durability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Critical prioritymemoryPersistence and memoryperformancePerformance optimizationsize/XS

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions