News for hackers. Stuff that matters.
Re:Ask HN: Have you used SQLite as a primary database? by pieterhg on Monday April 25, 2022 @06:49AM (#31152778)
Yes for all my sites: Nomad List, Remote OK, Hoodmaps, Rebase etc. No real issues at all.
Re:Ask HN: Have you used SQLite as a primary database? by WA on Monday April 25, 2022 @07:54AM (#31153243)
I read in one of your Tweets that you use one database file per (unrelated) table to avoid corruption. Why did you move to this model? Are multiple tables per file really more easy to corrupt?
Re:Ask HN: Have you used SQLite as a primary database? by pieterhg on Tuesday April 26, 2022 @03:35PM (#31172129)
Yes! It kinda happened because I had no idea how SQLite worked so I thought this was normal.

Then I thought this is great and makes it easier to move the db file if it just has 1 table. So I can download it easily for local dev for ex.

And yes in case there's corruption which never rly happens, only one file thus table would be affected.

PS: one thing that really helped reduce issues was setting PRAGMA MODE to WAL

Re:Ask HN: Have you used SQLite as a primary database? by barryhennessy on Monday April 25, 2022 @10:00AM (#31154857)
I'd be interested to know what kind of corruption you were facing.
Re:Ask HN: Have you used SQLite as a primary database? by Glench on Monday April 25, 2022 @09:09AM (#31153984)
Here's a Twitter thread with some numbers from pieterhg's use of SQLite in production: https://twitter.com/levelsio/status/1308406118314635266
Re:Ask HN: Have you used SQLite as a primary database? by el_dev_hell on Monday April 25, 2022 @06:55AM (#31152822)
Awesome to hear!

How do you handle this? Do you store the SQLite file somewhere like s3 or just in memory?

How does this work for such high traffic sites?

Re:Ask HN: Have you used SQLite as a primary database? by pieterhg on Tuesday April 26, 2022 @03:35PM (#31172135)
No in the filesystem on a VPS. All my sites just run on a VPS. Nothing fancy!
Re:Ask HN: Have you used SQLite as a primary database? by levelSEOfan on Monday April 25, 2022 @06:56AM (#31152824)
glad to see pieter here, I am keeping an eye on rebase ;)