{"id":13458661,"url":"https://github.com/sofastack/sofa-jraft","last_synced_at":"2025-05-14T10:05:10.450Z","repository":{"id":37663108,"uuid":"173721564","full_name":"sofastack/sofa-jraft","owner":"sofastack","description":"A production-grade java implementation of RAFT consensus algorithm.","archived":false,"fork":false,"pushed_at":"2025-02-18T10:29:49.000Z","size":3089,"stargazers_count":3683,"open_issues_count":60,"forks_count":1164,"subscribers_count":124,"default_branch":"master","last_synced_at":"2025-05-04T14:02:04.838Z","etag":null,"topics":["consensus","distributed-consensus-algorithms","java","raft","raft-algorithm","raft-java","sofa-bolt","sofa-jraft","sofastack"],"latest_commit_sha":null,"homepage":"https://www.sofastack.tech/projects/sofa-jraft/","language":"Java","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/sofastack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-04T10:13:43.000Z","updated_at":"2025-05-03T03:48:43.000Z","dependencies_parsed_at":"2023-02-09T09:47:03.652Z","dependency_job_id":"904dfb60-dbd4-41aa-946e-1ba8a265630f","html_url":"https://github.com/sofastack/sofa-jraft","commit_stats":null,"previous_names":["alipay/sofa-jraft"],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-jraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-jraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-jraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-jraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sofastack","download_url":"https://codeload.github.com/sofastack/sofa-jraft/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254119471,"owners_count":22017951,"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","distributed-consensus-algorithms","java","raft","raft-algorithm","raft-java","sofa-bolt","sofa-jraft","sofastack"],"created_at":"2024-07-31T09:00:54.979Z","updated_at":"2025-05-14T10:05:10.370Z","avatar_url":"https://github.com/sofastack.png","language":"Java","readme":"# SOFAJRaft\n\n[![build](https://github.com/sofastack/sofa-jraft/actions/workflows/build.yml/badge.svg)](https://github.com/sofastack/sofa-jraft/actions/workflows/build.yml)\n![License](https://img.shields.io/badge/license-Apache--2.0-green.svg)\n[![Maven Central](https://img.shields.io/maven-central/v/com.alipay.sofa/jraft-parent.svg?label=maven%20central)](https://search.maven.org/search?q=g:com.alipay.sofa%20AND%20sofa-jraft)\n\n[中文](README_zh_CN.md)\n## Overview\nSOFAJRaft is a production-level, high-performance Java implementation based on the [RAFT](https://raft.github.io/) consistency algorithm that supports MULTI-RAFT-GROUP for high-load, low-latency scenarios.\nWith SOFAJRaft you can focus on your business area. SOFAJRaft handles all RAFT-related technical challenges. SOFAJRaft is very user-friendly, which provides several examples, making it easy to understand and use.\n\n## Features\n- Leader election and priority-based semi-deterministic leader election\n- Log replication and recovery\n- Read-only member (learner)\n- Snapshot and log compaction\n- Cluster membership management, adding nodes, removing nodes, replacing nodes, etc.\n- Mechanism of transfer leader for reboot, load balance scene, etc.\n- Symmetric network partition tolerance\n- Asymmetric network partition tolerance\n- Fault tolerance, minority failure doesn't affect the overall availability of system\n- Manual recovery cluster available for majority failure\n- Linearizable read, ReadIndex/LeaseRead\n- Replication pipeline\n- Rich statistics to analyze the performance based on [Metrics](https://metrics.dropwizard.io/4.0.0/getting-started.html)\n- Passed [Jepsen](https://github.com/jepsen-io/jepsen) consistency verification test\n- SOFAJRaft includes an embedded distributed KV storage implementation\n\n## Requirements\nCompile requirement: JDK 8+ and Maven 3.2.5+ .\n\n## Documents\n- [User Guide](https://www.sofastack.tech/projects/sofa-jraft/overview)\n- [Counter Example Details](https://www.sofastack.tech/projects/sofa-jraft/counter-example)\n- [Release Notes](https://www.sofastack.tech/projects/sofa-jraft/release-log)\n\n## Contribution\n[How to contribute](https://www.sofastack.tech/projects/sofa-jraft/how-to-contribute-code-to-sofajraft)\n\n## Acknowledgement\nSOFAJRaft was ported from Baidu's [braft](https://github.com/brpc/braft) with some optimizing and improvement. Thanks to the Baidu braft team for opening up such a great C++ RAFT implementation.\n\n## License\nSOFAJRaft is licensed under the [Apache License 2.0](./LICENSE). SOFAJRaft relies on some third-party components, and their open source protocol is also Apache License 2.0.\nIn addition, SOFAJRaft also directly references some code (possibly with minor changes), which open source protocol is Apache License 2.0, including\n- HashedWheelTimer in [Netty](https://github.com/netty/netty), also referenced Netty's Pipeline design\n- Efficient encoding/decoding of UTF8 String in [Protobuf](https://github.com/protocolbuffers/protobuf)\n\n## Community\nSee our community [materials](https://github.com/sofastack/community/blob/master/ROLES-EN.md).\n\nJoin the user group on [Slack](https://join.slack.com/t/sofajraft/shared_invite/zt-1au6pb3hd-eRX_LpXPQ7r1raUu3z6wDA)\n\nScan the QR code below with DingTalk(钉钉) to join the SOFAStack user group.\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*1DklS7SZFNMAAAAAAAAAAAAAARQnAQ\" width=\"200\"\u003e\n\u003c/p\u003e\n\nScan the QR code below with WeChat(微信) to Follow our Official Accounts.\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*LVCnR6KtEfEAAAAAAAAAAABjARQnAQ\" width=\"222\"\u003e\n\u003c/p\u003e\n\n## Known Users\nThese are the companies using SOFAStack (the names are in no particular order). Please leave a comment [here](https://github.com/sofastack/sofastack.tech/issues/5) to tell us your scenario to make SOFAStack better.\n\u003cdiv\u003e\n\u003cimg alt=\"蚂蚁集团\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*aK79TJUJykkAAAAAAAAAAAAAARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"网商银行\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*uAmFRZQ0Z4YAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"恒生电子\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*_iGLRq0Ih-IAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"数立信息\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*JAgIRpjz-IgAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"Paytm\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*a0fvTKJ1Xv8AAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"天弘基金\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*99OQT7lDBsMAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"中国人保\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*P1BARJxwv1sAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"信美相互\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*jAzWQpIgFUAAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"南京银行\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*q9PMQI7hs8sAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"民生银行\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*GnUuSKmOtS4AAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"重庆农商行\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*FKrxSYhdi2wAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"中信证券\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*t-xbQb3WSjcAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"富滇银行\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*JCDYT6u6_asAAAAAAAAAAAAAARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"挖财\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*lVrVT4dpSDEAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"拍拍贷\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*TAePS6j56LsAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"OPPO金融\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*mU40QaJkwZYAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"运满满\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*_kBbQYUYdIQAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"译筑科技\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*wuKSTpZSEkEAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"杭州米雅信息科技\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*b-o5SITMKu0AAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"邦道科技\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*nsw1S5bt9DkAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"申通快递\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*C3ncSpDsjS8AAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"深圳大头兄弟文化\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*8AYmRowxSC0AAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"烽火科技\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*MjuuT4omCrwAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"亚信科技\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*vBBIRomYoEUAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"成都云智天下科技\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*p0OkQbC5RvsAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"上海溢米辅导\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*mJdtTJsn1PwAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"态赋科技\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*sfLDRL5TJx8AAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"风一科技\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*EGeMR4qprnkAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"武汉易企盈\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*31WRQ7zg3HIAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"极致医疗\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*cPOiS5q8NCwAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"京东\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*INhuS44qO8YAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"小象生鲜\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*K5ERQYbCRBgAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"北京云族佳\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*qzxjSZ2tlmIAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"欣亿云网\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*huOKQKvoLzwAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"山东网聪\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*INUFR7XIH1gAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"深圳市诺安赛威\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*eVGbR7RhDDkAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"上扬软件\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*VsqMT7n7p0AAAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"长沙点三\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*2eEzSqdPIc0AAAAAAAAAAABjARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"网易云音乐\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*66KbQ6seDqoAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"虎牙直播\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*uzr3RLUZ3RwAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"中国移动\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*vEo-T55XTOAAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"无纸科技\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*9aFQSLfyPhMAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"黄金钱包\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*tYZJRpANxNoAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"独木桥网络\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*GW6oTLIlAbcAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"wueasy\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*4uFWQacI-RwAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"北京攸乐科技\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*CD5VT50FXqMAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"易宝支付\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*oy0ZSquXXjAAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"威马汽车\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*LPf2TbTeJPwAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"亿通国际\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*tlq4R7QqUaEAAAAAAAAAAABkARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"新华三\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*gw9uTbZvsbAAAAAAAAAAAAAAARQnAQ\" height=\"60\" /\u003e\n\u003cimg alt=\"klilalagroup\" src=\"https://gw.alipayobjects.com/mdn/sofastack/afts/img/A*0cskToqBSi8AAAAAAAAAAAAAARQnAQ\" height=\"60\" /\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":["Java","HarmonyOS","分布式开发","Raft - Engineering"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofastack%2Fsofa-jraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsofastack%2Fsofa-jraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofastack%2Fsofa-jraft/lists"}