SQLite Forum

Changes to support concurrent writes to wal database distributed over network FS
Login
I think WAL 2 mode is needed (https://www.sqlite.org/cgi/src/doc/wal2/doc/wal2.md), each node uses two logs and alternates between them. Every node should switch to the alt log before the merger node starts working, merging each write in chronological order.

For relaxed consistency this requires synced clocks and timestamps for each commit. If two nodes wrote to a row at the exact same time you would have to just pick one. This method is most performant and probably ok for many applications.

For more exact consistency you will need a shared counter, replace timestamps with a counter, get and increment by one for each write.
Preventing any conflict from happening would be expensive because it requires locks or exclusive access.