Replies: 1 comment 4 replies
-
Since Litestream runs as a separate process, it can't access the memory inside another process. If it were used as a library, I'm not sure if there is access to the in-memory implementation where WAL pages could be applied. Maybe there's a low-level API that could inject into the in-memory virtual file system (VFS).
You may be able to use the SQLite backup API. What's the benefit of it though? It seems like you'd have pages in the on-disk instance in the OS page cache so I would think it'd be pretty fast.
There is a library example but the API is in flux so it's not recommended. Also, it doesn't work well on macOS because of how BSD does per-process locks.
The read replication implementation will have an API over HTTP that streams out the snapshot plus WAL changes. You could read off of that depending on what you need to do. After I get the read replication working, my plan is to work on a serverless implementation of SQLite that works via a VFS. That might fit more inline with what you're trying to do. At that point, it'd have more control to keep the read replicas purely in-memory. |
Beta Was this translation helpful? Give feedback.
-
In reference to my previous discussion about replicating to multiple targets where I have
Is it possible for Litestream to replicate from the write instance to an in-memory instance on the readers?
If it isn't possible with the current design then...
Thanks!
rjsjr
Beta Was this translation helpful? Give feedback.
All reactions