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

Support disk-less mode #1001

Closed
peterbourgon opened this issue Aug 23, 2019 · 3 comments · Fixed by #1113
Closed

Support disk-less mode #1001

peterbourgon opened this issue Aug 23, 2019 · 3 comments · Fixed by #1113
Assignees
Labels
area/performance Performance related issues. kind/feature Something completely new we should consider. priority/P3 Low priority, something to be done once everything else is fixed. status/accepted We accept to investigate or work on it.
Milestone

Comments

@peterbourgon
Copy link

Can BadgerDB support a pure in-memory mode, where there is no disk access at all?

Related discuss.dgraph.io thread.

@jarifibrahim
Copy link
Contributor

@peterbourgon We don't support this right now. The value log acts as a WAL which has to be written to the disk.
We might support a memory-only mode in future.

@jarifibrahim jarifibrahim added area/performance Performance related issues. kind/feature Something completely new we should consider. priority/P3 Low priority, something to be done once everything else is fixed. status/accepted We accept to investigate or work on it. labels Aug 23, 2019
@jarifibrahim jarifibrahim added this to the Future ideas milestone Aug 23, 2019
@poonai poonai self-assigned this Aug 23, 2019
@manishrjain
Copy link
Contributor

manishrjain commented Aug 23, 2019

I think @balajijinnah is working on making it so that if writes don't need to be present in value log (value size < ValueThreshold, therefore values are already stored in the LSM tree), they won't be written to the log. That change along with setting very high ValueThreshold should give us the ability to not write to value log at all. Then all we need to do is to keep Tables in memory, which is already an option.

Furthermore, if no persistence is required, we can add another option to keep all levels in memory, instead of them being written to disk. This feature could also be useful to allow Dgraph to act like a search engine instead of just a DB.

@jasonmf
Copy link

jasonmf commented Nov 12, 2019

I'm interested in this capability for the purpose of writing unit tests for code that uses badger and would like to avoid those tests depending on having access to write to the disk.

@jarifibrahim jarifibrahim assigned jarifibrahim and unassigned poonai Nov 13, 2019
jarifibrahim pushed a commit that referenced this issue Nov 25, 2019
This PR introduces in-memory mode in badger. The in-memory mode
can be enabled by setting options.InMemory=true. When badger is
running in in-memory mode no files are created and everything 
is stored in memory.

On DB close, all stored data is lost.
NOTE - An existing DB cannot be opened in in-memory mode.

Fixes - #1001
manishrjain pushed a commit to outcaste-io/outserv that referenced this issue Jul 6, 2022
This PR introduces in-memory mode in badger. The in-memory mode
can be enabled by setting options.InMemory=true. When badger is
running in in-memory mode no files are created and everything 
is stored in memory.

On DB close, all stored data is lost.
NOTE - An existing DB cannot be opened in in-memory mode.

Fixes - dgraph-io/badger#1001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/performance Performance related issues. kind/feature Something completely new we should consider. priority/P3 Low priority, something to be done once everything else is fixed. status/accepted We accept to investigate or work on it.
Development

Successfully merging a pull request may close this issue.

5 participants