Badger: does merge operator support managed db?


(Kevin Yang) #1

Hey, Badger team:

I’m wondering if I can use merge operator for a managed badger.DB?

It’s not that clear by reading the source file merge.go. In my use case, I would like to maintain a merge operator for each key (and for each version), the frequency at which I get the result doesn’t matter that much, as long as I can get the correct result.

Thanks.


(Ibrahim Jarif) #2

HI @yangzh, the merge operator doesn’t support managed db. We use transactions for all the underlying operations (like GET and MERGE). These transactions could be managed transactions (the ones create by managed DB).

We should be able refactor the merge operator to support managed mode transactions also.


(Kevin Yang) #3

thanks @ibrahim.

Previously I was thinking of using merge operator for secondary indexing on my own managed badger.DB.

However, later I realized it’s not necessary to use merge operator for this purpose, but still, I would argue there is no fundamental reason why managed db cannot support merge operator (and there might be use cases out there).

Do you (or anyone in your team) mind keep this feature request in mind? just for sake of feature parity and benefit of future users (maybe)?


(Daniel Mai) #4

Please file a feature request as a GitHub issue on Badger. https://github.com/dgraph-io/badger/issues/new


(Kevin Yang) #5

Done, https://github.com/dgraph-io/badger/issues/1016

Thanks.