dgraph-io / badger

Fast key-value DB in Go.

Home Page:https://dgraph.io/badger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[QUESTION]: How can I limit the disk size used by Badger or the number of keys that Badger can store through parameter configuration in the program?

Delete-S opened this issue · comments

Question.

How can I limit the disk size used by Badger or the number of keys that Badger can store through parameter configuration in the program?

@Delete-S I don't think that is possible today. What is the use case you are looking at for this functionality?

@mangalaman93 Thanks for answering my questions.
this is the use case:
we use badger on a iot device. In order to prevent the program from running out of hard disk when a bug leads to unlimited SET data into the badger.

I think the best way to achieve this is to partition the disk you have and use badger on just one partition.