A Redis cluster for when single points of failure leave you flustered.
Overview
Redis Fluster is a very limited Redis pool/cluster implementation that makes sharding simple for a few common use cases.
Quickstart
import redis
from fluster import FlusterCluster
cluster = FlusterCluster([redis.Redis(6379), redis.Redis(6380)])
while True:
for key in ('foo', 'bar'):
try:
client = cluster.get_client(key)
client.incr(key, 1)
client.get(key)
except ConnectionError:
client = cluster.get_client(key)
client.incr(key, 1)
client.get(key)
time.sleep(1)
Limited, how? I want to use this for everything!
Simply put, don’t. Fluster maintains a pool of connections to various Redis instances and will return a connection to one based on a shard key provided. If one goes down, it gets put in a penalty box until it comes back up, at which point it’s usable again.
At not point are keys duplicated, nor are they redistributed when nodes drop/join. If you’re writing INCR statements and the node goes down, now you’re writing them to another instance. Once the original instance returns, you’ve got two sets of values for the same key. This will be seamless and your program won’t crash, so maybe that’s enough.
Then what’s it good for?
Caches and ephemeral data. The ideal case is where going down is worse than duplicated data. If a Redis fluster node goes down and you’ve got two copies of a cache, this probably isn’t a problem. You’ve set expiries on the data, right?
Likewise, if you’re using lists to distribute a queue to multiple Redis instances, then one dropping and joining isn’t a problem. Items queued while it was down went elsewhere and if your workers read from all available instances, then nothing has been lost, or is really all that different.
What about Redis Cluster?
Looks great! Unfortunately, it’s very new and not ready for production use. With all due luck, that will achieve all its promise and this project can quietly fade away.
Metadata
Release files for fluster 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fluster-0.1.1.tar.gz | 21.5 kB | Without provenance | Details for fluster-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fluster-0.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for fluster-0.1.1-py2.py3-none-any.whl |
Total release size: 53.7 kB
Release files / fluster-0.1.1.tar.gz
| Download URL | fluster-0.1.1.tar.gz |
|---|---|
| Size | 21.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d652ffc9fa05d433867122eb843cdf57472312d64906071a60fe503bdb4063c5
|
|
BLAKE2b-256 checksum How to use checksums |
5469db064c81a308767908926616b5d782b0af180bf352f06765ae8e209ac3c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Release files / fluster-0.1.1-py2.py3-none-any.whl
| Download URL | fluster-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 32.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
61aebd53f22b6e4b47eed96b1b4f7770b7e9666eb55e1c4c37b9ec443d0b0d7f
|
|
BLAKE2b-256 checksum How to use checksums |
26141c582f47c47eeb5d9f45a60bebb21d99ddbf42b36fa2fd0d36d13790c325
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Security for fluster 0.1.1
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.