Building a local-first application for a single user sounds simple enough. No distributed infrastructure, no thousands of concurrent users, no complicated database servers.
Yet even an ordinary editorial workflow can reveal an unexpected concurrency problem.
While developing LORQAI Studio 3, a creative content management application built with Go, SQLite, React, and TypeScript, we encountered an intermittent error:
database is locked
It appeared when saving an article after generating a website preview.
That small error led us to reconsider not only database concurrency, but also how we create and verify backups.
Reproducing the Problem
The application generates previews from existing content while allowing users to continue editing.
We suspected that an active read transaction might overlap with a subsequent save operation.
Instead of relying on additional retries, we isolated the suspected mechanism in a disposable test database.
The test followed a simple sequence:
Create an article…