raftnode
RAFT consensus algorithm implementation
Free software: MIT license
Documentation: https://raftnode.readthedocs.io.
Overview
raftnode is a fault tolerant distributed metastore based on RAFT consensus algorithm. It supports storing data in-memory and storing data in rocksdb database
It let’s you save the state of your application. Like configurations, web application sessions, or any kind of data you want to cache for faster retrieval. In a way, it’s like distributed python dictionary.
Few core features are:
High availability: data can be read, even in case of node failures (thanks to the RAFT consensus)
Replication: every data is replicated across machines
Stateful-ness: raftnode maintains a log which is basically sequence of commands as they come in. For example: the cluster gets 2 data insert operations, they will be logged in the exact sequence of their arrival, across the cluster
Namespaces: you can have different isolated categories(namespaces) to store different types of information/configurations. For example: for user sessions, you can have a namespace say ‘sessions’ that will hold just the session data And another namespace ‘configuration’ that will hold configurations like database address, microservice address, etc
Consistency: (thanks to RAFT consensus) I’ve tried to maintain data Consistency. In case of leader node failure, data insertions are halted until new leader node is elected (the time is few ms)
Bring-your-own-client: using raftnode, you can start the distributed cluster. To interact with it, you have the ability to write your own client using nodejs or scala or python or any language of your choice. There’s no language binding here.
Scaling: the nodes in the cluster can be added or removed at will.
When use distributed key value stores?
Whenever your application needs lots of small continuous reads and writes. For example: ecommerce cart items, product recommendations, microservice address, database configurations , etc.
raftnode is similar to redis or etcd. raftnode also lets you write your own client instead of using redis or etcd libraries.
Here are few links for further reference:
What is the library’s future potential?
Currently, it let’s you insert/update key-values, but not delete. It does not have support for snapshots or scheduled backup to some external storage like s3 (I’m not sure of its required). So a few updates in the near future are:
Add snapshot-ing
(May be) add probabilistic data structures like hyperloglog and bloom filters
An authentication mechanism to verify the identity of the nodes
Installation
By default, raftnode stores the data in memory. To install the vanilla version, follow these steps:
pip install raftnode
A persistent database can be used instead of the in-memory data storage. By default, raftnode uses rocksdb. To install this version of raftnode, follow these instructions:
pip install raftnode[rocksdb]
Basic Usage
Use in memory data store:
raftnode --ip <MY_IP:MY_PORT> --peers <PEER1:PORT1>,<PEER2:PORT2>,...,<PEERn:PORTn>
…OR use rocksdb database:
raftnode --ip <MY_IP:MY_PORT> --peers <PEER1:PORT1>,<PEER2:PORT2>,...,<PEERn:PORTn> --store database --volume <DIRECTORY TO STORE THE DATABASE>
For detailed command line reference, click cli usage
For detailed usage, click client usage
For more detailed CLI instructions:
raftnode --help
Features
TODO
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2021-07-21)
First release on PyPI.
0.1.1 (2021-07-26)
Put data into the key store
Get data from the key store
Create different namespaces for storing unique set of configurations
Metadata
Release files for raftnode 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| raftnode-0.1.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for raftnode-0.1.2-py2.py3-none-any.whl |
Release files / raftnode-0.1.2-py2.py3-none-any.whl
| Download URL | raftnode-0.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 19.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
84beee5ae110d22bdd6931a031c7d4d0b7f89d2ec81f9f3c128479b764a0cd24
|
|
BLAKE2b-256 checksum How to use checksums |
d70dda4063dcaf343506ce608782b7d5224740d7a3bdaf596e98d47348d625f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.10
|
Security for raftnode 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.