Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get read access to locked database #236

Open
Anton111111 opened this issue Jun 8, 2023 · 1 comment
Open

Get read access to locked database #236

Anton111111 opened this issue Jun 8, 2023 · 1 comment
Labels
question Support or open question(s)

Comments

@Anton111111
Copy link

I have a telegram bot that save users in leveldb.
But now i need separate command that will send message or all users from DB.
And i can't open db in separate script because DB is locked by bot. It's good.
Now i have a trick to resolve this task: On each db.put i also save whole data from db in separate file.
I wonder is level has some better way to resolve my task? Maybe level db has ability to open or read only with ignoring lock or other ability get whole data from locked db?

@vweevers
Copy link
Member

vweevers commented Jun 11, 2023

See rave-level and (for more control) many-level.

Alternatively, switch from LevelDB to RocksDB. Although we haven't updated our binding for RocksDB (rocksdb and level-rocksdb) in a while, it does have a readOnly option, that let's you open a db from multiple processes if they only need read access.

@vweevers vweevers added the question Support or open question(s) label Jun 11, 2023
@vweevers vweevers changed the title read snapshot Get read access to locked database Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Support or open question(s)
Projects
None yet
Development

No branches or pull requests

2 participants