{"id":15219219,"url":"https://github.com/EchoVault/SugarDB","last_synced_at":"2025-10-03T11:32:04.979Z","repository":{"id":177869632,"uuid":"661028050","full_name":"EchoVault/SugarDB","owner":"EchoVault","description":"Embeddable and distributed in-memory alternative to Redis.","archived":false,"fork":false,"pushed_at":"2024-09-22T15:02:22.000Z","size":14411,"stargazers_count":372,"open_issues_count":28,"forks_count":19,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-09-23T06:07:15.929Z","etag":null,"topics":["cache","client-server","cluster","consistent","database","distributed","distributed-database","go","golang","in-memory-database","lfu-cache","lru-cache","memory","networking","pubsub","redis","store","tcp","tcp-server"],"latest_commit_sha":null,"homepage":"https://sugardb.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EchoVault.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-01T15:03:59.000Z","updated_at":"2024-09-23T02:08:49.000Z","dependencies_parsed_at":"2023-10-16T11:26:15.469Z","dependency_job_id":"5c199167-533e-44bd-8637-14f4eebf2649","html_url":"https://github.com/EchoVault/SugarDB","commit_stats":null,"previous_names":["kelvinmwinuka/memstore","kelvinmwinuka/memstore-server-go","echovault/echovault","echovault/sugardb"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EchoVault%2FSugarDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EchoVault%2FSugarDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EchoVault%2FSugarDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EchoVault%2FSugarDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EchoVault","download_url":"https://codeload.github.com/EchoVault/SugarDB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235122203,"owners_count":18939259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","client-server","cluster","consistent","database","distributed","distributed-database","go","golang","in-memory-database","lfu-cache","lru-cache","memory","networking","pubsub","redis","store","tcp","tcp-server"],"created_at":"2024-09-28T13:01:00.076Z","updated_at":"2025-10-03T11:32:04.974Z","avatar_url":"https://github.com/EchoVault.png","language":"Go","readme":"[![Go](https://github.com/EchoVault/SugarDB/workflows/Go/badge.svg)]() \n[![Go Report Card](https://goreportcard.com/badge/github.com/echovault/echovault)](https://goreportcard.com/report/github.com/echovault/echovault)\n[![codecov](https://codecov.io/gh/EchoVault/SugarDB/graph/badge.svg?token=CHWTW0IUNV)](https://codecov.io/gh/EchoVault/SugarDB)\n\u003cbr/\u003e\n[![Go Reference](https://pkg.go.dev/badge/github.com/echovault/echovault.svg)](https://pkg.go.dev/github.com/echovault/sugardb)\n[![GitHub Release](https://img.shields.io/github/v/release/EchoVault/SugarDB)]()\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n\u003cbr/\u003e\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go) \n[![Discord](https://img.shields.io/discord/1211815152291414037?label=Discord\u0026labelColor=%237289da)](https://discord.com/invite/JrG4kPrF8v)\n\u003cbr/\u003e\n\n\u003chr/\u003e\n\n# Table of Contents\n1. [What is SugarDB](#what-is-sugardb)\n2. [Features](#features)\n3. [Usage (Embedded)](#usage-embedded)\n4. [Usage (Client-Server)](#usage-client-server)\n   1. [Homebrew](#usage-homebrew)\n   2. [Docker](#usage-docker)\n   3. [GitHub Container Registry](#usage-container-registry)\n   4. [Binaries](#usage-binaries)\n5. [Clients](#clients)\n6. [Benchmarks](#benchmarks)\n7. [Commands](#commands)\n   1. [ACL](#commands-acl)\n   2. [ADMIN](#commands-admin)\n   3. [CONNECTION](#commands-connection)\n   4. [GENERIC](#commands-generic)\n   5. [HASH](#commands-hash)\n   6. [LIST](#commands-list)\n   7. [PUBSUB](#commands-pubsub)\n   8. [SET](#commands-set)\n   9. [SORTED SET](#commands-sortedset)\n   10. [STRING](#commands-string)\n\n\u003ca name=\"what-is-sugardb\"\u003e\u003c/a\u003e\n# What is SugarDB?\n\nSugarDB is a highly configurable, distributed, in-memory data store and cache implemented in Go.\nIt can be imported as a Go library or run as an independent service.\n\nSugarDB aims to provide a rich set of data structures and functions for\nmanipulating data in memory. These data structures include, but are not limited to:\nLists, Sets, Sorted Sets, Hashes, and much more to come soon.\n\nSugarDB provides a persistence layer for increased reliability. Both Append-Only files \nand snapshots can be used to persist data in the disk for recovery in case of unexpected shutdowns.\n\nReplication is a core feature of SugarDB and is implemented using the RAFT algorithm, \nallowing you to create a fault-tolerant cluster of SugarDB nodes to improve reliability.\nIf you do not need a replication cluster, you can always run SugarDB\nin standalone mode and have a fully capable single node.\n\nSugarDB aims to not only be a server but to be importable to existing \nprojects to enhance them with SugarDB features, this \ncapability is always being worked on and improved.\n\n\u003ca name=\"features\"\u003e\u003c/a\u003e\n# Features\n\nFeatures offered by SugarDB include:\n\n1) TLS and mTLS support for multiple server and client RootCAs.\n2) Replication cluster support using the RAFT algorithm.\n3) ACL Layer for user Authentication and Authorization.\n4) Distributed Pub/Sub functionality.\n5) Sets, Sorted Sets, Hashes, Lists and more.\n6) Persistence layer with Snapshots and Append-Only files.\n7) Key Eviction Policies.\n8) Command extension via shared object files.\n9) Command extension via embedded API.\n10) Command extension via Lua Modules.\n11) Command extension via JavaScript Modules.\n12) Multi-database support for key namespacing.\n\nWe are working hard to add more features to SugarDB to make it\nmuch more powerful. Features in the roadmap include:\n\n1) Sharding\n2) Streams\n3) Transactions\n4) Bitmap\n5) HyperLogLog\n6) JSON\n7) Improved Observability\n   \n\n\u003ca name=\"usage-embedded\"\u003e\u003c/a\u003e\n# Usage (Embedded)\n\nInstall SugarDB with: `go get github.com/echovault/sugardb/sugardb`.\n\nHere's an example of using SugarDB as an embedded library.\nYou can access all of SugarDB's commands using an ergonomic API.\n\n```go\nfunc main() {\n  server, err := sugardb.NewSugarDB()\n  if err != nil {\n    log.Fatal(err)\n  }\n\n  _, _, _ = server.Set(\"key\", \"Hello, SugarDB!\", sugardb.SETOptions{})\n\n  v, _ := server.Get(\"key\")\n  fmt.Println(v) // Hello, SugarDB!\n\n  // (Optional): Listen for TCP connections on this SugarDB instance.\n  server.Start()\n}\n```\n\nAn embedded SugarDB instance can still be part of a cluster, and the changes triggered \nfrom the API will be consistent across the cluster.\n\n\u003ca name=\"usage-client-server\"\u003e\u003c/a\u003e\n# Usage (Client-Server) \n\n\u003ca name=\"usage-homebrew\"\u003e\u003c/a\u003e\n### Homebrew\n\nTo install via homebrew, run:\n1) `brew tap echovault/sugardb`\n2) `brew install echovault/echovault/sugardb`\n\nOnce installed, you can run the server with the following command:\n`sugardb --bind-addr=localhost --data-dir=\"path/to/persistence/directory\"`\n\n\u003ca name=\"usage-docker\"\u003e\u003c/a\u003e\n### Docker\n\n`docker pull echovault/sugardb`\n\nThe full list of tags can be found [here](https://hub.docker.com/r/echovault/sugardb/tags).\n\n\u003ca name=\"usage-container-registry\"\u003e\u003c/a\u003e\n### Container Registry\n\n`docker pull ghcr.io/echovault/sugardb`\n\nThe full list of tags can be found [here](https://github.com/EchoVault/SugarDB/pkgs/container/sugardb).\n\n\u003ca name=\"usage-binaries\"\u003e\u003c/a\u003e\n### Binaries\n\nYou can download the binaries by clicking on a release tag and downloading\nthe binary for your system.\n\n\u003ca name=\"clients\"\u003e\u003c/a\u003e\n# Clients\n\nSugarDB uses RESP, which makes it compatible with existing \nRedis clients.\n\n\u003ca name=\"benchmarks\"\u003e\u003c/a\u003e\n# Benchmarks\nTo compare command performance with Redis, benchmarks can be run with: \n\n`make benchmark`\n\nPrerequisites:\n- `brew install redis` to run the Redis server and benchmark script\n- `brew tap echovault/sugardb` \u0026 `brew install echovault/echovault/sugardb` to run the SugarDB Client-Server\n\nBenchmark script options:\n- `make benchmark use_local_server=true` runs on your local SugarDB Client-Server\n- `make benchmark commands=ping,set,get...` runs the benchmark script on the specified commands\n\n\u003ca name=\"commands\"\u003e\u003c/a\u003e\n# Supported Commands\n\n\u003ca name=\"commands-acl\"\u003e\u003c/a\u003e\n## ACL\n* [ACL CAT](https://sugardb.io/docs/commands/acl/acl_cat)\n* [ACL DELUSER](https://sugardb.io/docs/commands/acl/acl_deluser)\n* [ACL GETUSER](https://sugardb.io/docs/commands/acl/acl_getuser)\n* [ACL LIST](https://sugardb.io/docs/commands/acl/acl_list)\n* [ACL LOAD](https://sugardb.io/docs/commands/acl/acl_load)\n* [ACL SAVE](https://sugardb.io/docs/commands/acl/acl_save)\n* [ACL SETUSER](https://sugardb.io/docs/commands/acl/acl_setuser)\n* [ACL USERS](https://sugardb.io/docs/commands/acl/acl_users)\n* [ACL WHOAMI](https://sugardb.io/docs/commands/acl/acl_whoami)\n\n\u003ca name=\"commands-admin\"\u003e\u003c/a\u003e\n## ADMIN\n* [COMMAND COUNT](https://sugardb.io/docs/commands/admin/command_count)\n* [COMMAND LIST](https://sugardb.io/docs/commands/admin/command_list)\n* [COMMANDS](https://sugardb.io/docs/commands/admin/commands)\n* [LASTSAVE](https://sugardb.io/docs/commands/admin/lastsave)\n* [MODULE LIST](https://sugardb.io/docs/commands/admin/module_list)\n* [MODULE LOAD](https://sugardb.io/docs/commands/admin/module_load)\n* [MODULE UNLOAD](https://sugardb.io/docs/commands/admin/module_unload)\n* [REWRITEAOF](https://sugardb.io/docs/commands/admin/rewriteaof)\n* [SAVE](https://sugardb.io/docs/commands/admin/save)\n\n\u003ca name=\"commands-connection\"\u003e\u003c/a\u003e\n## CONNECTION\n* [AUTH](https://sugardb.io/docs/commands/connection/auth)\n* [ECHO](https://sugardb.io/docs/commands/connection/echo)\n* [HELLO](https://sugardb.io/docs/commands/connection/hello)\n* [PING](https://sugardb.io/docs/commands/connection/ping)\n* [SELECT](https://sugardb.io/docs/commands/connection/select)\n* [SWAPDB](https://sugardb.io/docs/commands/connection/swapdb)\n\n\u003ca name=\"commands-generic\"\u003e\u003c/a\u003e\n## GENERIC\n* [COPY](https://sugardb.io/docs/commands/generic/copy)\n* [DBSIZE](https://sugardb.io/docs/commands/generic/dbsize)\n* [DECR](https://sugardb.io/docs/commands/generic/decr)\n* [DECRBY](https://sugardb.io/docs/commands/generic/decrby)\n* [DEL](https://sugardb.io/docs/commands/generic/del)\n* [EXISTS](https://sugardb.io/docs/commands/generic/exists)\n* [EXPIRE](https://sugardb.io/docs/commands/generic/expire)\n* [EXPIRETIME](https://sugardb.io/docs/commands/generic/expiretime)\n* [FLUSHALL](https://sugardb.io/docs/commands/generic/flushall)\n* [FLUSHDB](https://sugardb.io/docs/commands/generic/flushdb)\n* [GET](https://sugardb.io/docs/commands/generic/get)\n* [GETDEL](https://sugardb.io/docs/commands/generic/getdel)\n* [GETEX](https://sugardb.io/docs/commands/generic/get)\n* [INCR](https://sugardb.io/docs/commands/generic/incr)\n* [INCRBY](https://sugardb.io/docs/commands/generic/incrby)\n* [INCRBYFLOAT](https://sugardb.io/docs/commands/generic/incrbyfloat)\n* [KEYS](https://sugardb.io/docs/commands/generic/keys)\n* [MGET](https://sugardb.io/docs/commands/generic/mget)\n* [MOVE](https://sugardb.io/docs/commands/generic/move)\n* [MSET](https://sugardb.io/docs/commands/generic/mset)\n* [OBJECTFREQ](https://sugardb.io/docs/commands/generic/objectfreq)\n* [OBJECTIDLETIME](https://sugardb.io/docs/commands/generic/objectidletime)\n* [PERSIST](https://sugardb.io/docs/commands/generic/persist)\n* [PEXPIRE](https://sugardb.io/docs/commands/generic/pexpire)\n* [PEXPIREAT](https://sugardb.io/docs/commands/generic/pexpireat)\n* [PEXPIRETIME](https://sugardb.io/docs/commands/generic/pexpiretime)\n* [PTTL](https://sugardb.io/docs/commands/generic/pttl)\n* [RANDOMKEY](https://sugardb.io/docs/commands/generic/randomkey)\n* [RENAME](https://sugardb.io/docs/commands/generic/rename)\n* [SET](https://sugardb.io/docs/commands/generic/set)\n* [TTL](https://sugardb.io/docs/commands/generic/ttl)\n* [TYPE](https://sugardb.io/docs/commands/generic/type)\n\n\n\u003ca name=\"commands-hash\"\u003e\u003c/a\u003e\n## HASH\n* [HDEL](https://sugardb.io/docs/commands/hash/hdel)\n* [HEXISTS](https://sugardb.io/docs/commands/hash/hexists)\n* [HEXPIRE](https://sugardb.io/docs/commands/hash/hexpire)\n* [HGET](https://sugardb.io/docs/commands/hash/hget)\n* [HGETALL](https://sugardb.io/docs/commands/hash/hgetall)\n* [HINCRBY](https://sugardb.io/docs/commands/hash/hincrby)\n* [HINCRBYFLOAT](https://sugardb.io/docs/commands/hash/hincrbyfloat)\n* [HKEYS](https://sugardb.io/docs/commands/hash/hkeys)\n* [HLEN](https://sugardb.io/docs/commands/hash/hlen)\n* [HMGET](https://sugardb.io/docs/commands/hash/hmget)\n* [HRANDFIELD](https://sugardb.io/docs/commands/hash/hrandfield)\n* [HSET](https://sugardb.io/docs/commands/hash/hset)\n* [HSETNX](https://sugardb.io/docs/commands/hash/hsetnx)\n* [HSTRLEN](https://sugardb.io/docs/commands/hash/hstrlen)\n* [HTTL](https://sugardb.io/docs/commands/hash/httl)\n* [HVALS](https://sugardb.io/docs/commands/hash/hvals)\n\n\u003ca name=\"commands-list\"\u003e\u003c/a\u003e\n## LIST\n* [LINDEX](https://sugardb.io/docs/commands/list/lindex)\n* [LLEN](https://sugardb.io/docs/commands/list/llen)\n* [LMOVE](https://sugardb.io/docs/commands/list/lmove)\n* [LPOP](https://sugardb.io/docs/commands/list/lpop)\n* [LPUSH](https://sugardb.io/docs/commands/list/lpush)\n* [LPUSHX](https://sugardb.io/docs/commands/list/lpushx)\n* [LRANGE](https://sugardb.io/docs/commands/list/lrange)\n* [LREM](https://sugardb.io/docs/commands/list/lrem)\n* [LSET](https://sugardb.io/docs/commands/list/lset)\n* [LTRIM](https://sugardb.io/docs/commands/list/ltrim)\n* [RPOP](https://sugardb.io/docs/commands/list/rpop)\n* [RPUSH](https://sugardb.io/docs/commands/list/rpush)\n* [RPUSHX](https://sugardb.io/docs/commands/list/rpushx)\n\n\u003ca name=\"commands-pubsub\"\u003e\u003c/a\u003e\n## PUBSUB\n* [PSUBSCRIBE](https://sugardb.io/docs/commands/pubsub/psubscribe)\n* [PUBLISH](https://sugardb.io/docs/commands/pubsub/publish)\n* [PUBSUB CHANNELS](https://sugardb.io/docs/commands/pubsub/pubsub_channels)\n* [PUBSUB NUMPAT](https://sugardb.io/docs/commands/pubsub/pubsub_numpat)\n* [PUBSUB NUMSUB](https://sugardb.io/docs/commands/pubsub/pubsub_numsub)\n* [PUNSUBSCRIBE](https://sugardb.io/docs/commands/pubsub/punsubscribe)\n* [SUBSCRIBE](https://sugardb.io/docs/commands/pubsub/subscribe)\n* [UNSUBSCRIBE](https://sugardb.io/docs/commands/pubsub/unsubscribe)\n\n\u003ca name=\"commands-set\"\u003e\u003c/a\u003e\n## SET\n* [SADD](https://sugardb.io/docs/commands/set/sadd)\n* [SCARD](https://sugardb.io/docs/commands/set/scard)\n* [SDIFF](https://sugardb.io/docs/commands/set/sdiff)\n* [SDIFFSTORE](https://sugardb.io/docs/commands/set/sdiffstore)\n* [SINTER](https://sugardb.io/docs/commands/set/sinter)\n* [SINTERCARD](https://sugardb.io/docs/commands/set/sintercard)\n* [SINTERSTORE](https://sugardb.io/docs/commands/set/sinterstore)\n* [SISMEMBER](https://sugardb.io/docs/commands/set/sismember)\n* [SMEMBERS](https://sugardb.io/docs/commands/set/smembers)\n* [SMISMEMBER](https://sugardb.io/docs/commands/set/smismember)\n* [SMOVE](https://sugardb.io/docs/commands/set/smove)\n* [SPOP](https://sugardb.io/docs/commands/set/spop)\n* [SRANDMEMBER](https://sugardb.io/docs/commands/set/srandmember)\n* [SREM](https://sugardb.io/docs/commands/set/srem)\n* [SUNION](https://sugardb.io/docs/commands/set/sunion)\n* [SUNIONSTORE](https://sugardb.io/docs/commands/set/sunionstore)\n\n\u003ca name=\"commands-sortedset\"\u003e\u003c/a\u003e\n## SORTED SET\n* [ZADD](https://sugardb.io/docs/commands/sorted_set/zadd)\n* [ZCARD](https://sugardb.io/docs/commands/sorted_set/zcard)\n* [ZCOUNT](https://sugardb.io/docs/commands/sorted_set/zcount)\n* [ZDIFF](https://sugardb.io/docs/commands/sorted_set/zdiff)\n* [ZDIFFSTORE](https://sugardb.io/docs/commands/sorted_set/zdiffstore)\n* [ZINCRBY](https://sugardb.io/docs/commands/sorted_set/zincrby)\n* [ZINTER](https://sugardb.io/docs/commands/sorted_set/zinter)\n* [ZINTERSTORE](https://sugardb.io/docs/commands/sorted_set/zinterstore)\n* [ZLEXCOUNT](https://sugardb.io/docs/commands/sorted_set/zlexcount)\n* [ZMPOP](https://sugardb.io/docs/commands/sorted_set/zmpop)\n* [ZMSCORE](https://sugardb.io/docs/commands/sorted_set/zmscore)\n* [ZPOPMAX](https://sugardb.io/docs/commands/sorted_set/zpopmax)\n* [ZPOPMIN](https://sugardb.io/docs/commands/sorted_set/zpopmin)\n* [ZRANDMEMBER](https://sugardb.io/docs/commands/sorted_set/zrandmember)\n* [ZRANGE](https://sugardb.io/docs/commands/sorted_set/zrange)\n* [ZRANGESTORE](https://sugardb.io/docs/commands/sorted_set/zrangestore)\n* [ZRANK](https://sugardb.io/docs/commands/sorted_set/zrank)\n* [ZREM](https://sugardb.io/docs/commands/sorted_set/zrem)\n* [ZREMRANGEBYLEX](https://sugardb.io/docs/commands/sorted_set/zremrangebylex)\n* [ZREMRANGEBYRANK](https://sugardb.io/docs/commands/sorted_set/zremrangebyrank)\n* [ZREMRANGEBYSCORE](https://sugardb.io/docs/commands/sorted_set/zremrangebyscore)\n* [ZREVRANK](https://sugardb.io/docs/commands/sorted_set/zrevrank)\n* [ZSCORE](https://sugardb.io/docs/commands/sorted_set/zscore)\n* [ZUNION](https://sugardb.io/docs/commands/sorted_set/zunion)\n* [ZUNIONSTORE](https://sugardb.io/docs/commands/sorted_set/zunionstore)\n\n\u003ca name=\"commands-string\"\u003e\u003c/a\u003e\n## STRING\n* [APPEND](https://sugardb.io/docs/commands/string/append)\n* [GETRANGE](https://sugardb.io/docs/commands/string/getrange)\n* [SETRANGE](https://sugardb.io/docs/commands/string/setrange)\n* [STRLEN](https://sugardb.io/docs/commands/string/strlen)\n* [SUBSTR](https://sugardb.io/docs/commands/string/substr)\n","funding_links":[],"categories":["Go","Database"],"sub_categories":["Caches"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEchoVault%2FSugarDB","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEchoVault%2FSugarDB","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEchoVault%2FSugarDB/lists"}