{"id":13850328,"url":"https://github.com/namreg/godown","last_synced_at":"2026-03-05T23:59:39.784Z","repository":{"id":53094740,"uuid":"133915431","full_name":"namreg/godown","owner":"namreg","description":"Distributed, fault-tolerant key-value storage written in go.","archived":false,"fork":false,"pushed_at":"2018-12-05T07:44:28.000Z","size":3481,"stargazers_count":364,"open_issues_count":4,"forks_count":26,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-11-22T03:32:26.410Z","etag":null,"topics":["distributed","go","key-value","raft"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/namreg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-18T06:55:06.000Z","updated_at":"2024-07-09T09:50:47.000Z","dependencies_parsed_at":"2022-08-23T21:40:43.640Z","dependency_job_id":null,"html_url":"https://github.com/namreg/godown","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/namreg/godown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namreg%2Fgodown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namreg%2Fgodown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namreg%2Fgodown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namreg%2Fgodown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/namreg","download_url":"https://codeload.github.com/namreg/godown/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namreg%2Fgodown/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30156253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"ssl_error","status_checked_at":"2026-03-05T22:39:24.771Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["distributed","go","key-value","raft"],"created_at":"2024-08-04T20:01:06.269Z","updated_at":"2026-03-05T23:59:39.743Z","avatar_url":"https://github.com/namreg.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"## Godown\n\n[![Build Status](https://www.travis-ci.org/namreg/godown.svg?branch=master)](https://www.travis-ci.org/namreg/godown)\n[![Go Report Card](https://goreportcard.com/badge/github.com/namreg/godown)](https://goreportcard.com/report/github.com/namreg/godown)\n[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/namreg/godown/blob/master/LICENSE)\n[![codecov](https://codecov.io/gh/namreg/godown/branch/master/graph/badge.svg)](https://codecov.io/gh/namreg/godown)\n\nA simple, distributed, fault-tolerant key-value storage inspired by Redis. It uses [Raft](https://raft.github.io) protocotol as consensus algorithm.\nIt supports the following data structures: `String`, `Bitmap`, `Map`, `List`.\n\n[![asciicast](https://asciinema.org/a/lNp3lOJlnnp9WQW3kKnguL35e.png)](https://asciinema.org/a/lNp3lOJlnnp9WQW3kKnguL35e)\n\n### How to install\n\n#### Install via binaries\nYou can find binaries on the [Github releases page](https://github.com/namreg/godown/releases).\n```bash\n/application/godown/godown-server -dir=/application/godown/data01 -id=01 -listen=127.0.0.1:14001 -raft=127.0.0.1:24001\n/application/godown/godown-server -dir=/application/godown/data02 -id=02 -listen=127.0.0.1:14002 -raft=127.0.0.1:24002 -join=127.0.0.1:14001\n/application/godown/godown-server -dir=/application/godown/data03 -id=03 -listen=127.0.0.1:14003 -raft=127.0.0.1:24003 -join=127.0.0.1:14001\n```\n\n\n\n#### Install via docker\n```bash\n# creating a network\ndocker network create godown \n\n# creating a volume\ndocker volume create godown \n\n# bootstrap a cluster with a single node\ndocker run -it --rm -v godown:/var/lib/godown --name=godown_1 --net=godown -p 5000:5000 \\\n    namreg/godown-server -id 1 -listen godown_1:5000 -raft godown_1:6000\n\n# join the second node to the cluster\ndocker run -it --rm -v godown:/var/lib/godown --name=godown_2 --net=godown -p 5001:5001 \\\n    namreg/godown-server -id 2 -listen godown_2:5001 -join godown_1:5000 -raft godown_2:6001\n\n# join the third node to the cluster\ndocker run -it --rm -v godown:/var/lib/godown --name=godown_3 --net=godown -p 5002:5002  \\\n    namreg/godown-server -id 3 -listen godown_3:5001 -join godown_1:5000 -raft godown_3:6002\n```\n\nAvailable options to run a server:\n```bash\n  -dir string\n        Directory where data is stored.\n  -gc duration\n        Garbage collector interval.\n  -id string\n        Server unique id.\n  -join string\n        Server address to join.\n  -listen string\n        Server address to listen.\n  -raft string\n        Raft protocol listen address.\n  -resp string\n        Redis Serialization Protocol listen address.      \n  -version\n        Show version.\n```\n\n### How to connect\n\nYou can connect to any godown node. All modifications will be replicated to all nodes.\n\n#### Connect via any redis client\nIf you have specified `resp` address while starting a node, you can connect to the one by any redis client.\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"time\"\n\n\t\"github.com/garyburd/redigo/redis\"\n)\n\nconst connectionTimeout = 100 * time.Millisecond\n\nfunc main() {\n\tconn, err := net.Dial(\"tcp\", \"6380\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\trconn := redis.NewConn(conn, connectionTimeout, connectionTimeout)\n\n\treply, err := rconn.Do(\"LRANGE\", \"list\", 0, 100)\n\tvals, err := redis.Strings(reply, err)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(vals)\n}\n\n```\n\n#### Connect via CLI\n```bash\ngodown-cli\n```\n\nAvailable options:\n```bash\n  -host string\n    \tHost to connect to a server (default \"127.0.0.1\")\n  -port string\n    \tPort to connect to a server (default \"4000\")\n  -version\n    \tShow godown version.\n```\n\nSupported commands:\n\n| Command| Description |\n|---|---|\n| HELP\u0026nbsp;command | Show the usage of the given command. |\n| TYPE\u0026nbsp;key | Returns the type stored at key. |\n| KEYS\u0026nbsp;pattern | Find all keys matching the given pattern. |\n| PING\u0026nbsp;[message] | Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk. |\n| EXPIRE\u0026nbsp;key\u0026nbsp;seconds | Set a timeout on key. After the timeout has expired, the key will automatically be deleted. |\n| TTL\u0026nbsp;key | Returns the remaining time to live of a key. -1 returns if key does not have timeout. |\n|---|---|---|\n| SET\u0026nbsp;key\u0026nbsp;value | Set key to hold the string value. If key already holds a value, it is overwritten. |\n| GET\u0026nbsp;key | Get the value by key. If provided key does not exist NIL will be returned. |\n| STRLEN\u0026nbsp;key | Returns length of the given key. If key does not exists, 0 will be returned. |\n| DEL\u0026nbsp;key | Delete the given key. |\n|---|---|---|\n| SETBIT\u0026nbsp;key\u0026nbsp;offset\u0026nbsp;value | Sets or clears the bit at offset in the string value stored at key. |\n| GETBIT\u0026nbsp;key\u0026nbsp;offset | Returns the bit value at offset in the string value stored at key. |\n|---|---|---|\n| LPUSH\u0026nbsp;key\u0026nbsp;value\u0026nbsp;[value\u0026nbsp;...] | Prepend one or multiple values to a list. |\n| LPOP\u0026nbsp;key | Removes and returns the first element of the list stored at key. |\n| RPUSH\u0026nbsp;key\u0026nbsp;value\u0026nbsp;[value\u0026nbsp;...] | Append one or multiple values to a list. |\n| RPOP\u0026nbsp;key | Removes and returns the last element of the list stored at key. |\n| LLEN\u0026nbsp;key | Returns the length of the list stored at key. If key does not exist, it is interpreted as an empty list and 0 is returned. |\n| LINDEX\u0026nbsp;key\u0026nbsp;index | Returns the element at index index in the list stored at key. \u003cbr\u003eThe index is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. |\n| LRANGE\u0026nbsp;key\u0026nbsp;start\u0026nbsp;stop | Returns the specified elements of the list stored at key.\u003cbr\u003e The offsets start and stop are zero-based indexes, with 0 being the first element of the list (the head of the list), 1 being the next element and so on. |\n| LREM\u0026nbsp;key\u0026nbsp;value | Removes all occurrences of elements equal to value from the list stored at key. |\n|---|---|---|\n| HSET\u0026nbsp;key\u0026nbsp;field\u0026nbsp;value | Sets field in the hash stored at key to value. |\n| HGET\u0026nbsp;key\u0026nbsp;field | Returns the value associated with field in the hash stored at key. |\n| HKEYS\u0026nbsp;key | Returns all field names in the hash stored at key. Order of fields is not guaranteed. |\n| HVALS\u0026nbsp;key | Returns all values in the hash stored at key. |\n| HDEL\u0026nbsp;key\u0026nbsp;field\u0026nbsp;[field\u0026nbsp;...] | Removes the specified fields from the hash stored at key. Returns the number of fields that were removed. |\n\n#### Connect via go client\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/namreg/godown/client\"\n)\n\nfunc main() {\n\tc, err := client.New(\"127.0.0.1:4000\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer c.Close()\n\n\tres := c.Get(\"key\")\n\tif res.Err() != nil {\n\t\tpanic(res.Err())\n\t}\n\n\tif res.IsNil() {\n\t\tfmt.Print(\"key does not exist\")\n\t} else {\n\t\tfmt.Println(res.Int64())\n\t}\n}\n```\nClient documentation available at [godoc](https://godoc.org/github.com/namreg/godown/client)\n\n### TODO\n- [ ] Write more docs\n- [ ] Write more tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamreg%2Fgodown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamreg%2Fgodown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamreg%2Fgodown/lists"}