{"id":28657633,"url":"https://github.com/ksrichard/easyraft","last_synced_at":"2025-10-08T06:03:41.323Z","repository":{"id":57640454,"uuid":"433717999","full_name":"ksrichard/easyraft","owner":"ksrichard","description":"Easy to use Raft library to make your app distributed, highly available and fault-tolerant","archived":false,"fork":false,"pushed_at":"2021-12-03T07:13:18.000Z","size":174,"stargazers_count":68,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-19T04:13:45.528Z","etag":null,"topics":["cluster","discovery","fault-tolerant","high-availability","raft"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ksrichard.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}},"created_at":"2021-12-01T06:59:06.000Z","updated_at":"2024-02-26T15:08:12.000Z","dependencies_parsed_at":"2022-09-05T07:40:34.268Z","dependency_job_id":null,"html_url":"https://github.com/ksrichard/easyraft","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ksrichard/easyraft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksrichard%2Feasyraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksrichard%2Feasyraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksrichard%2Feasyraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksrichard%2Feasyraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksrichard","download_url":"https://codeload.github.com/ksrichard/easyraft/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksrichard%2Feasyraft/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259616402,"owners_count":22884887,"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":["cluster","discovery","fault-tolerant","high-availability","raft"],"created_at":"2025-06-13T09:13:37.284Z","updated_at":"2025-10-08T06:03:36.293Z","avatar_url":"https://github.com/ksrichard.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/ksrichard/easyraft/raw/main/logo.png\" width=\"50%\"\u003e\n\u003c/p\u003e\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/ksrichard/easyraft)](https://goreportcard.com/report/github.com/ksrichard/easyraft)\n[![Go Reference](https://pkg.go.dev/badge/github.com/ksrichard/easyraft.svg)](https://pkg.go.dev/github.com/ksrichard/easyraft)\n[![GitHub go.mod Go version of a Go module](https://img.shields.io/github/go-mod/go-version/ksrichard/easyraft.svg)](https://github.com/ksrichard/easyraft)\n[![GitHub release](https://img.shields.io/github/release/ksrichard/easyraft.svg)](https://github.com/ksrichard/easyraft/releases/latest/)\n\nAn easy to use customizable library to make your Go application Distributed, Highly available, Fault Tolerant etc...\nusing Hashicorp's [Raft](https://github.com/hashicorp/raft) library which implements the\n[Raft Consensus Algorithm](https://raft.github.io/).\n\nFeatures\n---\n\n- **Configure and start** a fully functional Raft node by writing ~10 lines of code\n- **Automatic Node discovery** (nodes are discovering each other using Discovery method)\n    1. **Built-in discovery methods**:\n        1. **Static Discovery** (having a fixed list of nodes addresses)\n        2. **mDNS Discovery** for local network node discovery\n        3. **Kubernetes discovery**\n- **Cloud Native** because of kubernetes discovery and easy to load balance features\n- **Automatic forward to leader** - you can contact any node to perform operations, everything will be forwarded to the\n  actual leader node\n- **Node monitoring/removal** - the nodes are monitoring each other and if there are some failures then the offline\n  nodes get removed automatically from cluster\n- **Simplified state machine** - there is an already implemented generic state machine which handles the basic\n  operations and routes requests to State Machine Services (see **Examples**)\n- **All layers are customizable** - you can select or implement your own **State Machine Service, Message Serializer**\n  and **Discovery Method**\n- **gRPC transport layer** - the internal communications are done through gRPC based communication, if needed you can\n  add your own services\n\n**Note:** snapshots are not supported at the moment, will be handled at later point\n**Note:** at the moment the communication between nodes are insecure, I recommend to not expose that port\n\nGet Started\n---\nYou can create a simple EasyRaft Node with local mDNS discovery, an in-memory Map service and MsgPack as serializer(this\nis the only one built-in at the moment)\n\n```go\nimport (\n\"github.com/ksrichard/easyraft\"\n\"github.com/ksrichard/easyraft/discovery\"\n\"github.com/ksrichard/easyraft/fsm\"\n\"github.com/ksrichard/easyraft/serializer\"\n)\n\nfunc main() {\n    raftPort := 5000\n    discoveryPort := 5001\n    dataDir := \"s1\"\n    node, err := easyraft.NewNode(\n        raftPort,\n        discoveryPort,\n        dataDir,\n        []fsm.FSMService{fsm.NewInMemoryMapService()},\n        serializer.NewMsgPackSerializer(),\n        discovery.NewMDNSDiscovery(),\n        false,\n    )\n    \n    if err != nil {\n        panic(err)\n    }\n    stoppedCh, err := node.Start()\n    if err != nil {\n        panic(err)\n    }\n    defer node.Stop()\n}\n```\n\nExamples\n---\nExamples can be found in the [examples](https://github.com/ksrichard/easyraft/tree/main/examples/) directory\n\nBuild\n---\nTo regenerate gRPC code and install dependencies simply run `make install`\n\nTODO\n---\n\n- [ ] Add more examples\n- [ ] Test coverage\n- [ ] Secure communication between nodes (SSL/TLS)\n- [ ] Backup/Restore backup handling\n- [ ] Allow configuration option to pass any custom raft.FSM\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksrichard%2Feasyraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksrichard%2Feasyraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksrichard%2Feasyraft/lists"}