gorocksdb alternatives and similar packages
Based on the "Database" category.
Alternatively, view gorocksdb alternatives based on common mentions on social networks and blogs.
-
vitess
vitess provides servers and tools which facilitate scaling of MySQL databases for large scale web services. -
groupcache
Groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases. -
TinyGo
Go compiler for small places. Microcontrollers, WebAssembly, and command-line tools. Based on LLVM. -
go-cache
An in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications. -
go-mysql-elasticsearch
Sync your MySQL data into Elasticsearch automatically. -
VictoriaMetrics
fast, resource-effective and scalable open source time series database. May be used as long-term remote storage for Prometheus. Supports PromQL. -
buntdb
A fast, embeddable, in-memory key/value database for Go with custom indexing and spatial support. -
xo
Generate idiomatic Go code for databases based on existing schema definitions or custom queries supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server. -
sql-migrate
Database migration tool. Allows embedding migrations into the application using go-bindata. -
immudb
immudb is a lightweight, high-speed immutable database for systems and applications written in Go. -
nutsdb
Nutsdb is a simple, fast, embeddable, persistent key/value store written in pure Go. It supports fully serializable transactions and many data structures such as list, set, sorted set. -
skeema
Pure-SQL schema management system for MySQL, with support for sharding and external online schema change tools. -
Bitcask
Bitcask is an embeddable, persistent and fast key-value (KV) database written in pure Go with predictable read/write performance, low latency and high throughput thanks to the bitcask on-disk layout (LSM+WAL). -
ObjectBox Go Database
ObjectBox Go - a database for your Go structs/objects. Super-fast and simple.
Get performance insights in less than 4 minutes
Do you think we are missing an alternative of gorocksdb or a related project?
README
A Go wrapper for RocksDB with utilities for better performance and extensions.
Install
You'll need to build RocksDB v5.8+ on your machine. Future RocksDB versions will have separate branches.
Additional features
GoBufferIterator
GoBufferIterator is an iterator that that uses the original iterator but does less cgo calls due to prefetching data in a go byte slice. This is useful if you range over a large number of KVs and can give you a large performance boost.
readaheadByteSize := uint64(1024 * 1024)
readaheadCnt := uint64(1024)
iter := db.NewIterator(readOptions)
goitr := NewGoBufferIteratorFromIterator(iter, readaheadByteSize, readaheadCnt, false, IteratorSortOrder_Asc)
Extensions
To extend functionality and mainly to reduce cgo calls.
ẀriteBatch
// PutVCF queues multiple key-value pairs in a column family.
PutVCF(cf *ColumnFamilyHandle, keys, values [][]byte)
// PutVCFs queues multiple key-value pairs in column families.
PutVCFs(cfs []*ColumnFamilyHandle, keys, values [][]byte)
MultiIterator
Its purpose is to iterate with multiple iterators at once.
Package /extension/events does provide a MultiIterator for "topics with events" -> TopicEventMultiIterator. An example can be found here.
The standard MultiIterator can be used for example: You have "topics" in your RocksDB which do store "events" and share a common suffix length. i.e. 8bytes Topic ID, 8bytes Event ID (16 byte is the key). You want to "combine" some topics and iterate through those by ascending event id up to eventID9.
ro1 := NewDefaultReadOptions()
ro1.SetIterateUpperBound([]byte("topicID1eventID9"))
ro2 := NewDefaultReadOptions()
ro2.SetIterateUpperBound([]byte("topicID2eventID9"))
ro3 := NewDefaultReadOptions()
ro3.SetIterateUpperBound([]byte("topicID3eventID9"))
it1 := db.NewIterator(ro1)
it2 := db.NewIterator(ro2)
it3 := db.NewIterator(ro3)
itrs = []*Iterator{
it1, it2, it3,
}
readaheadSize := uint64(1024 * 1024)
readaheadCnt := uint64(3)
prefixLen := uint64(8)
multiitr = NewFixedPrefixedMultiIteratorFromIterators(readaheadSize, readaheadCnt, true, itrs, prefixLen)
for multiitr.Seek(seekKeys); multiitr.Valid(); multiitr.Next() {
k, v := multiitr.KeyValue()
itrIdx := multiitr.IteratorIndex() // describes which of the iterators in "itrs" provides k, v
}
Or: You have "topics" in your RocksDB which do store "events" and share a common suffix length. i.e. 8bytes Topic ID, 8bytes Event ID (16 byte is the key). You want to "combine" some topics and iterate through those by ascending event id up to eventID9. For the suffix type of MultiIterator you need an appropriate comparator.
suffixLen := uint64(8) // our Event ID key part which always has to be 8 bytes here.
multiitr = NewFixedSuffixMultiIteratorFromIterators(readaheadSize, readaheadCnt, true, itrs, suffixLen)
Please be aware that your DB / column family needs the appropriate comparator! If you use the standard comparator (BytewiseComparator) all keys MUST have same length.
Examples
Thanks
Thanks to gorocksdb where this is forked from originally.