Is there a go gettable rocksdb library/wrapper in Go

I’m working something where I want a embedded storage layer with persistent, fast writes. I’ve read about RocksDb and I believe that its the right tool for the job. However after looking around for a while, I’ve realized that there are no go-gettable rocksdb wrappers in Go. I believe that the wrapper gorocksdb http:/github.com/tecbot/gorocksdb if imported would make my application non go-gettable. Is there a way to work around this problem ? Is there a way to use rockdb in Go and maintain the go-gettableness of the library that uses rocksdb internally. Thanks

This will not prevent your project from being go gettable, unless you mean that because this wrapper uses cgo the user will need a working C compiler (also insert usual cross compilation confusion).

Thanks Dave, I tried to go get a few projects that import this.
Unfortunately, I’ve been unable to build any of these. The error on the go get result has been consistently:

# github.com/tecbot/gorocksdb
../tecbot/gorocksdb/backup.go:4:11: fatal error: 'rocksdb/c.h' file not found
 #include "rocksdb/c.h"
          ^
1 error generated.

Now, with regard to the cross compilation and the C compiler, I’ve tried this across two different machines (an OS X 10.11.5/Darwin Kernel Version 15.5/Apple LLVM version 7.3.0 (clang-703.0.29) and another Ubuntu 14.05 with gcc version 4.8.4), and in both the cases I’ve seen the same error where it as failed to find the rocksdb C library. (error above)

As I’m still new to Cgo based development, I might be doing something wrong or my assumptions might be simply incorrect here. It’d be great to know what you think might be happening and how can I get around this problem.
PS: Text dump of my screen: https://gist.github.com/aishraj/db65efde84c5a18994ee1a8c305b5bab

You need to have the rocksdb c library installed first. This package is just a wrapper around the c clibrary.

1 Like

Thanks. That explains the behavior.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.