{"id":17644693,"url":"https://github.com/keisku/raftkv","last_synced_at":"2025-03-10T17:30:56.464Z","repository":{"id":65498421,"uuid":"433713818","full_name":"keisku/raftkv","owner":"keisku","description":"A simple distributed key-value store by using hashicorp/raft","archived":true,"fork":false,"pushed_at":"2022-02-07T23:13:37.000Z","size":83,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T20:31:14.478Z","etag":null,"topics":["go","golang","grpc","grpc-gateway","hashicorp","hashicorp-raft","raft","raft-algorithm","raft-example"],"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/keisku.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":"2021-12-01T06:43:25.000Z","updated_at":"2024-12-20T02:53:43.000Z","dependencies_parsed_at":"2023-01-26T04:25:11.025Z","dependency_job_id":null,"html_url":"https://github.com/keisku/raftkv","commit_stats":null,"previous_names":["kei6u/raftkv"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keisku%2Fraftkv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keisku%2Fraftkv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keisku%2Fraftkv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keisku%2Fraftkv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keisku","download_url":"https://codeload.github.com/keisku/raftkv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242892625,"owners_count":20202567,"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":["go","golang","grpc","grpc-gateway","hashicorp","hashicorp-raft","raft","raft-algorithm","raft-example"],"created_at":"2024-10-23T10:39:38.157Z","updated_at":"2025-03-10T17:30:55.980Z","avatar_url":"https://github.com/keisku.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# raftkv\n\nThis repository holds a simple leader-followers key-value store by using [hashicorp/raft](https://github.com/hashicorp/raft).\n`raftkv` provides gRPC and HTTP APIs. Please take a look [API Reference](./proto/v1/README.md).\n\n## Usage\n\n### Run containers\n\n```shell\ndocker compose up\n```\n\n### Validation\n\nSet a key-value to a leader.\n\n```shell\ncurl -XPOST 'localhost:50002/v1/set' \\\n--data-raw '{\n    \"key\": \"programming_language\",\n    \"value\": \"golang\"\n}'\n```\n\nGet a value from a follower.\nYou will get \"golang\" from followers. It means a leader propagates the value to followers.\n\n```shell\ncurl -XGET 'localhost:50102/v1/get/programming_language'\ncurl -XGET 'localhost:50202/v1/get/programming_language'\n```\n\nDelete a key-value.\nYou will get \"not found\" errors from followers.\n\n```shell\ncurl -XDELETE 'localhost:50002/v1/delete/programming_language'\n```\n\n```shell\ncurl -XGET 'localhost:50102/v1/get/programming_language'\ncurl -XGET 'localhost:50202/v1/get/programming_language'\n```\n\n```json\n{\"code\":5, \"message\":\"not found\", \"details\":[]}\n{\"code\":5, \"message\":\"not found\", \"details\":[]}\n```\n\nIf you try to set or delete a key-value to a follower, you will get an error.\n`localhost:50102` is an address for a follower at this time and you can replace it with `localhost:50201` too.\n\nSee the [docker-compose.yaml](./docker-compose.yaml) in detail.\n\n```shell\ncurl -XPOST 'localhost:50102/v1/set' \\\n--data-raw '{\n    \"key\": \"programming_language\",\n    \"value\": \"golang\"\n}'\ncurl -XDELETE 'localhost:50102/v1/delete/programming_language'\n```\n\n```json\n{\"code\":13, \"message\":\"non-leader can't set key=programming_language, value=golang\", \"details\":[]}\n{\"code\":13, \"message\":\"non-leader can't delete a value associated to programming_language\", \"details\":[]}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeisku%2Fraftkv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeisku%2Fraftkv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeisku%2Fraftkv/lists"}