4 ms·
> there are many interesting use cases for server side but they all seem to be toyish. > The locking behavior of SQLite is somewhat problematic unless you use
by bob1029 3y ago
> there are many interesting use cases for server side but they all seem to be toyish.
> The locking behavior of SQLite is somewhat problematic unless you use WAL and even then not perfect
SQLite with WAL and synchronous configured appropriately will insert a row in ~50uS on NVMe hardware. This is completely serialized throughput (i.e. the highest isolation level available in SQL Server, et. al.). At scale, this can be reasonably described as "inserting a billion rows per day".
I have yet to witness a database engine with latency that can touch SQLite. For some applications, this is a go/no-go difference. Why eschew the majesty of SQL because you can't wait for a network hop? Bring that engine in process to help solve your tricky data problems. I'd much rather write SQL than LINQ if I have to join more than 2 tables.
We've been exclusively using SQLite in production for a long time. Big, multi-user databases. Looking at migrating to SQL Server Hyperscale, but not because SQLite is slow or causing any technical troubles. We want to consolidate our installs into one physical place so we can keep a better eye on them as we grow.
Fun fact: SQL Server "Hyperscale" is capped at 100MB/s on its transaction log. I have written to SQLite databases at rates far exceeding this.
- endisneigh 3y agoIs your application a networked one?
- bob1029 3y agoIt is a web app that has exclusive ownership over its SQLite databases. Exactly one SQLiteConnection instance per for the lifetime of the application.
- endisneigh 3y agoInteresting. Any more info or link?
- belinder 3y agoDoes that mean you have to bring the whole app down if you need to manually insert something in sql?
- yjftsjthsd-h 3y agoI am not an expert, but if I had written an app that was designed like that, the app would have a /debug url that let me log in[0] and then do all kinds of fun things[1], including running raw SQL from the app's context. [0] And I would be very careful about the security angle, because this is effectively a very dangerous back door into the whole system. Useful, but something to be careful about. [1] Dump live activity stats, performance info, ability to run arbitrary queries against any database(s), ability to run arbitrary code in the app itself if available in a reasonable way (ex. if the app is in a dynamic language, just an eval(), possibly embed tcl/lua if not).
- krab 3y agoMore SQLite processes can open the same file at a same time.