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.
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
- Go 1.25.5 or higher
- Make (for building)
make build# Start a 3-node cluster
make run-clusterThis 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
# 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/statusFor detailed information about the project architecture, configuration, and usage, please refer to the documentation in the docs/ directory:
- Documentation Index - Complete documentation overview
- Architecture - Detailed system architecture and components
- Diagrams - Visual architecture representations
- Raft Consensus - How Raft consensus is implemented in Chorus