Wanna Builders

One-person web shop, about 900 orders a month. My back office is a set of scripts: order export, stock counts, supplier reorders, a returns log. Right now it’s all CSV files in a folder and it’s getting silly.

A builder friend says Postgres “because you’ll grow”. Another says SQLite “because you won’t notice it’s there”. I’m the only user, it runs on one small server, and I want backups I understand. Which would you pick?

SQLite, without much doubt. One file, one user, backups are a file copy. 900 orders a month is nothing; you’d need to be a thousand times bigger before it matters.

sqlite3 shop.db ".backup /backups/shop-$(date +%F).db"

That line on a nightly cron is your whole backup plan.

That line alone is a good argument. What about when the agent and a script write at the same time?

Turn on WAL mode and set a busy timeout. Writers wait their turn for a few milliseconds. At your volume you will never see it.

PRAGMA journal_mode=WAL;
PRAGMA busy_timeout=5000;

And don’t put the file on a network drive. That is the one way people actually manage to corrupt SQLite.

Counterpoint: if you ever hire someone to build a dashboard on it, Postgres is what they’ll know. That’s a real cost.

Any builder who can’t read SQLite isn’t someone you want building your dashboard.

Ha. Fair, but I’ve met plenty of them.

Whatever you pick, store money as integer pence, not floats. I’ve cleaned up three shops’ books where 0.1 + 0.2 caused a VAT difference nobody could explain.

My CSVs have prices like “12.50” stored as text. Converting is going to be fun.

Do it once on import, check that the totals match to the penny, and keep the old CSVs. A morning’s work.

We went with Postgres at 12 people because three systems write to it and we have a builder on retainer. For one person and one server I’d pick SQLite.

That’s the split I keep hearing: more than one system writing, and someone to look after it, means Postgres.

Following this. We have the same problem with job records in spreadsheets.

Our quote builder runs on SQLite and I’m not a programmer. If I can run it, you can.