3 ms·
> You can get substantially better performance out of sqlite by using the lower level https://github.com/crawshaw/sqlite https://github.com/crawshaw/sqlite, tur
by SJC_Hacker 3y ago
> You can get substantially better performance out of sqlite by using the lower level https://github.com/crawshaw/sqlite https://github.com/crawshaw/sqlite, turning on WAL etc, using a connection per goroutine for reads, and sending batches of writes over a buffered channel / queue to a dedicated writer thread. That way you can turn off SQLite’s built in per-connection mutex but still be thread safe since each connection is only used on a single thread at a time.
Would this protect against a row update in the middle of a read? e.g. would a row at least be internally consistent at the time it was read?
- lanstin 3y agoYes you would still get SQLite file locking; the thing you aren't using is SQLite thread locking around its own structures (according to GP, I don't know myself). But be sure not to use NFS mount for the files, the locking there is not that great.