gorocksdb alternatives and similar packages
Based on the "Database" category.
Alternatively, view gorocksdb alternatives based on common mentions on social networks and blogs.
-
tidb
TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications. -
cockroach
CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement. -
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 (WASM/WASI), and command-line tools. Based on LLVM. -
bytebase
The GitHub/GitLab for database DevSecOps. World's most advanced database DevSecOps solution for Developer, Security, DBA and Platform Engineering teams. -
go-cache
An in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications. -
immudb
immudb - immutable database based on zero trust, SQL/Key-Value/Document model, tamperproof, data change history -
buntdb
BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support -
pREST
PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new -
xo
Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server -
nutsdb
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. -
lotusdb
Most advanced key-value database written in Go, extremely fast, compatible with LSM tree and B+ tree. -
gocraft/dbr (database records)
Additions to Go's database/sql for super fast performance and convenience.
CodeRabbit: AI Code Reviews for Developers
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.