Redis Manager
Features
- Asynchronous & High-Performance: Non-blocking operations with
asyncio. - Auto-Healing Connection Pools: Recover from failures without service restarts.
- Context Manager: Prevent resource leaks in high-concurrency systems.
- Real-Time Monitoring: Prometheus metrics for insights and debugging.
- Redis Cluster Support: Simplified handling of distributed nodes.
Quickstart
Install Redis Manager:
pip install redis-manager
Example Code:
from redis_manager.redis_manager import RedisManager
async def main():
manager = RedisManager(connection_pools_per_node_at_start=2)
await manager.add_node_pool("redis://localhost")
manager.start_cleanup()
# Note: The RedisManager can be wrapped in a try/catch block to gracefully handle exceptions
# such as connection errors or unavailability of Redis nodes.
async with manager.get_client("redis://localhost") as client:
await client.set("key", "value")
value = await client.get("key")
print(value)
# Stop tasks and close pools
manager.stop_health_checks()
manager.stop_cleanup()
await manager.close_all_pools()
Architecture Diagram
graph TD
subgraph RedisManager
A[Connection Pools] -->|Healthy Connections| B[Redis Nodes]
A -->|Health Check Task| C[Periodic Health Checks]
A -->|Cleanup Task| D[Idle Connection Cleanup]
end
B -->|Commands| E[Redis Server]
subgraph Monitoring
A -->|Metrics| F[Prometheus Exporter]
F --> G[Prometheus]
G --> H[Grafana Dashboard]
end
Documentation
- ➡️ Learn More About Architecture
- ➡️ Why Redis Manager?
- ➡️ Usage Examples
- ➡️ API Documentation
- ➡️ Packaging
Acknowledgments
- Redis: The powerful in-memory data structure store used for fast data storage and retrieval.
- Asyncio: Python's asynchronous programming framework, enabling efficient and scalable async operations.
- Bitnami Redis Cluster Docker Images: Used in testing and integration for seamless containerized Redis cluster setups.
- Prometheus: Open-source monitoring and alerting toolkit for metrics collection and visualization.
- Grafana: The leading open-source analytics and interactive visualization tool, providing rich dashboards for monitoring Redis performance and related metrics.
Changelog
Detailed changelog in CHANGELOG.md.
License
Licensed under the MIT License. See LICENSE file for more details.
Contributing
We welcome contributions! Please see our Contributing Guide and Code of Conduct to get started.
Initially Developed by Youssef Khaya
Release files for redis-manager 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 | |
|---|---|---|---|
| redis_manager-0.1.1.tar.gz | 13.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| redis_manager-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.7 kB
Release files / redis_manager-0.1.1.tar.gz
| Download URL | redis_manager-0.1.1.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b06504811d228874cab04fa1172f59de04f3d11e59a899407d012eb1dd5c4331
|
|
BLAKE2b-256 checksum How to use checksums |
768b696609292055a6887bdab9f4b17bca811c80568415844169f518109bbdb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.20
|
Release files / redis_manager-0.1.1-py3-none-any.whl
| Download URL | redis_manager-0.1.1-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d80f0d2b4ecab77bd367812275bdb57068baeba8723b898e415e6f873f0220f5
|
|
BLAKE2b-256 checksum How to use checksums |
13b36b165a7ad27f913e786d21b3482f93a5f7965a75bd49af875ef8ab3a5104
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.20
|