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/davvblack Sep 10 '24 edited Sep 10 '24

idk it seems fine if the next closest solution is "committing json to your repo" for which there are certainly cases for, on the web. Git is a "database" in some sense, and "webscale" in some sense. There are certainly use cases where you may commit some data into a git repo to be used by a highly scalable application.

Those same usecases would compare favorably to times when sqlite might be the correct tool for the job, for example when the changes are slighlty-more-frequent than sldc, but still 'rare'.

I would be hard-pressed to think of a problem where the solution is "maybe postgres, maybe sqlite" but that's not necessarily it's next-most-similar solution.

"Maybe config files, maybe sqlite" is much closer.

1

u/MaleficentFig7578 Sep 11 '24

I would be hard-pressed to think of a problem where the solution is "maybe postgres, maybe sqlite" but that's not necessarily it's next-most-similar solution.

Any web app that only needs a single server, such as a personal blog.