{"id":25180361,"url":"https://github.com/rahul07bagul/distributedkeyvaluestore","last_synced_at":"2026-05-02T04:38:29.435Z","repository":{"id":276482974,"uuid":"928580732","full_name":"rahul07bagul/DistributedKeyValueStore","owner":"rahul07bagul","description":"Distributed key–value storage system implemented in C++ using gRPC","archived":false,"fork":false,"pushed_at":"2025-02-08T14:07:34.000Z","size":11530,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T04:46:38.994Z","etag":null,"topics":["consistent-hashing","cpp","distributed-systems","grpc","server"],"latest_commit_sha":null,"homepage":"","language":"C++","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/rahul07bagul.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":"2025-02-06T21:39:36.000Z","updated_at":"2025-02-08T14:10:35.000Z","dependencies_parsed_at":"2025-02-08T15:22:03.706Z","dependency_job_id":"639137c1-e840-4e54-92b9-a13cfc9a25e5","html_url":"https://github.com/rahul07bagul/DistributedKeyValueStore","commit_stats":null,"previous_names":["rahul07bagul/distributedkeyvaluestore"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul07bagul%2FDistributedKeyValueStore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul07bagul%2FDistributedKeyValueStore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul07bagul%2FDistributedKeyValueStore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul07bagul%2FDistributedKeyValueStore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rahul07bagul","download_url":"https://codeload.github.com/rahul07bagul/DistributedKeyValueStore/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247123100,"owners_count":20887260,"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":["consistent-hashing","cpp","distributed-systems","grpc","server"],"created_at":"2025-02-09T16:17:45.096Z","updated_at":"2026-05-02T04:38:29.406Z","avatar_url":"https://github.com/rahul07bagul.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distributed Key-Value Store\n\nDistributedKeyValueStore is a distributed key–value storage system implemented in C++ using gRPC. The project uses consistent hashing for data distribution across nodes and includes heartbeat-based failure detection and a join protocol so that nodes can dynamically update the cluster membership.\n\n## Overview\n\nThis project demonstrates a simple distributed key–value store with the following core features:\n- **Consistent Hashing:**  \n  Keys are mapped to nodes based on a hash ring, ensuring even distribution and minimizing remapping when nodes join or leave.\n- **gRPC-based Communication:**  \n  Nodes communicate using gRPC for operations such as `Put`, `Get`, `Heartbeat`.\n- **Heartbeat Manager:**  \n  Periodic heartbeat messages are sent between nodes to detect failures. When a node failure is detected, the failed node is removed from the hash ring.\n- **Command-line Interactive Interface:**  \n  Each node can accept commands (like `put` and `get`) via an interactive command loop.\n- Current architecture does not support replication, if one node fails then no way to restore those keys from that node.\n- Current architecture does not support if node fails and restarts again then other nodes won't know that new node is added.\n\n## Demo\n![demo](https://github.com/rahul07bagul/DistributedKeyValueStore/blob/main/demo.png)\n\n## Design\n![Design](https://github.com/rahul07bagul/DistributedKeyValueStore/blob/main/design.png)\n\n## Prerequisites\n\n- **C++ Compiler:**  \n  A modern C++ compiler that supports C++11 or later.\n- **gRPC \u0026 Protocol Buffers:**  \n  Install gRPC and Protocol Buffers. For Windows, you can use vcpkg:\n  ```bash\n  vcpkg install grpc protobuf\n  ```\n- CMake: To configure and build the project.\n\n## Installation and Build\n- Download vcpkg\n```shell\ngit clone https://github.com/Microsoft/vcpkg.git\ncd vcpkg\n.\\bootstrap-vcpkg.bat\n```\n\n- Install gRPC and protobuf\n```shell\n.\\vcpkg install grpc:x64-windows\n.\\vcpkg install protobuf:x64-windows\n.\\vcpkg integrate install\n```\n\n- Compile proto file\n```shell\n\u0026 \"\u003cyour_path\u003e\\DistributedKeyValueStore\\vcpkg\\installed\\x64-windows\\tools\\protobuf\\protoc.exe\" -I=network --cpp_out=network network/rpc_service.proto\n\u0026 \"\u003cyour_path\u003e\\DistributedKeyValueStore\\vcpkg\\installed\\x64-windows\\tools\\protobuf\\protoc.exe\" `\n    -I=network `\n    --grpc_out=network `\n    --plugin=protoc-gen-grpc=\"\u003cyour_path\u003e\\vcpkg\\installed\\x64-windows\\tools\\grpc\\grpc_cpp_plugin.exe\" `\n    network\\rpc_service.proto \n```\n\n- Using powershell7: it will create .exe file in build/Release folder\n```shell\ncmake -B build -S . -DCMAKE_BUILD_TYPE=Release\nOR\ncmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=\"\u003cyour_path\u003e/DistributedKeyValueStore/vcpkg/scripts/buildsystems/vcpkg.cmake\"\ncmake --build build --config Release\n```\n\n- Run the code from root, each command in separate terminal (three servers)\n```shell\n.\\build\\Release\\distributed_kv_store.exe --node-id=node1 --address=127.0.0.1:50051 --peers=node2:127.0.0.1:50052,node3:127.0.0.1:50053\n.\\build\\Release\\distributed_kv_store.exe --node-id=node2 --address=127.0.0.1:50052 --peers=node1:127.0.0.1:50051,node3:127.0.0.1:50053\n.\\build\\Release\\distributed_kv_store.exe --node-id=node3 --address=127.0.0.1:50053 --peers=node1:127.0.0.1:50051,node2:127.0.0.1:50052\n```\n\n- Test\n  - From Node1:\n    ```shell\n     put foo bar\n    ```\n  - From Node2:\n    ```shell\n    get foo\n    ```\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahul07bagul%2Fdistributedkeyvaluestore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahul07bagul%2Fdistributedkeyvaluestore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahul07bagul%2Fdistributedkeyvaluestore/lists"}