Ask HN: Have you used SQLite as a primary database?
518 pointsI periodically hear about projects that use/have used sqlite as their sole datastore. The theory seems to be is that you can test out an idea with fewer dependencies (and cost) and that it scales surprisingly far.
There are even distributed versions being built for reliability in the cloud: dqlite by canonical (of Ubuntu fame) and rqlite
Given the complexity it seems like there are use cases or needs here that I'm not seeing and I'd be very interested to know more from those who've tried.
Have you tried this?
Did it go well? Or blow up?
Were there big surprises along the way?
- https://sqlite.org
- https://dqlite.io
- https://github.com/rqlite/rqlite
Comments (325) 124 threads
Show all comments
Showing thread 38 of 124
Although SQLite is not designed for this type of scenario, this discussion higlights there's a strong demand for a concurrent client/server RDMS that is simple, performant and easy to deploy. PostgreSQL is powerful and feature-rich, but not simple or easy to delploy. Hence the appeal of SQLite.
For example, could SQLite power a discussion forum of moderate (or more) activity i.e. users posting comments? The Nim language forum is powered by SQLite, but activity in the forum is fairly low. [1]
Between the simplicity of SQLite and the complex, heavyweight that is PostgreSQL, there is a wide gap between these database opposites. It's a shame there is no concurrent RDMS to fill that gap.
(Note: Another poster mentions the concurrent Firebird RDMS as a possible alternative, but I haven't used it. [2])
[1] https://forum.nim-lang.org/
[2] https://firebirdsql.org/en/features/
Does your forum accept more than 1,000 writes per second? If not, SQLite should be fine.
It's pretty well-known that concurrent writes are SQLites weak point, and that if your application requires high numbers of writes, that it's not the proper solution.
The SQLite devs even acknowledge this:
> SQLite will normally work fine as the database backend to a website. But if the website is write-intensive or is so busy that it requires multiple servers, then consider using an enterprise-class client/server database engine instead of SQLite.
> [...] client/server database systems, because they have a long-running server process at hand to coordinate access, can usually handle far more write concurrency than SQLite ever will.
(https://www.sqlite.org/whentouse.html)
Just because Postgres has all the features and knobs doesn't mean you have to use them or turn them. You can always use it like SQLite but just one or two things more that you need.