Skip to main content

rraft-py

This library provides Python bindings of the tikv/raft-rs crate, allowing for integration of the Raft consensus algorithm in Python applications.

Whether you're building a distributed database, a highly-available service, or any other type of application that requires consensus among a set of nodes, this binding makes it simple to get started.

✨ Hightlights

  • Provides almost the same APIs with tikv/raft-rs to Python, even along with concrete type hints and comments for all types.

  • Provides reliable implementation with more than 10,000 lines of test code porting.

  • Provides flexible design inherited from tikv/raft-rs, which means rraft-py lets users could combine any storage and network layer they want through Python.

🤔 Why?

There have been several attempts to implement a Raft implementation in the Python ecosystem before, but unfortunately, there is no library being used as a de-facto standard as of now.

This binding was created to resolve this problem and to make it possible to integrate your Python code with low-level Raft implementation.

When to use and when not to use

This library is a binding for tikv/raft-rs and only contains an implementation of the consensus module. Therefore, you need to write the logic for both the transport and storage layers yourself. If you just want to quickly integrate Raft with your Python application, using this library might not be suitable. In this case, you can consider to using Raftify or PySyncObj.

However, if you want to integrate well-tested Raft implementation that is reliable for production-level use in Python, or want to change the transport layer to a different layer, or want to change fine-grained settings according to your application's specific use case, this binding could provide you a valid starting point.

Disclaimer

Memory management

The library provides a different API compared to other Python libraries to bypass the memory management differences between Python and Rust.

Refer to the How it works page in the Wiki for more details.

🚀 Getting started

Installation

With pip

$ pip install rraft-py

Example

References

  • tikv/raft-rs - This binding provides almost completely similar APIs with raft-rs, so it would be helpful to refer to its documentation.
  • huggingface/tokenizer - This lib's RefMutContainer implementation is greatly inspired from this binding.

Metadata

Release files for rraft-py 0.2.27

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rraft-py 0.2.27
File Size Uploaded
rraft_py-0.2.27.tar.gz 133.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rraft-py 0.2.27
File Interpreter ABI Platform
rraft_py-0.2.27-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details

Total release size: 1.7 MB

Release files / rraft_py-0.2.27.tar.gz

Download URL rraft_py-0.2.27.tar.gz
Size 133.9 kB
Tags Source
SHA-256 checksum
How to use checksums
df77d268a95d366449017d7ab2109c3720ed8486c3434b025252ca03553b2685
BLAKE2b-256 checksum
How to use checksums
4c5d33ffac8b3623a1d08831e90e1f73cb7ee741c5113bf8397249119b7bd875
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.14

Release files / rraft_py-0.2.27-cp311-cp311-macosx_11_0_arm64.whl

Download URL rraft_py-0.2.27-cp311-cp311-macosx_11_0_arm64.whl
Size 1.5 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
93a9fb9095213cf5b530b884dd9a719999a1289ea4dc4bd0d89cb5a1e4bb7134
BLAKE2b-256 checksum
How to use checksums
761a191c1014ae0827f509b7bd7a5cad6d29bf3a966ad46bc554c49dfb589fd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.14

Release history Release notifications | RSS feed

This release

0.2.27 This release

2 release files

0.2.25

2 release files

0.2.24

2 release files

0.2.22

2 release files

0.2.21

2 release files

0.2.20

2 release files

0.2.19

2 release files

0.2.18

2 release files

0.2.17

2 release files

0.2.14

2 release files

0.2.13

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page