Overview
ondoki uses Redis 7 for three purposes:- Caching — session data and temporary state (DB 0)
- WebSocket pub/sub — real-time notification delivery across multiple backend instances
- Celery broker — task queue for async media processing jobs (DB 1)
Docker Setup
Development
Production
- Password authentication via
REDIS_PASSWORD - Memory limit of 256 MB with LRU eviction
- Health checks every 10 seconds
Connection Strings
ondoki uses two Redis databases:| Purpose | DB | Variable | Default |
|---|---|---|---|
| Cache + pub/sub | 0 | REDIS_URL | redis://redis:6379/0 |
| Celery broker | 1 | CELERY_BROKER_URL | redis://redis:6379/1 |
| Celery results | 1 | CELERY_RESULT_BACKEND | redis://redis:6379/1 |
WebSocket Notifications
The backend uses Redis pub/sub for real-time notifications to connected clients (e.g., desktop apps). This enables multi-server support — notifications published by one backend instance are delivered to WebSocket clients connected to any instance. Channel: notifications are published per-user using the user ID as the channel key.Celery Task Queue
The Celery media worker processes async jobs:- Video import processing (frame extraction, transcription, guide generation)
- Queues:
celery,media - Concurrency: 1 worker (video processing is CPU/memory intensive)
External Redis
To use an external Redis instance:- Set
REDIS_URL,CELERY_BROKER_URL, andCELERY_RESULT_BACKENDto your external Redis connection strings - Remove the
redisservice from your Docker Compose file - Ensure the external Redis supports pub/sub (required for WebSocket notifications)
Persistence
The default configuration does not persist Redis data to disk. This is acceptable because:- Session data is also stored in PostgreSQL
- Celery tasks are transient
- WebSocket pub/sub is ephemeral