{"id":17910103,"url":"https://github.com/austingebauer/raft-kv-db","last_synced_at":"2025-07-27T06:33:28.621Z","repository":{"id":117860717,"uuid":"438081573","full_name":"austingebauer/raft-kv-db","owner":"austingebauer","description":"A distributed key-value store using Raft","archived":false,"fork":false,"pushed_at":"2021-12-16T08:12:07.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T06:48:17.297Z","etag":null,"topics":[],"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/austingebauer.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-14T01:45:23.000Z","updated_at":"2022-04-20T19:04:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d560cca-a66a-489a-b1f5-e54b11220ad6","html_url":"https://github.com/austingebauer/raft-kv-db","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/austingebauer/raft-kv-db","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fraft-kv-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fraft-kv-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fraft-kv-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fraft-kv-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austingebauer","download_url":"https://codeload.github.com/austingebauer/raft-kv-db/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fraft-kv-db/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265096357,"owners_count":23710772,"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":[],"created_at":"2024-10-28T19:29:11.660Z","updated_at":"2025-07-27T06:33:28.575Z","avatar_url":"https://github.com/austingebauer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# raft-kv-db\n\nA distributed key-value store that uses the [Raft Consensus Algorithm](https://raft.github.io/raft.pdf)\nfor data replication.\n\n## Build\n\nPrerequisites:\n- [Go](https://go.dev/) 1.15.0+\n- Make\n\nRunning the following command to build a binary for your platform. The `raft-kv-db` binary will \nbe placed in the `bin` directory.\n\n```\nmake build\n```\n\n## Configuration\n\n### CLI Usage\n\n```\n$ raft-kv-db -h\n    Usage of ./bin/raft-kv-db:\n      -api-addr string\n            Listen address for key/value API requests (default \"127.0.0.1:8501\")\n      -id uint\n            ID to assign to this peer (default 1)\n      -peer-list string\n            List of raft peers in the form \u003cpeer_1_id\u003e=\u003cpeer_1_url\u003e,\u003cpeer_2_id\u003e=\u003cpeer_2_url\u003e (default \"1=http://127.0.0.1:8601,2=http://127.0.0.1:8602\")\n      -raft-addr string\n            Listen address for Raft peer connections (default \"127.0.0.1:8601\")\n      -storage-file string\n            File to store the Raft log in. Will be created if it doesn't exist.\n```\n\n### Example\n\n```\n./bin/raft-kv-db \\\n        -id 1 \\\n        -api-addr \"127.0.0.1:8501\" \\\n        -raft-addr \"127.0.0.1:8601\" \\\n        -peer-list \"2=http://127.0.0.1:8602,3=http://127.0.0.1:8603\"\n\n./bin/raft-kv-db \\\n        -id 2 \\\n        -api-addr \"127.0.0.1:8502\" \\\n        -raft-addr \"127.0.0.1:8602\" \\\n        -peer-list \"1=http://127.0.0.1:8601,3=http://127.0.0.1:8603\"\n\n./bin/raft-kv-db \\\n        -id 3 \\\n        -api-addr \"127.0.0.1:8503\" \\\n        -raft-addr \"127.0.0.1:8603\" \\\n        -peer-list \"1=http://127.0.0.1:8601,2=http://127.0.0.1:8602\"\n```\n\n## Usage\n\n### Key-Value API\n\n#### Put\n\n- **Path**: `/kvdb/{key_name}`\n- **Method**: `PUT`\n- **Body**: `JSON string`\n\n#### Get\n\n- **Path**: `/kvdb/{key_name}`\n- **Method**: `GET`\n\n#### Delete\n\n- **Path**: `/kvdb/{key_name}`\n- **Method**: `DELETE`\n\n### Example\n\n```\n# Put k/v pairs into the distributed store\n$ curl -X PUT -d '{\"name\": \"uw\"}' http://127.0.0.1:8501/kvdb/university\n$ curl -X PUT -d '{\"course\": \"cse550\"}' http://127.0.0.1:8501/kvdb/cse\n\n# Get k/v pairs from each peer\n$ curl http://127.0.0.1:8501/kvdb/university\n$ curl http://127.0.0.1:8502/kvdb/university\n$ curl http://127.0.0.1:8503/kvdb/university\n$ curl http://127.0.0.1:8501/kvdb/cse\n$ curl http://127.0.0.1:8502/kvdb/cse\n$ curl http://127.0.0.1:8503/kvdb/cse\n\n# Delete k/v pairs from peers\n$ curl -X DELETE http://127.0.0.1:8502/kvdb/cse\n$ curl -X DELETE http://127.0.0.1:8501/kvdb/university\n\n# Get k/v pairs from each peer to show deleted\n$ curl http://127.0.0.1:8501/kvdb/university\n$ curl http://127.0.0.1:8502/kvdb/university\n$ curl http://127.0.0.1:8503/kvdb/university\n$ curl http://127.0.0.1:8501/kvdb/cse\n$ curl http://127.0.0.1:8502/kvdb/cse\n$ curl http://127.0.0.1:8503/kvdb/cse\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustingebauer%2Fraft-kv-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faustingebauer%2Fraft-kv-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustingebauer%2Fraft-kv-db/lists"}