News for hackers. Stuff that matters.
Re:Ask HN: Do you self-host your database? by Jnr on Tuesday June 29, 2021 @07:40AM (#27674451)
I used it 10 years ago and initially locks were a slight problem. Not sure if this has been solved somehow in sqlite itself.

I solved the problem by handling all the DB operations in a separate thread that handled write and read queues. It certainly was not as easy as using mysql/postgresql where server does everything for you. Nowadays there are probably plenty of libraries that handle that for you.

Re:Ask HN: Do you self-host your database? by benbjohnson on Tuesday June 29, 2021 @09:40AM (#27675612)
WAL mode has been added in the last 10 years which handles read concurrency really well IMHO. You’re still constrained to a single writer but that’s not usually a problem as long as you keep your write transactions short.
Re:Ask HN: Do you self-host your database? by Moto7451 on Tuesday June 29, 2021 @09:13AM (#27675307)
This pattern is what I did when I used SQLite in production. I used a lightweight actor model microframework to make it easier to route write requests from multiple areas of the code to the single writer thread and offer a continuation (or async/await) perform any follow up actions. Performance easily went beyond the requirements for the app.
Re:Ask HN: Do you self-host your database? by zo1 on Tuesday June 29, 2021 @12:15PM (#27678003)
I'm not sure how to express my reaction to this kind of design/architecture without being rude. Especially with performant open source databases being available. Was this some sort embedded app or toy project?