Fork me on GitHub

Which xtdb storage options allow connections from multiple processes?


Hey, any tx log + document store combo that isn't backed by an embedded KV store will do the job (which is something worth clarifying in this part of the docs next week...thanks for the inspiration!)


(^ presuming you mean processes across different machines, i.e. a cluster of nodes)


Thanks for the quick response. I meant multiple processes on the same machine.


Basically, I want to share a db across multiple processes on the same machine. I started with rocksdb which gives:

Execution error (RocksDBException) at org.rocksdb.RocksDB/open (
While lock file: dev/index-store/LOCK: Resource temporarily unavailable
Not sure which storage option might be the best fit for this setup.


My use case is pretty low volume, but ideally, it would be great to have an option where I can use the same db across multiple processes without having to run an additional db process (like postgres).


It's possible that I missed it, but a feature matrix for the different storage solution would be really helpful.

👍 1

Ah, maybe you want the http-server + http-client then?


wouldn't that require running a separate process for the db?


nope, you can still embed the node (with embedded HTTP server) in one of your app processes


it's not terribly efficient though if there's no actual network


The existing KV stores aren't equipped for multi-process usage, although RocksDB does have an "open as secondary" API which might work okay but I've not attempted to use it before


you could also have multiple KV index-stores, one per process, but that would be pretty an inefficient use of resources also (more so than HTTP overheads, I expect)


Just a little more background. I'm working on some dev tooling that has some state it would like to store. The goal is to use the same dev tooling across multiple projects which each have their own repl. There's not really a master process.

👍 1

I know sqlite has a multi-process mode,


I wasn't sure if any of the kv-stores did


Thanks, that is useful to know. If the state isn't huge then SQLite might actually be a good option for the tx-log + doc-store in that case - have each node, in each project, maintain its own KV store


Would that allow data to be shared across projects?


yep, all nodes pointing at a shared SQLite file in a common directory containing the tx-log + doc-store


It could only work with that multi-process mode though, which I've not tried


So if I wanted to share the data, I would just use a single KV store for all projects? > have each node, in each project, maintain its own KV store Is this for a per-project setup or still connected to a shared setup?


Yea, I realize this is an odd use case.


The idea is like having a .emacs file that is shared for all development, but using a database rather than a text file.


I meant KV store per project (for the index-stores only), all pointing at a common SQLite containing the tx-log and doc-store

👍 1

oh! got it! Thanks for the help. I'll give it a shot 🤞.

🤞 1

cool, I'd be happy to help with getting the config nailed down. Also curious to hear how you get on in any event 🙂

👍 1