5 ms·
Do you have a write-heavy workload? How do you handle contention? Do you have multiple servers? How do you handle real-time filesystem sync? If you only have o
by jimktrains2 9y ago
Do you have a write-heavy workload? How do you handle contention?
Do you have multiple servers? How do you handle real-time filesystem sync? If you only have one server, how do you handle its inevitable failure?
Do you loose any data collected between last backup and failure?
(I'm not saying SQLite isn't good, because it's f-ing amazing. I'm just not sold on it as a multi-process, multi-user database.)
(If you have a filesystem capable of atomic snapshots, then you can simply snapshot any database and treat the backup as a single file.)
- Boulth 9y ago> Do you have a write-heavy workload? How do you handle contention? I'd also be interested in that. Last time I wanted to use Sqlite opening twice the same file for writing either would not succeed or could time out.
- jacquesm 9y agoThat's because SQLite is meant for single user applications. If you try to open the file the second time it will wait to acquire the lock.
- WA 9y agoSingle process applications if I’m not mistaken. And somewhere in the docs it says: most writes take a few milliseconds at most, so even in a multi-process environment (say 5-10 PHP processes), it should be fine. Haven’t tried this though.
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- Sohcahtoa82 9y ago> I'm just not sold on it as a multi-process, multi-user database. That's fine. It was never designed to be a multi-process, multi-user database. Even the authors don't pretend it works in that use case: https://www.sqlite.org/whentouse.html https://www.sqlite.org/whentouse.html
- jimktrains2 9y agoBut that's my point. People using sqlite as the store for a web application seems like the wrong tool for the job.
- petre 9y agoWhy, if you just read from it? It's single writer multiple reader.
- jimktrains2 9y agoBecause a single writer limits throughput significantly. For a small hobby website or a blog that may not be an issue.