-
Notifications
You must be signed in to change notification settings - Fork 296
Description
Litestream recommends running as a sidecar in Docker, which means exposing the same DB to multiple containers. But is this really supported? I previously researched such a setup, and arrived at the sqlite forum... key quotes:
Question:
I think VM/docker volumes do not work with WAL mode for the same reasons as WAL mode not working on network disks (guess: two OS's do not know about each others locks).
Part of the answer
Docker is like a dory (a wee little row boat) that has a hole in the bottom. It matters not whether you put your dory on the Ocean or a Lake, or even in the toilet. Water will still perculate up through the holes and drown you.
Did I allow myself to get too scared by those quotes? What are the implications for litestream?
I arrived here not as a (current) litestream user but as someone who has a strong interest in running a similar setup. I apologize if opening an issue for this was not the way to go forward, I'm happy to take the discussion to a different location if that's more appropriate.
Activity
rishi-kulkarni commentedon Feb 12, 2025
You can read this thread and the associated links, which convinced me that it's actually completely fine to have multiple containers looking at the same SQLite database across container boundaries via Docker volumes: https://sqlite.org/forum/forumpost/a0edfa3613
Personally, I've had services running for several years in production using this pattern (single host, 1+ application containers, 1 litestream container, all looking at the same Docker volume) and have failed to experience any issues.
vanschelven commentedon Feb 12, 2025
That's an excellent thread, I can't believe I didn't find it on the forum myself -- thanks for pointing it out! And thanks for sharing your experiences also
I'll take your remarks and those of Harvey the WAL-Banger back home to Bugsink.
As to the present issue: I'm happy to either leave it open or close it, or even turn it into a doc-PR that puts rishi's and Harvey's remarks into some document for easier discovery.