BadgerDB file size growing too much too fast


I’m on an IoT project where I need data persistance. I started using BadgerDB and it’s working fine. One problem I’m facing is the constant increase of the data file.

Since this is for data persistance I have to save to disk at every new value of a tag. My option.SyncWrites is true.

I’m testing with a few tags only but the file size keep growing. I’m only interested in the latest value, no need of any historical. Set the option.NumVersionsToKeep = 1

I was expecting an update only on my [key,value] which should not increase my file size for the same number of [key,value] pairs.

Anything I’m missing? Thanks

(Daniel Mai) #2

The value log is append-only, so new values are appended, never overwritten. You can configure the value log size. You’ll also want to run value log GC periodically.