You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SugarDB is a highly configurable, distributed, in-memory data store and cache implemented in Go.
It can be imported as a Go library or run as an independent service.
SugarDB aims to provide a rich set of data structures and functions for
manipulating data in memory. These data structures include, but are not limited to:
Lists, Sets, Sorted Sets, Hashes, and much more to come soon.
SugarDB provides a persistence layer for increased reliability. Both Append-Only files
and snapshots can be used to persist data in the disk for recovery in case of unexpected shutdowns.
Replication is a core feature of SugarDB and is implemented using the RAFT algorithm,
allowing you to create a fault-tolerant cluster of SugarDB nodes to improve reliability.
If you do not need a replication cluster, you can always run SugarDB
in standalone mode and have a fully capable single node.
SugarDB aims to not only be a server but to be importable to existing
projects to enhance them with SugarDB features, this
capability is always being worked on and improved.
Features
Features offered by SugarDB include:
TLS and mTLS support for multiple server and client RootCAs.
Replication cluster support using the RAFT algorithm.
ACL Layer for user Authentication and Authorization.
Distributed Pub/Sub functionality.
Sets, Sorted Sets, Hashes, Lists and more.
Persistence layer with Snapshots and Append-Only files.
Key Eviction Policies.
Command extension via shared object files.
Command extension via embedded API.
Command extension via Lua Modules.
Command extension via JavaScript Modules.
Multi-database support for key namespacing.
We are working hard to add more features to SugarDB to make it
much more powerful. Features in the roadmap include:
Sharding
Streams
Transactions
Bitmap
HyperLogLog
JSON
Improved Observability
Usage (Embedded)
Install SugarDB with: go get github.com/echovault/sugardb/sugardb.
Here's an example of using SugarDB as an embedded library.
You can access all of SugarDB's commands using an ergonomic API.
funcmain() {
server, err:=sugardb.NewSugarDB()
iferr!=nil {
log.Fatal(err)
}
_, _, _=server.Set("key", "Hello, SugarDB!", sugardb.SETOptions{})
v, _:=server.Get("key")
fmt.Println(v) // Hello, SugarDB!// (Optional): Listen for TCP connections on this SugarDB instance.server.Start()
}
An embedded SugarDB instance can still be part of a cluster, and the changes triggered
from the API will be consistent across the cluster.
Usage (Client-Server)
Homebrew
To install via homebrew, run:
brew tap echovault/sugardb
brew install echovault/echovault/sugardb
Once installed, you can run the server with the following command:
sugardb --bind-addr=localhost --data-dir="path/to/persistence/directory"