📦 Storage Backends
ZooCache supports various storage backends depending on your needs for persistence, speed, and distribution.
1. In-Memory
The fastest option. Data is stored in the process RAM and lost when the process restarts.
- Best for: Small ephemeral caches, local development, or data that can be easily re-computed.
- Config: Default behavior if
storage_urlis omitted.
2. LMDB (Local Persistent)
High-performance, file-based storage. It is shared between all processes on the same machine.
- Best for: High-throughput caching where data must persist between restarts.
- Config: Use
lmdb://protocol.
3. Redis
Distributed caching. Multiple application instances share the same cache via Redis.
- Best for: Multi-node deployments (Kubernetes, AWS ECS) and large datasets.
- Config: Use
redis://orrediss://(for SSL) protocol.
Comparison Table
| Backend | Speed | Persistence | Distributed | Sharing |
|---|---|---|---|---|
| In-Memory | ⚡ Extreme | No | No | No |
| LMDB | 🚀 Very High | Yes | No | Multi-process (Local) |
| Redis | 🏎️ High | Yes | Yes | Multi-node |