r/programming • • Sep 10 '24

SQLite is not a toy database

https://antonz.org/sqlite-is-not-a-toy-database/
811 Upvotes

309 comments sorted by

View all comments

-110

u/OffbeatDrizzle Sep 10 '24 edited Sep 10 '24

SQLite is a perfect fit for small websites and applications

So it's a toy...

There is a popular opinion among developers that SQLite is not suitable for the web, because it doesn't support concurrent access. This is a myth. In the write-ahead log mode (available since long ago), there can be as many concurrent readers as you want. There can be only one concurrent writer

So it's a toy...

edit: lots of toy fanboys here

3

u/ub3rh4x0rz Sep 10 '24

Having only one concurrent writer solidifies that it is not the right choice for web. I try to tell juniors who try to XY problem into getting it to work in a web context to just use postgres, and they're like "well that's just too complicated". No, too complicated is trying to manage locking of a pool of size 1 without severely throttling traffic yourself, especially as an inexperienced dev lol.

I do love sqlite for offline analytics of relatively small datasets, where concurrent writing isn't needed

-2

u/OffbeatDrizzle Sep 10 '24

Are you agreeing with me? Nobody else does :(

19

u/bawng Sep 10 '24

You might be right that it's the wrong tool for the web but that doesn't make it a toy. Unless everything that isn't web is toys.

→ More replies (1)