You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 9, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: CHANGES
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,12 @@
1
+
* 0.3.0
2
+
* simple benchmark now uses docopt for cli parsing
3
+
* New make target to run some benchmarks 'make benchmark'
4
+
* simple benchmark now support pipelines tests
5
+
* Renamed RedisCluster --> StrictRedisCluster
6
+
* Implement backwards compatible redis.Redis class in cluster mode. It was named RedisCluster and everyone updating from 0.2.0 to 0.3.0 should consult docs/Upgrading.md for instructions how to change your code.
Copy file name to clipboardExpand all lines: README.md
+41-24Lines changed: 41 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,35 @@ Redis cluster client in python for the official cluster support targeted for red
4
4
5
5
This project is a port of `redis-rb-cluster` by antirez, with alot of added functionality. The original source can be found at https://github.com/antirez/redis-rb-cluster
The project is not dead but not much new development is done right now. I do awnser issue reports and pull requests as soon as possible and if you have a problem you can ping me inside the gitter channel that you can find here [](https://gitter.im/Grokzen/redis-py-cluster?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) and i will help you out with problems or usage of this lib.
14
+
15
+
As of release `0.3.0` this project will be considered stable and usable in production. Just remember that if you are going to use redis cluster to please reda up on the documentation that you can find in the bottom of this Readme. It will contain usage examples and descriptions of what is implemented and what is not implemented and why things are the way they are.
16
+
17
+
On the topic about porting/moving this code into `redis-py` there is currently work over here https://github.com/andymccurdy/redis-py/pull/604 that will bring cluster uspport based on this code. But my suggestion is that until that work is completed that you should use this lib.
18
+
19
+
20
+
21
+
## Upgrading instructions
22
+
23
+
Please read the [following](docs/Upgrading.md) documentation that will go through all changes that is required when upgrading `redis-py-cluster` between versions.
8
24
9
25
10
26
11
27
## Dependencies & supported python versions
12
28
13
-
- redis >= 2.10.2
14
-
-Cluster enabled redis servers. Only Redis 3.0 beta.7 and above is supported because of CLUSTER SLOTS command was introduced in that release.
15
-
- Optional: hiredis >= 0.1.3
29
+
-Python: redis >= `2.10.2` is required
30
+
-Redis server >= `3.0.0`is required
31
+
- Optional Python: hiredis >= `0.1.3`
16
32
17
33
Hiredis is tested and supported on all supported python versions.
18
34
19
-
Supported python versions:
35
+
Supported python versions, all minor releases in each major version should be supported unless otherwise stated here:
20
36
21
37
- 2.7.x
22
38
- 3.2.x
@@ -48,20 +64,23 @@ $ python setup.py install
48
64
Small sample script that show how to get started with RedisCluster. `decode_responses=True` is required to have when running on python3.
The following imports can be imported from `redis` package.
76
+
The following imports can be imported from `redis` package.
61
77
62
-
-`RedisCluster`
63
-
-`StrictClusterPipeline`
64
-
-`ClusterPubSub`
78
+
-`StrictRedisCluster`
79
+
-`RedisCluster`
80
+
-`StrictClusterPipeline`
81
+
-`ClusterPubSub`
82
+
83
+
`StrictRedisCluster` is based on `redis.StrictRedis` and `RedisCluster` has the same functionality as `redis.Redis` even if it is not directly based on it.
65
84
66
85
67
86
@@ -71,38 +90,36 @@ All tests are currently built around a 6 redis server cluster setup (3 masters +
71
90
72
91
The easiest way to setup a cluster is to use either a Docker or Vagrant. They are both described in [Setup a redis cluster. Manually, Docker & Vagrant](docs/Cluster_Setup.md).
73
92
93
+
To run all tests in all supported environments with `tox` read this [Tox multienv testing](docs/Tox.md)
74
94
75
95
76
-
### Tox - Multi environment testing
77
-
78
-
Tox is the easiest way to run all tests because it will manage all dependencies and run the correct test command for you.
79
-
80
-
TravisCI will use tox to run tests on all supported python & hiredis versions.
81
-
82
-
Install tox with `pip install tox`
83
-
84
-
To run all environments you need all supported python versions installed on your machine. (See supported python versions list) and you also need the python-dev package for all python versions to build hiredis.
85
-
86
-
To run a specific python version use either `tox -e py27` or `tox -e py34`
87
-
88
96
89
97
## More documentation
90
98
91
99
More detailed documentation can be found in `docs` folder.
92
100
101
+
-[Benchmarks](docs/Benchmarks.md)
93
102
-[Pubsub](docs/Pubsub.md)
94
103
-[Setup a redis cluster. Manually, Docker & Vagrant](docs/Cluster_Setup.md)
95
104
-[Command differences](docs/Commands.md)
96
105
-[Limitations and differences](docs/Limits_and_differences.md)
97
106
-[Redisco support (Django ORM)](docs/Redisco.md)
107
+
-[Pipelines](docs/Pipelines.md)
98
108
-[Threaded Pipeline support](docs/Threads.md)
109
+
-[Cluster Management class](docs/ClusterMgt.md)
99
110
-[Authors](docs/Authors)
100
111
101
112
102
113
103
114
## Disclaimer
104
115
105
-
Both this client and Redis Cluster are a work in progress that is not suitable to be used in production environments. This is only my current personal opinion about both projects.
116
+
Both Redis cluster and redis-py-cluster is considered stable and production ready.
117
+
118
+
But this depends on what you are going to use clustering for. In the simple use cases with SET/GET and other single key functions there is not issues. If you require multi key functinoality or pipelines then you must be very carefull when developing because they work slightly different from the normal redis server.
119
+
120
+
If you require advance features like pubsub or scripting, this lib and redis do not handle that kind of use-cases very well. You either need to develop a custom solution yourself or use a non clustered redis server for that.
121
+
122
+
Finally, this lib itself is very stable and i know of atleast 2 companies that use this in production with high loads and big cluster sizes.
There is a few benchmarks that is designed to test specific parts of the code that will show how big of a performance difference there is between using this lib and the normal Redis client.
4
+
5
+
6
+
7
+
## Setup benchmarks
8
+
9
+
Before running any benchmark you should install this lib in editable mode inside a virtualenv so it can import `StrictRedisCluster` lib.
10
+
11
+
Install with
12
+
13
+
```
14
+
$ pip install -e .
15
+
```
16
+
17
+
You also need a few redis servers to test against. It is required to have 1 cluster with atleast one node on port `7001` and it also required to have a non-clustered server on port `7007`.
18
+
19
+
20
+
## Bencmarks
21
+
22
+
`simple.py` - This benchmark can be used to messure a simple `set` and `get` operation chain. It also support running pipelines bu adding the flag `--pipeline`
23
+
24
+
25
+
26
+
## Run predefined benchmarks
27
+
28
+
There is a set of predefined benchmarks that can be runned to messure performance drop from using this library.
0 commit comments