Badger Write Performance

231 views
Skip to first unread message

dc0d

unread,
Jan 18, 2018, 2:33:02 PM1/18/18
to golang-nuts
Badger write performance is a bit worse than boltdb. And badger suggests to batch writes. But so does boltdb.

At the same time at badger's GitHub page it says it has higher write performance compared to boltdb.

Is there a sample of how to do high performance/throughput writes with badger?

Jordan Krage

unread,
Jan 20, 2018, 7:26:10 AM1/20/18
to golang-nuts
Are you using 'SyncWrites=false'? (Or 'NoSync' with boltdb?)

It looks like the badger benchmarks from github.com/dgraph-io/badger-bench do not sync. 

dc0d

unread,
Jan 20, 2018, 2:12:25 PM1/20/18
to golang-nuts
In docs for boltdb it is stated that NoSync should be used very carefully because it can leave the database in an inconsistent state.

If a full fledged distributed database was the case, a no-sync manner would be acceptable. But for an embedded database, it is not a plus (to be performant in no-sync mode, assuming that mode would not leave database in an inconsistent state, in case of a dirty shutdown of the app or the machine).

Diego Medina

unread,
Jan 21, 2018, 11:21:52 AM1/21/18
to golang-nuts
The use of SyncWrites=false on badger's benchmark was called out on reddit and the benchmark author's reply was along the lines of "it's ok for our use case to lose the last few [seconds|ms] of data"

You draw your conclusion on where you want to keep your data.

dc0d

unread,
Jan 22, 2018, 3:22:39 PM1/22/18
to golang-nuts
I've followed badger since it's beta and the discussions it emitted. Those "lines" and discussions, alongside it's history, do not provide the most happy influence that one would hope for.
Reply all
Reply to author
Forward
0 new messages