matrix-org / sydent

Sydent: Reference Matrix Identity Server
http://matrix.org
Apache License 2.0
303 stars 84 forks source link

Consider using SQLite's write-ahead log (WAL) mode instead of the rollback journal mode #472

Open reivilibre opened 3 years ago

reivilibre commented 3 years ago

Not too much to say, but it seems like it would be 'better'. I'm under the impression that the only reason it's not the default is for backwards compatibility (because with the WAL mode, you must treat the -wal and maybe -shm files as part of the database; it's not a single-file database anymore) and there are a few drawbacks, but they don't seem to affect us.

It seems to have better concurrency (writers don't hold up readers, readers don't hold up writers) and allegedly better performance according to a bullet point on their docs site (I need to read more of it, I'm sure there's an elaboration).

Might help us out with the casefolding script?

richvdh commented 3 years ago

related: https://github.com/matrix-org/synapse/issues/2917#issuecomment-877146280

jdauphant commented 2 years ago

Apparently, there is nothing to change in the application to test it :

The persistence of WAL mode means that applications can be converted to using SQLite in WAL mode without making any changes to the application itself. One has merely to run "PRAGMA journal_mode=WAL;" on the database file(s) using the command-line shell or other utility, then restart the application. https://sqlite.org/wal.html

Do you know somebody that use Sydent with SQLite with WAL journaling ? Do you see any side effect that could append ?