SQLite

SQLIte is faster than filesystem

PRAGMA journal_mode = WAL;
PRAGMA busy_timeout = 5000;
PRAGMA synchronous = NORMAL;
PRAGMA cache_size = 1000000000;
PRAGMA foreign_keys = true;
PRAGMA temp_store = memory;

PRAGMA journal_mode = WAL; write and reader don’t block

PRAGMA synchronous = NORMAL;

PRAGMA busy_timeout = 5000; avoid SQLITE_BUSY errors to happen

Use IMMEDIATE transactions so sqlite respest the busy_timeout. It can be configure at pool level in GO mydb.db?_txlock=immediate

SQL Index Storage

Checkpoint Starvation

References