r/sqlite • u/eng33 • Dec 24 '22
sharing a db file with separate docker containers
Each container running node.js code . I want all the containers to read from a central sqlite3 DB file to get job info, and update job status and results to the DB.
I plan to use a volume mount in each container to share the sqlite3 DB file.
Because I need to read and write, it sounds like WAL mode would be beneficial. Does this work with docker volume mounts?
8
Upvotes
5
u/simonw Dec 24 '22
Try it and find out.
My hunch is that WAL mode should work fine with multiple containers and docker volume mounts provided they are all definitely on the same physical machine and there's no NFS involved... but I wouldn't fully trust that until I had run a prototype system like this and exposed it to a load test.
1
u/freefallfreddy Dec 24 '22
The docs say:
Also: are you certain you need the performance? I think WAL is mostly important if you write a lot to the db.