Go get github.com/dgraph-io/dgraph/... - Dgraph Blog

Thank you Go community for all the love that you showered on Badger. Within 8 hours of announcing Badger, the blog post made it to the first page of Hacker News. And within three days, the Github repo received 1250 stars, having crossed 1500 by the time of this post. We have already merged contributions and received feedback that we need to work on.

All this goes to show how much people enjoy Go native libraries. They make things easier. Any tool, library or system written in Go can now just run go get github.com/dgraph-io/badger, and they have a fast, efficient key-value store to use.

Dgraph users have been asking us about embeddable and go gettable Dgraph for a while. After hearing from many different users independently, I decided to create a Github issue to track it.

We had two dependencies on Cgo which prevented go getable Dgraph in the past:

  1. ICU library to do tokenization and full-text search.
  2. RocksDB as the key-value store.

Back in Q1 2017, we got rid of C based ICU library and switched to using parts of Bleve. Bleve simplified our code base, at the cost of losing CJK support. But, we thought that’s a trade-off we can live with for the time being.

The second step of replacing RocksDB was a lot harder, and a lot more interesting journey, culminating in the release of Badger.

Today, we pushed a change to Dgraph master branch to switch to Badger. That single change resulted in 450K deleted lines and made Dgraph go getable. This is an exciting day for the Dgraph team, as it simplifies our lives as developers hugely.

Not only would we have simpler, faster builds and releases; we’d also have profiles going all the way down to the disk, and all the way out to the RAM. Every aspect of Dgraph system can now be tweaked for performance. No hard language boundaries, and that’s powerful.

I adore changes which delete more code than they add, while also gaining simplicity and functionality. This change is one of those.

![](upload://iwF0D8JInZXRRBxJ2kkhurmtrO4.png) ![](upload://8x2Kig15moS5nzIgffuevlFlH1L.png)

Happy go getting! It needs a bit more work before Dgraph can be embedded in your Go code, but that is coming soon to master. It would be part of the v0.8 release.

Disclaimer: Dgraph in master branch contains latest changes and isn’t thoroughly tested. Use it at your own risk.

Top image: Canadarm aboard the ISS


This is a companion discussion topic for the original entry at https://open.dgraph.io/post/goget/