Live data from Hacker News

Ask HN: Have you used SQLite as a primary database?

news.ycombinator.com

91–100 of 330 posts

Re: Ask HN: Have you used SQLite as a primary database?

#92

Side question: what’s something as simple as SQLite, but more of an unstructured key-value store? I’ve been using (locally) a Redis container for a very early prototype because it seems to be simple enough to use. I know you can query json strings in salute but that’s not quite the same thing. For one redis offers some geo features.

Have you looked at RocksDB? http://rocksdb.org/

Re: Ask HN: Have you used SQLite as a primary database?

#93
post #32

Here's an all-time great post about why you might consider SQLite in production with data about performance: https://blog.wesleyac.com/posts/consider-sqlite I use SQLite in production for my SaaS[1]. It's really great — saves me money, required basically no setup/configuration/management, and has had no scaling issues whatsoever with a few million hits a month. SQLite is really blazing fast for typical SaaS workloads…

Litestream is indeed a missing piece of the puzzle. But it also defeats some of the purpose of using an embedded database library in the first place. Now you're back to juggling separate processes once again.

Good point! Although practically speaking I don't mind at all. "Juggling" is too strong a word — it's literally just starting the Litestream process and never thinking about it again. It's nice that it just slides into my existing app without any code changes.

Re: Ask HN: Have you used SQLite as a primary database?

#94

It depends on the application you are developing. If you are doing microservices, separate the database from the application is a must.

Some microservices will need persistent local data that is only used by the microservice and sqlite can be a good fit.

Re: Ask HN: Have you used SQLite as a primary database?

#95

The sqlite docs page has a nice article [1] on when to use an embedded database such as sqlite and when to go with a client/server model (postgres, mysql or others) When not to use sqlite: - Is the data separated from the application by a network? - Many concurrent writers? - Data size > 280 TB For device-local storage with low writer concurrency and less than a terabyte of content, SQLite is almost always better. [1…

> For device-local storage with low writer concurrency and less than a terabyte of content, SQLite is almost always better. Isn't MySQL MyISAM faster and this way constitute a better choice for a scientific number crunching application? I mean near 4GB DB, very simple schema, heavy reading load, little/no inserts and no updates.

MyIsam is not crashsafe. Anytime your server crashes the MyIsam database may get corrupted.

Faster, but at what price?

Re: Ask HN: Have you used SQLite as a primary database?

#96
post #42

Question for people using SQLite in prod: how do you cope if your app is running on a platform like Heroku or Cloud Run, rather than a proper server or VM? Have you found a solution for the fact that those environments, and disk, is ephemeral?

You could use Render or a similar service that offers persistent storage. I imagine Heroku has a similar feature. [0] https://render-web.onrender.com/docs/disks

Fly as well: https://fly.io/docs/reference/volumes/

Re: Ask HN: Have you used SQLite as a primary database?

#97
Currently using SQLite3 as the backend db of www.rtljobs.com.

I love it - very robust, lots of documentation, StackOverflow answers, example queries, etc.

On a typical day, I get less than 50 users per day globally, so I don't really have to worry much about concurrency or other issues that SQLite struggles with. I'd wager that many web applications are perfectly well served by it.

Post reply on HN