Top
Best
New

Posted by ingve 9/11/2025

Rails on SQLite: new ways to cause outages(andre.arko.net)
195 points | 69 commentspage 2
hansmayer 9/12/2025|
Yay! The SQLite posts are back :)
decasia 9/12/2025||
I have a toy web application that accepts a very, very low rate of writes. It's almost all reads.

It is implemented like this:

- The front end uses react to draw a UI.

- It fetches data from a JSON file stored on S3.

- When we get a write request, a lamdba function reads the JSON file, parses it, adds new data, and writes back to S3.

The main selling point for me is that almost all of it is static assets, which are cheap and simple to host, and the tiny bit of "back end" logic is just one nodejs function.

The previous implementation used SQLite and a golang back end, but I eventually got tired of having to maintain a virtual machine to host it.

sergsoares 9/12/2025||
Easy and useful, usually the basic is better.

I ever plan do it with sqlite, loading it at memory during app start and flush data to s3 during runtime but it create more corner cases and logic to handle.

ayende 9/12/2025||
Even with very small number of requests - what happens when you have two concurrent ones?
fiskfiskfisk 9/12/2025||
You can set concurrency limits per function on AWS, so you can apply a hard limit on your function to only have a single invocation running at the same time. That should give you a guarantee that data isn't lost without the producer noticing.
frou_dh 9/12/2025||
I wonder whether that kind of thing is actually bulletproof and doesn't end up having 2 running concurrently in some scenario.
curtisszmania 9/12/2025||
[dead]
SchwKatze 9/11/2025||
Just use Turso
wewewedxfgdf 9/12/2025|
I really don't get the "use sqlite in production" thing.

What about all the important things you need in a database such as multiuser/remote access and other such things?

What do the "sqlite in production" people do when they need to examine the database/resolve an issue/do development? Also what about the limitations of sqlite in modifying database structure?

pythonaut_16 9/12/2025|
Do you actually need all those things?

The simple answer to your question is you don’t. And if you do need them you don’t use SQLite.

procaryote 9/12/2025||
I'd say that for any non-toy service, the default is that you do need those things, and would probably be helped by a database that cares what type you said the column had

Can you even redeploy a sevice like this without downtime?

pythonaut_16 9/14/2025||
Do you need to redeploy your service without downtime? Do you need multi-user and remote access?

Why can't you just use a copy of the database when you need to examine it or resolve issues?

None of these things have anything to do with being a "toy" app or not. They are matters of scale and business requirements. But that's the point isn't it? There are plenty of non-toy systems where none of these requirements apply.

Plenty of very successful business and applications could handle a brief downtime for deployment. Plenty don't need multiple users or remote access, plenty have reasonably small databases.