For Pin Sheet Pro, I’m using SQLite as the database (for now). Being a serverless, file-based, database there are challenges to applications that perform frequet writes. Pin Sheet Pro hasn’t gone live yet. When it does, it will be performing a moderate amount of database writes. In order to avoid any possible collisions I’ve decided to enable WAL, or Write-Ahead Logging,

By default, the journal mode for SQLite is “Rollback”. This is specified by the PRAGMA journal_mode=DELETE; command. This journaling mode locks the database during write operations, which leads to less thn optimal performance.

> sqlite3 db.sqlite3
SQLite version 3.45.1 2024-01-30 16:01:20
Enter ".help" for usage hints.
sqlite> PRAGMA journal_mode;
delete
sqlite>

In order to enable the WAL journal mode, exceute the following command on the database file.

> sqlite3 db.sqlite3
SQLite version 3.45.1 2024-01-30 16:01:20
Enter ".help" for usage hints.
sqlite> PRAGMA journal_mode=WAL;
sqlite>

It’s worth noting that enabling WAL mode is a persistent setting. Once enabled, it will remain enabled until explicitly disabled.

Keeping the architecture of the Pin Sheet Pro application simple is important to me. We don’t currently have any active users (beyond the occasional demo) so we don’t quite know what our needs will be. It’s quite possible that the traffic patterns will remain low, removing the need from any large architectural dependencies.

You don’t have a scaling problem - until you have a scaling problem.