rraft-py


Namerraft-py JSON
Version 0.2.27 PyPI version JSON
download
home_pagehttps://github.com/lablup/rraft-py
SummaryUnofficial Python Binding of the tikv/raft-rs
upload_time2023-11-24 03:51:43
maintainerNone
docs_urlNone
authorLablup Inc.
requires_python>=3.10
licenseApache-2.0
keywords raft distributed-systems consensus-algorithm replication distributed-database
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # rraft-py

This library provides Python bindings of the *[tikv/raft-rs](https://github.com/tikv/raft-rs)* crate, allowing for integration of the [*Raft consensus algorithm*](https://en.wikipedia.org/wiki/Raft_(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*](https://github.com/lablup/raftify) or [*PySyncObj*](https://github.com/bakwc/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*](https://github.com/lablup/rraft-py/wiki/How-it-works) page in the Wiki for more details.

## 🚀 Getting started

### Installation

#### With pip

```
$ pip install rraft-py
```

#### Example

- [Example using coroutine with single in-memory node](https://github.com/lablup/rraft-py/blob/main/example/single_mem_node/use_coroutine.py)

- [Example using coroutine with multi in-memory nodes](https://github.com/lablup/rraft-py/blob/main/example/multi_mem_node/main.py)

## References

- [tikv/raft-rs](https://docs.rs/raft/latest/raft) - This binding provides almost completely similar APIs with raft-rs, so it would be helpful to refer to its documentation.
- [huggingface/tokenizer](https://github.com/huggingface/tokenizers/tree/main/bindings/python) - This lib's RefMutContainer implementation is greatly inspired from this binding.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/lablup/rraft-py",
    "name": "rraft-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "raft,distributed-systems,consensus-algorithm,replication,distributed-database",
    "author": "Lablup Inc.",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/4c/5d/33ffac8b3623a1d08831e90e1f73cb7ee741c5113bf8397249119b7bd875/rraft_py-0.2.27.tar.gz",
    "platform": null,
    "description": "# rraft-py\n\nThis library provides Python bindings of the *[tikv/raft-rs](https://github.com/tikv/raft-rs)* crate, allowing for integration of the [*Raft consensus algorithm*](https://en.wikipedia.org/wiki/Raft_(algorithm)) in Python applications.\n\nWhether 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.\n\n## \u2728 Hightlights\n\n* Provides almost the same APIs with `tikv/raft-rs` to Python, even along with concrete type hints and comments for all types.\n\n* Provides reliable implementation with more than 10,000 lines of test code porting.\n\n* 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.\n\n## \ud83e\udd14 Why?\n\nThere 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.\n\nThis binding was created to resolve this problem and to make it possible to integrate your Python code with *low-level Raft implementation*.\n\n### When to use and when not to use\n\nThis 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*](https://github.com/lablup/raftify) or [*PySyncObj*](https://github.com/bakwc/PySyncObj).\n\nHowever, 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.\n\n### Disclaimer\n\n#### Memory management\n\nThe library provides a different API compared to other Python libraries to bypass the memory management differences between Python and Rust.\n\nRefer to the [*How it works*](https://github.com/lablup/rraft-py/wiki/How-it-works) page in the Wiki for more details.\n\n## \ud83d\ude80 Getting started\n\n### Installation\n\n#### With pip\n\n```\n$ pip install rraft-py\n```\n\n#### Example\n\n- [Example using coroutine with single in-memory node](https://github.com/lablup/rraft-py/blob/main/example/single_mem_node/use_coroutine.py)\n\n- [Example using coroutine with multi in-memory nodes](https://github.com/lablup/rraft-py/blob/main/example/multi_mem_node/main.py)\n\n## References\n\n- [tikv/raft-rs](https://docs.rs/raft/latest/raft) - This binding provides almost completely similar APIs with raft-rs, so it would be helpful to refer to its documentation.\n- [huggingface/tokenizer](https://github.com/huggingface/tokenizers/tree/main/bindings/python) - This lib's RefMutContainer implementation is greatly inspired from this binding.\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Unofficial Python Binding of the tikv/raft-rs",
    "version": "0.2.27",
    "project_urls": {
        "Homepage": "https://github.com/lablup/rraft-py",
        "Source Code": "https://github.com/lablup/rraft-py"
    },
    "split_keywords": [
        "raft",
        "distributed-systems",
        "consensus-algorithm",
        "replication",
        "distributed-database"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "761a191c1014ae0827f509b7bd7a5cad6d29bf3a966ad46bc554c49dfb589fd5",
                "md5": "9e9e00d5e0f303729623aa802037f8f5",
                "sha256": "93a9fb9095213cf5b530b884dd9a719999a1289ea4dc4bd0d89cb5a1e4bb7134"
            },
            "downloads": -1,
            "filename": "rraft_py-0.2.27-cp311-cp311-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "9e9e00d5e0f303729623aa802037f8f5",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.10",
            "size": 1547536,
            "upload_time": "2023-11-24T03:51:39",
            "upload_time_iso_8601": "2023-11-24T03:51:39.552364Z",
            "url": "https://files.pythonhosted.org/packages/76/1a/191c1014ae0827f509b7bd7a5cad6d29bf3a966ad46bc554c49dfb589fd5/rraft_py-0.2.27-cp311-cp311-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4c5d33ffac8b3623a1d08831e90e1f73cb7ee741c5113bf8397249119b7bd875",
                "md5": "a760c8b71ebf7d1791b4bfb53c87b573",
                "sha256": "df77d268a95d366449017d7ab2109c3720ed8486c3434b025252ca03553b2685"
            },
            "downloads": -1,
            "filename": "rraft_py-0.2.27.tar.gz",
            "has_sig": false,
            "md5_digest": "a760c8b71ebf7d1791b4bfb53c87b573",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 133876,
            "upload_time": "2023-11-24T03:51:43",
            "upload_time_iso_8601": "2023-11-24T03:51:43.283751Z",
            "url": "https://files.pythonhosted.org/packages/4c/5d/33ffac8b3623a1d08831e90e1f73cb7ee741c5113bf8397249119b7bd875/rraft_py-0.2.27.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-24 03:51:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lablup",
    "github_project": "rraft-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "rraft-py"
}
        
Elapsed time: 0.18910s