SQLite Forum

Can I detect if the disk supports WAL mode?
Login
> I guess mmapped files only work on the same OS.

The whole point of [`mmap(2)`][1] is to map a file into the unified virtual memory space of the machine. QEMU provides a private virtual memory space for its VM, so there is no way for `mmap` to work short of [distributed memory][2] schemes, which are super-slow and fiddly besides, which is why no current OS bothers to provide such things. It was a thing back in the days of "cluster computing", but we don't architect systems that way any more, because we learned it sucks.

I'd be surprised if you could `mmap` between two Docker containers even on the same host, with the same OS, shared local file store, matching CPU type, etc. If it is possible, it should only be so through careful configuration, but I couldn't find any docs online about doing so.

If you have two containers today, can I assume you intend to have many containers later? If so, then one of the [distributed SQLite variants][3] may be more what you need. It'll solve this problem in a much better fashion. This is the modern answer to cluster computing.

[1]: https://www.man7.org/linux/man-pages/man2/mmap.2.html
[2]: https://en.wikipedia.org/wiki/Distributed_memory
[3]: /forumpost/51eb6f1411