3 ms·
Do you have an example of a problem I'm likely to encounter at the scale I described in my comment?
by anderspitman 5y ago
Do you have an example of a problem I'm likely to encounter at the scale I described in my comment?
- klysm 5y agoIf you are doing IO in a non-atomic manner (seems probable), it’s a matter of time before something happens and a file gets messed up. The frequency of that occurring is certainly a function of scale, but I would argue it’s always a bad idea to deal with your persistent state non-atomically. Additionally, having a schema (even if it’s trivial) protects you from other software problems. It’s much easier to reason about upgrades. And more importantly, if your application complexity suddenly breaches the data complexity threshold where JSON files become a lot more difficult, you already have all the tools you could need at your disposal with SQLite.
- anderspitman 5y ago> If you are doing IO in a non-atomic manner (seems probable) No. I typically use a single mutex for the entire database, and as I said haven't had any performance issues. I'm confident for many classes of software this can scale to at least 100 users (maybe with some slight performance tweaks), which is sufficient for many federated services.
- klysm 5y agoA mutex doesn’t give you atomic or durable IO. I’m referring to proper use of fsync and friends.