redb icon indicating copy to clipboard operation
redb copied to clipboard

open the same db in read only mode

Open 0x8f701 opened this issue 1 year ago • 3 comments

Error: Database already open. Cannot acquire lock.

I have one process which does read & write, another process which does read

0x8f701 avatar May 22 '24 09:05 0x8f701

rocksdb allows to open in readonly mode

0x8f701 avatar May 22 '24 10:05 0x8f701

See #678

lhallam avatar May 23 '24 11:05 lhallam

rocksdb read only mode cannot sync with the write, secondary db instance doesn't work well either, if we cannot find a very useful and elegant solution, then I think we can abandon this

the whole point is to have 1 R/W + n R instances and the n read instances can sync well with the write

0x8f701 avatar May 29 '24 03:05 0x8f701

I believe this is available now since the document clarifies: https://docs.rs/redb/latest/redb/struct.Database.html Opened redb database file: Multiple reads may be performed concurrently, with each other, and with writes. pub fn begin_read(&self): Read transactions may exist concurrently with writes

axww avatar Nov 21 '24 16:11 axww

@axww AFAICT what you're quoting applies only within one process. What the OP asked for is multiple processes opening the same database. AFAIU as per https://github.com/cberner/redb/issues/678 this should be possible in the future, but is currently not implemented.

dpc avatar Dec 26 '24 20:12 dpc