Redis: What, Why, and How
Understand Redis usage in Tzylo Auth CE and how to set it up.
Redis is an optional but important component for running Tzylo Auth CE reliably in production.
What is Redis?
Redis is an in-memory data store designed for fast read and write operations.
It is commonly used for:
- Caching
- Temporary state
- Rate limiting
- Session-related data
Why Auth CE uses Redis
Authentication systems frequently need fast access to short-lived data.
- OTP validation
- Token-related state
- Rate limit counters
Redis handles these efficiently without repeatedly querying the database.
Is Redis required?
Redis is not required to start Auth CE.
If Redis is not configured, Auth CE falls back to in-memory storage.
In-memory storage is suitable only for local development or single-instance deployments.
When should you use Redis?
- Running multiple Auth CE instances
- Using OTP flows in production
- Enabling rate limiting at scale
Running Redis with Docker
Run Redis
docker run -p 6379:6379 redis:7REDIS_URL
REDIS_URL=redis://localhost:6379Redis with Docker Compose
Compose example
redis:
image: redis:7
ports:
- "6379:6379"REDIS_URL
REDIS_URL=redis://redis:6379Common mistakes
- Using in-memory mode in multi-instance setups
- Sharing Redis with unrelated workloads
- Forgetting to configure Redis in production
Redis improves reliability and performance but does not replace your primary database.