{"id":15914521,"url":"https://github.com/bbengfort/raft","last_synced_at":"2025-03-17T21:31:39.133Z","repository":{"id":57552655,"uuid":"138040220","full_name":"bbengfort/raft","owner":"bbengfort","description":"Actor based implementation of the Raft consensus algorithm","archived":false,"fork":false,"pushed_at":"2022-11-10T17:58:17.000Z","size":6248,"stargazers_count":2,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T04:58:25.028Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/bbengfort.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-20T13:58:30.000Z","updated_at":"2022-11-07T09:21:28.000Z","dependencies_parsed_at":"2022-09-26T18:50:48.365Z","dependency_job_id":null,"html_url":"https://github.com/bbengfort/raft","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbengfort","download_url":"https://codeload.github.com/bbengfort/raft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243886014,"owners_count":20363649,"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-06T17:03:57.783Z","updated_at":"2025-03-17T21:31:38.676Z","avatar_url":"https://github.com/bbengfort.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raft\n\n[![Build Status](https://github.com/bbengfort/raft/actions/workflows/test.yaml/badge.svg?branch=main)](https://github.com/bbengfort/raft/actions/workflows/test.yaml)\n[![GoDoc](https://godoc.org/github.com/bbengfort/raft?status.svg)](https://pkg.go.dev/github.com/bbengfort/raft)\n\n**Actor based implementation of the [Raft consensus algorithm](https://raft.github.io/)**.\n\n## Quick Start\n\nTo install this implementation of Raft on a system:\n\n```\n$ go get github.com/bbengfort/raft/...\n```\n\nThis should install the `raft` command on your system. Create a configuration file that defines the peers for the network and other parameters as follows:\n\n```json\n{\n  \"tick\": \"300ms\",\n  \"timeout\": \"100ms\",\n  \"aggregate\": true,\n  \"log_level\": 5,\n  \"peers\": [\n    {\n      \"pid\": 1,\n      \"name\": \"alpha\",\n      \"ip_address\": \"127.0.0.1\",\n      \"domain\": \"localhost\",\n      \"port\": 3264\n    },\n    {\n      \"pid\": 2,\n      \"name\": \"bravo\",\n      \"ip_address\": \"127.0.0.1\",\n      \"domain\": \"localhost\",\n      \"port\": 3265\n    },\n    {\n      \"pid\": 3,\n      \"name\": \"charlie\",\n      \"ip_address\": \"127.0.0.1\",\n      \"domain\": \"localhost\",\n      \"port\": 3266\n    }\n  ]\n}\n```\n\nThe configuration file can be stored as a `.toml`, `.json`, `.yml`, `.yaml` file in the following locations:\n\n- `/etc/raft.json`\n- `~/.raft.json`\n- `$(pwd)/raft.json`\n\nOr the path to the configuration file can be passed to the command at runtime. To run a raft replica process:\n\n```\n$ raft serve -n alpha\n```\n\nThe `-n` command specifies which peer configures the local replica, by default if no name is specified, then the hostname of the machine is used. To commit a command to the Raft log:\n\n```\n$ raft commit -k \"key\" -v \"value\"\n```\n\nThis commits the command named \"key\" with the specified \"value\" to the log. Note that the client is automatically redirected to the leader and requires the same configuration to connect.\n\n## Docker Compose\n\nTo run Raft nodes with Docker compose, use the following commands:\n\n```\n$ export GIT_REVISION=$(git rev-parse --short HEAD)\n$ docker compose build\n$ docker compose up\n```\n\n## Benchmarks\n\nThe following benchmark is run on a MacBook Pro with 16GB RAM and an 3.1 GHz Intel Core i7 quad core processor. The cluster is composed of three Raft processes, with another process running concurrent client queries for a fixed duration.\n\n![Benchmark](fixtures/benchmark.png)\n\nNote that because these benchmarks are run on a single machine, there is no network latency between requests.\n\n- Version 0.1: gRPC unary rpc\n- Version 0.2: gRPC bidirectional streaming for AppendEntries\n- Version 0.3: experimental design and setup (not benchmarked)\n- Version 0.4: aggregate append entries from clients\n\nThe following benchmark shows the performance of the latest version of Raft on a cluster of three and five `t2.medium` instances running in a single AWS region.\n\n![Benchmark](fixtures/quorum-benchmark.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbengfort%2Fraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbengfort%2Fraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbengfort%2Fraft/lists"}