3 ms·
How do you do when you have more that one process accessing the DB?
by Thaxll 5y ago
How do you do when you have more that one process accessing the DB?
- simonw 5y agoSQLite has a WAL mode you can switch on which handles that scenario: https://til.simonwillison.net/sqlite/enabling-wal-mode https://til.simonwillison.net/sqlite/enabling-wal-mode
- exhilaration 5y agoI was curious what WAL mode was and this Sqlite page explains it: https://www.sqlite.org/wal.html https://www.sqlite.org/wal.html
- rakoo 5y agoDigression: what's your usecase for having multiple processes share the same database ? SQLite is not an equivalent to a standard networked database, as a developer you're supposed to see it as an enhanced data structure, like an array++. You wouldn't share an array between multiple processes (unless you know exactly what you're doing) so you wouldn't do the same for SQLite. If you really need multiple processes writing the same kind of data, maybe it should be partitioned into multiple independent files ?