BadgerDB v1.5.5 and v2.0.0-rc1 are now released

Today we’re releasing two new versions of Badger as we approach the Badger v2 release.

BadgerDB v1.5.5

This version is very similar to v1.5.3 but brings support to Go Modules.
It also has some bug fixes.

BadgerDB v2.0.0-rc1

This version is our first attempt at releasing v2! :tada:
It contains around 200 commits fixing many issues and bringing some new APIs such as Stream, StreamWriter, and DB subscriptions.

Read the release information here,
the CHANGELOG should be updated soon with all the gritty details that you might want to know about.

Please test this version and let us know if you find any functional or performance issues.
We’re now working on our own tests and benchmarks, including integrating this version into Dgraph for load testing.

Cheers,

Francesc
Product at Dgraph

3 Likes

Used pogreb-bench to compare badger v1.5 against badger v2:

v1.5 (serial transactions):

Number of keys: 1000000
Minimum key size: 16, maximum key size: 64
Minimum value size: 128, maximum value size: 512
Concurrency: 2
Running badgerdb benchmark...
Put: 20.065 sec, 49839 ops/sec
Get: 2.813 sec, 355552 ops/sec
Put + Get time: 22.877 sec
File size: 1.94GB

v2 (serial transactions):

Number of keys: 1000000
Minimum key size: 16, maximum key size: 64
Minimum value size: 128, maximum value size: 512
Concurrency: 2
Running badgerdb benchmark...
Put: 28.065 sec, 35632 ops/sec
Get: 2.860 sec, 349689 ops/sec
Put + Get time: 30.924 sec
File size: 2.41GB

v2 (with WriteBatch):

Number of keys: 1000000
Minimum key size: 16, maximum key size: 64
Minimum value size: 128, maximum value size: 512
Concurrency: 2
Running badgerdb benchmark...
Put: 4.076 sec, 245349 ops/sec
Get: 2.851 sec, 350804 ops/sec
Put + Get time: 6.926 sec
File size: 1.30GB

So it seems that v2 is slower than v1.5 when using a transaction per put, but those results are negated by the fact that using WriteBatch is roughly 4x faster than v1.5 (where WriteBatch is unavailable) and 7x faster than v2 when using a transaction per put.

We should make it clear in the documentation that there are much better and faster ways to write a lot of data to badger than using transactions.

1 Like

Other db benchmarks (same options):

Pudge

Number of keys: 1000000
Minimum key size: 16, maximum key size: 64
Minimum value size: 128, maximum value size: 512
Concurrency: 2
Running pudge benchmark...
Put: 4.620 sec, 216433 ops/sec
Get: 0.797 sec, 1254779 ops/sec
Put + Get time: 5.417 sec
File size: 358.72MB

Pogreb:

Number of keys: 1000000
Minimum key size: 16, maximum key size: 64
Minimum value size: 128, maximum value size: 512
Concurrency: 2
Running pogreb benchmark...
Put: 4.244 sec, 235627 ops/sec
Get: 0.318 sec, 3142612 ops/sec
Put + Get time: 4.562 sec
File size: 568.30MB

It seems like badger read is slow compared to other DBs but I can probably make it faster by not using the same transaction every time.

EDIT: used one transaction for all the reads but performance is about the same. Using an iterator wouldn’t help since the reads are random.