sofa-jraft lists asymmetric partition tolerance and lease reads in the same breath, and its Jepsen claim links to the framework
A production-grade java implementation of RAFT consensus algorithm.
At a glance
- What is it?
- A Java implementation of the Raft consensus algorithm supporting multiple Raft groups per process, ported from Baidu's C++ braft. The feature list claims symmetry and asymmetry tolerance separately, offers lease reads, includes a manual recovery mode for majority failure, and asserts a Jepsen result with a link to the testing framework rather than to any outcome.
- Who is it for?
- SOFAJRaft is worth evaluating if you need many small replicated state machines in one process rather than one large log, since multiple Raft groups is the claim that separates it from a single group library, and if you want a Java implementation whose lineage is a documented C++ port rather than a rewrite. Four things to check before you depend on it.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 3 days ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- sofastack/sofa-jraft3,820 ★ · -3
| Repository | 2026-09-24 | 2026-11-15 |
|---|---|---|
| sofastack/sofa-jraft | 3.8k | 3.8k |
-3 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
A Java port of a C++ library, with the improvement unquantified
The acknowledgement is the most informative paragraph in the file. SOFAJRaft was ported from Baidu's C++ braft with some optimizing and improvement, and the README thanks the Baidu team for opening up what it calls a great C++ Raft implementation. So the algorithm lineage is a C++ library, the Java code is this project's own work, and the amount of improvement is described by a phrase rather than by a change log. The project does write its reasoning down: the tree carries a directory of design proposals, and the document index points at a counter-example page on the project site, which is where a consensus implementation's failure cases should live. Neither is linked from the feature list, which is where a reader looking for evidence of correctness will actually look.
Multiple Raft groups is the whole architectural pitch
The overview is two paragraphs and one sentence of them is load bearing. The implementation supports multiple Raft groups for high-load, low-latency scenarios. Everything else in that paragraph is positioning: focus on your business area, the library handles the Raft related challenges, several examples make it easy to understand and use. The multi-group support is the substantive difference. A conventional Raft library hosts one replicated log per process; hosting many independent groups means many small shards or tenants in one process, each with its own leader and its own membership, which is the shape you want when the unit of replication is small and the number of units is large. If your workload is one large shared log, this feature is not why you would choose it. If you are self-assessing, note that the same paragraph calls the library very user friendly, which is a claim about the examples rather than about the protocol.
Asymmetric partitions and lease reads, in the same feature list
The features list names symmetric network partition tolerance and asymmetric network partition tolerance as two separate entries, and elsewhere names linearizable read through ReadIndex and LeaseRead. That combination is the one to examine. Lease reads depend on a leader being able to reach a majority within a bounded interval, and a one-way partition is exactly the situation where that assumption is difficult to hold, so an implementation claiming both has either extended the mechanism beyond the paper or is using the terms differently. The README gives no detail either way, which means the claim has to be taken on trust from a bullet point. The counter-example document linked from the document index is the right place to look, because that is the sort of thing a good project writes down rather than asserts.
A manual recovery mode for the state the protocol declares lost
One feature entry reads: manual recovery cluster available for majority failure. In Raft, a group that has lost its majority has no leader and cannot accept writes, and that refusal is the safety property the whole algorithm is built around. A manual recovery path is an operator escape hatch that brings a cluster back from that state by overriding the quorum rule, which means a group can be made writable again after the protocol says it must not be. That is a valuable tool for the case where a majority is genuinely lost and you would otherwise be rebuilding from a backup by hand. It is also the single most dangerous feature in the list, because it is the one that can produce divergent state between replicas. The README attaches no warning to it, no procedure, and no statement of what survives the operation.
Passed Jepsen, linking to the testing framework
Another feature entry says the implementation passed the Jepsen consistency verification test, and the link points at the Jepsen project itself. There is no date, no cluster size, no fault schedule, no configuration, and no report. For a consensus implementation this is the most valuable single piece of evidence available, because the interesting failures of Raft live in the interaction between timing and reconfiguration rather than in any unit test, and an independent adversarial tester is the tool designed to find them. As written, the bullet asserts an outcome and cites the framework. The release notes are the natural place to look for what has actually been exercised and when, and the fact that a counter-example document is published at all suggests the project is the kind that would have the details somewhere.
The one stated requirement is a compile floor of JDK 8
The Requirements section is a single line: compile requirement, JDK 8 or later and Maven 3.2.5 or later. It is explicitly about compiling, so what the library needs at run time is not in the file at all. There is no minimum memory, no supported operating system, no list of runtime dependencies beyond the two libraries named in the licence section, and no note about which Java versions are tested rather than merely compilable. The newest release is from June 2026, so a project shipping then is still declaring a floor that has been out of mainstream support for years. That can be read two ways. It is generous about the machines it will run on, or it has not revisited its baseline since the port. Nothing in the file distinguishes the two, and the two lead to different decisions about which JDK you run in production.
Five modules, two readmes, and a layout the README never explains
The repository is a Maven multi-module project with a parent manifest at the root and five modules: a core library, an example module, an extension module, a key value module that corresponds to the embedded distributed storage feature, and a test module. Beside them are a directory of design proposals, a tools directory, a contribution guide, a security policy, and both an English and a Chinese readme linked from each other at the top of the file. None of that appears in the README. The overview advertises several examples and the reader has to know they live in a module named after them. One identity detail is worth knowing before you add a dependency: the package coordinates in the artifact badge sit under an alipay group, while the repository, the project site and the group of contributing organisations all use a different name.
Editorial conclusion
SOFAJRaft is worth evaluating if you need many small replicated state machines in one process rather than one large log, since multiple Raft groups is the claim that separates it from a single group library, and if you want a Java implementation whose lineage is a documented C++ port rather than a rewrite. Four things to check before you depend on it. Its compile floor is JDK 8 and nothing else is stated about what it needs at run time, so the runtime requirements are yours to establish. Its most distinctive claims, asymmetric partition tolerance and lease reads, are asserted in a bullet each with no explanation, so read the counter-example document the project site links rather than the feature list. Its manual recovery mode exists for the state Raft declares unavailable, which is valuable and dangerous and gets no warning in the README. And its Jepsen result is a link to the framework, so find the report. Licence terms are Apache 2.0, including the Netty and Protobuf code it reuses.
Frequently asked questions
What is SOFAJRaft?
A production-level Java implementation of the Raft consistency algorithm that supports multiple Raft groups, aimed at high-load, low-latency scenarios. It was ported from Baidu's C++ braft with optimisations and improvements, and it includes an embedded distributed key value storage implementation.
What can SOFAJRaft do that plain Raft cannot?
It supports multiple Raft groups in one process, which suits workloads made of many small independent shards. Its feature list also claims tolerance of asymmetric network partitions separately from symmetric ones, a mechanism for transferring leadership, a replication pipeline, statistics through a metrics library, and a manual recovery mode available after majority failure.
Does SOFAJRaft support linearizable reads?
Yes, through ReadIndex and LeaseRead. The feature list names both mechanisms and, separately, claims symmetric and asymmetric network partition tolerance, without explaining in the file how the lease mechanism behaves when a one-way partition prevents a leader from reaching a majority.
What does it take to build SOFAJRaft?
The file states one line: JDK 8 or later and Maven 3.2.5 or later, described as a compile requirement. Nothing is said about runtime requirements, supported operating systems or minimum memory.
What licence is SOFAJRaft under?
Apache License 2.0, and the third-party components it relies on are stated to be under the same licence. It also directly reuses code from two projects, a wheel timer from Netty along with that project's pipeline design, and UTF-8 string encoding and decoding from Protobuf, each with minor changes.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/sofastack-sofa-jraft)Star history chart for your README
[](https://hysenlabs.com/projects/sofastack-sofa-jraft)Was this useful?