The goal for Yehang was simple: let someone run an RSS reader on the cheapest server they can find, with one command. No Redis, no Postgres, no message queue. So from day one I chose SQLite.
A few settings you should always turn on
SQLite’s defaults aren’t made for web services. These lines are close to mandatory:
PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA busy_timeout = 5000;
PRAGMA foreign_keys = ON;
WAL mode lets readers and writers stay out of each other’s way. That is what lets Yehang fetch feeds in the background while you read in the foreground.
Backups are easy
People worry that a single file is unsafe. Yehang runs a scheduled job that uses VACUUM INTO to write a consistent backup every day and keeps the last seven. Restoring means copying a file back. Compared with running a database server, there is far less that can go wrong.
Where it stops
I drew a line for myself: one user, or a small group of a few dozen, with low write concurrency. If someone ever needs to scale out across instances, Yehang will have become a different product, and I can switch then.
It has run in under 40MB of memory for a year without a single data problem. For a side project, that’s enough.