Skip to content

ssubedir/chorus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chorus - Distributed Key-Value Store

Chorus is a distributed key-value store built with Go that implements the Raft consensus algorithm to ensure data consistency and high availability across a cluster of nodes.

Overview

Chorus provides a simple yet powerful distributed database solution with the following key features:

  • Raft Consensus: Implements the Raft algorithm for distributed consensus, ensuring strong consistency
  • High Availability: Cluster can tolerate node failures while maintaining service availability
  • HTTP API: RESTful API for key-value operations and cluster management
  • Automatic Leader Election: Built-in leader election and failover mechanisms
  • Snapshotting: Periodic snapshots for efficient log compaction and faster recovery
  • Dynamic Cluster Membership: Support for adding and removing nodes from the cluster

Quick Start

Prerequisites

  • Go 1.25.5 or higher
  • Make (for building)

Building

make build

Running a Cluster

# Start a 3-node cluster
make run-cluster

This will start three nodes with the following configuration:

  • Node 1: HTTP on port 8080, Raft on port 8081
  • Node 2: HTTP on port 8082, Raft on port 8083
  • Node 3: HTTP on port 8084, Raft on port 8085

Basic Usage

# Set a key-value pair
curl -X POST http://localhost:8080/kv -H "Content-Type: application/json" -d '{"key": "mykey", "value": "myvalue"}'

# Get a value
curl http://localhost:8080/kv/mykey

# Get all key-value pairs
curl http://localhost:8080/kv/

# Delete a key
curl -X DELETE http://localhost:8080/kv/mykey

# Check cluster status
curl http://localhost:8080/cluster/status

Documentation

For detailed information about the project architecture, configuration, and usage, please refer to the documentation in the docs/ directory:

About

Simple distributed key-value store written in Go, powered by the Raft consensus algorithm.

Resources

License

Stars

Watchers

Forks

Contributors

Languages