News for hackers. Stuff that matters.
Re:Back to basics: Writing an application using Go and Postg... by Thaxll on Monday November 22, 2021 @07:40PM (#29313348)
How do you do when you have more that one process accessing the DB?
Re:Back to basics: Writing an application using Go and Postg... by simonw on Monday November 22, 2021 @08:38PM (#29313696)
SQLite has a WAL mode you can switch on which handles that scenario: https://til.simonwillison.net/sqlite/enabling-wal-mode
Re:Back to basics: Writing an application using Go and Postg... by exhilaration on Monday November 22, 2021 @11:13PM (#29314529)
I was curious what WAL mode was and this Sqlite page explains it: https://www.sqlite.org/wal.html
Re:Back to basics: Writing an application using Go and Postg... by rakoo on Tuesday November 23, 2021 @11:14AM (#29319548)
Digression: 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 ?