{"id":28228598,"url":"https://github.com/akhilk2802/distributed-key-value-store","last_synced_at":"2025-06-13T01:31:12.173Z","repository":{"id":246529723,"uuid":"818744800","full_name":"akhilk2802/distributed-key-value-store","owner":"akhilk2802","description":"SImple Key Value Store","archived":false,"fork":false,"pushed_at":"2025-02-10T03:03:22.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T15:12:45.545Z","etag":null,"topics":["consensus-algorithm","fault-tolerance","go","golang","key-value","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akhilk2802.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-06-22T18:28:25.000Z","updated_at":"2025-02-10T03:03:26.000Z","dependencies_parsed_at":"2024-06-28T14:18:17.286Z","dependency_job_id":"d9fca0d3-d69d-4736-82c1-fb479145001d","html_url":"https://github.com/akhilk2802/distributed-key-value-store","commit_stats":null,"previous_names":["akhilk2802/distributed-key-value-store"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akhilk2802/distributed-key-value-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhilk2802%2Fdistributed-key-value-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhilk2802%2Fdistributed-key-value-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhilk2802%2Fdistributed-key-value-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhilk2802%2Fdistributed-key-value-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akhilk2802","download_url":"https://codeload.github.com/akhilk2802/distributed-key-value-store/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhilk2802%2Fdistributed-key-value-store/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259561596,"owners_count":22876839,"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":["consensus-algorithm","fault-tolerance","go","golang","key-value","rest-api"],"created_at":"2025-05-18T15:12:45.773Z","updated_at":"2025-06-13T01:31:12.147Z","avatar_url":"https://github.com/akhilk2802.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distributed Key-Value Store\n\n## 📌 Overview\nThis project is a **distributed key-value store** implemented in **Go**, utilizing the **HashiCorp Memberlist library** for **cluster membership and data replication**. Designed to be **fault-tolerant, highly available, and consistent**, this system ensures **efficient key-value storage** across multiple nodes in a distributed environment.\n\n---\n\n*Implemented on local machine, on multiple threads*\n\n## 🚀 Features\n- **⚡ Distributed Architecture**: Supports clustering of multiple nodes.\n- **📡 Data Replication**: Ensures consistency across nodes using HashiCorp Memberlist.\n- **🔄 Fault Tolerance \u0026 High Availability**: Handles node failures gracefully.\n- **🌍 RESTful API**: Provides an easy-to-use interface for interaction.\n\n---\n\n## 🏗️ Architecture\nThe system consists of the following core components:\n\n1️⃣ **Cluster**: Manages **node membership** and inter-node communication.\n\n2️⃣ **Key-Value Store**: Provides **thread-safe operations** and integrates with the cluster for data replication.\n\n3️⃣ **API**: Exposes **RESTful endpoints** for external clients to interact with the key-value store.\n\n---\n\n## Folder Structure \n```plaintext\n.\n├── README.md\n├── api\n│   └── api.go\n├── cluster\n│   └── cluster.go\n├── go.mod\n├── go.sum\n├── main.go\n└── store\n    └── store.go\n\n```\n\n---\n\n## 🚀 Usage\n\n### **Starting the Server**\nTo start a node in the distributed key-value store:\n```sh\ngo run main.go\n```\nYou can launch multiple nodes either:\n- On **different machines**.\n- On the **same machine** using different ports (modify the `Addr` field in `main.go`).\n\n---\n\n## 🔗 API Endpoints\nThe following API endpoints are available to interact with the key-value store:\n\n### **📌 Store a Key-Value Pair**\n#### **PUT /put**\n**Description**: Stores a key-value pair.\n#### **Request Body**:\n```json\n{\n  \"key\": \"your-key\",\n  \"value\": \"your-value\"\n}\n```\n\n---\n\n### **📌 Retrieve a Value**\n#### **GET /get/key=your-key**\n**Description**: Retrieves the value associated with a given key.\n#### **Query Parameters**:\n- `key`: The key to retrieve.\n\n---\n\n### **📌 Delete a Key-Value Pair**\n#### **DELETE /delete?key=your-key**\n**Description**: Deletes the specified key-value pair.\n#### **Query Parameters**:\n- `key`: The key to delete.\n\n---\n\n### **📌 Store a Key-Value Pair via URL Parameters**\n#### **POST /set/{key}/{value}**\n**Description**: Stores a key-value pair using URL parameters.\n#### **URL Parameters**:\n- `key`: The key to store.\n- `value`: The corresponding value.\n\n---\n\n## 🔄 Data Replication\n**Replication** is achieved using the **HashiCorp Memberlist library**, ensuring consistency across all nodes in the distributed store. \n\n### **🔍 How Data Replication Works**\n1️⃣ **Cluster Initialization**: Each node initializes a `Cluster` instance with a unique name and address.\n\n2️⃣ **Joining the Cluster**: Nodes can join an existing cluster by specifying the addresses of existing nodes.\n\n3️⃣ **Broadcasting Updates**: Any changes (create/update/delete) to a key-value pair are serialized and broadcast across all nodes.\n\n4️⃣ **Handling Incoming Messages**: Each node listens for incoming updates and synchronizes its local key-value store accordingly.\n\n---\n🚀 **Distributed Key-Value Store - Scalable, Fault-Tolerant, and Highly Available!**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhilk2802%2Fdistributed-key-value-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakhilk2802%2Fdistributed-key-value-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhilk2802%2Fdistributed-key-value-store/lists"}