3 ms·
On interesting I like SQLite; i never thought to use it for web projects though. Any tips or advice on trying to use SQLite for web dev? What platforms do you
by absoluteunit1 3y ago
On interesting I like SQLite; i never thought to use it for web projects though.
Any tips or advice on trying to use SQLite for web dev? What platforms do you use for deploying web apps with SQLite ?
- andrewfromx 3y agoCorrect me if I’m wrong but sqlite has no support for concurrent users right? You would have to have a mutex or queue system in production to make sure only one thing at a time tries to run sql?
- tlavoie 3y agoYou have plenty of options actually, including a safe default: https://www.sqlite.org/threadsafe.html https://www.sqlite.org/threadsafe.html
- adamckay 3y agoAssuming you're talking about users of your web app, rather than database users. Using the WAL mode [1] you can have truly concurrent reads alongside writes. You can't do truly concurrent writes, however, but the database driver you use (may) automatically retry writes that fail due to locks automatically. The Python driver [2] does with the `timeout` configuration parameter for 5 seconds by default. As your writes should be very quick, so long as you don't hold transactions open or attempt to do lots of work in a transaction, you may find that it's perfectly performant for your use case / usage loads. 1 - https://www.sqlite.org/wal.html https://www.sqlite.org/wal.html 2 - https://docs.python.org/3.11/library/sqlite3.html#sqlite3.connect https://docs.python.org/3.11/library/sqlite3.html#sqlite3.co...