Redis / Valkey
Redis (dev) and Valkey (prod) are the in-memory cache and session store used by the orchestrator. They back Socket.IO pub/sub for real-time events and store ephemeral session state for in-progress conversations.
Environments
| Environment | Service | Type |
|---|---|---|
| dev | Self-hosted Bitnami Redis in-cluster | No TLS |
| prod | DO Managed Valkey (db-s-1vcpu-1gb, fra1) | TLS required |
Dev Connection Details
| Property | Value |
|---|---|
| Service name | backend-redis-master |
| Namespace | backend |
| Port | 6379 |
| Architecture | Standalone (no sentinel/cluster) |
| Chart | Bitnami Redis v25.3.9 |
| ArgoCD sync wave | 5 (data layer) |
| Persistence | 2Gi PVC |
| Metrics | Redis Exporter sidecar on port 9121 |
| TLS | Disabled |
Getting the dev password
kubectl get secret backend-redis-auth -n backend \
-o jsonpath='{.data.redis-password}' | base64 -d
Prod Connection Details (Valkey)
| Property | Value |
|---|---|
| Host | crawbl-prod-valkey-do-user-34900141-0.k.db.ondigitalocean.com |
| Port | 25061 |
| TLS | Required (CRAWBL_REDIS_TLS=true) |
| Provider | DigitalOcean Managed Valkey |
| Plan | db-s-1vcpu-1gb |
| Region | fra1 |
The orchestrator reads CRAWBL_REDIS_TLS at startup (via internal/pkg/redisclient). Set it to true in prod secrets to enable TLS dialing. The configenv.BoolOr helper is used to parse this value with a safe default of false.
Getting the prod credentials
Prod Valkey credentials live in AWS Secrets Manager under crawbl/prod/backend/orchestrator. Retrieve them with:
cd crawbl-backend && source .env
aws secretsmanager get-secret-value \
--secret-id crawbl/prod/backend/orchestrator \
--region eu-central-1 \
--query SecretString --output text | jq .
Connecting to Redis / Valkey
Dev — port-forward (recommended)
kubectl port-forward svc/backend-redis-master 6379:6379 -n backend
Then connect with redis-cli:
redis-cli -h localhost -p 6379 -a $(kubectl get secret backend-redis-auth -n backend -o jsonpath='{.data.redis-password}' | base64 -d)
What Redis Stores
| Data | Purpose | TTL |
|---|---|---|
| Socket.IO adapter state | Multi-pod event fan-out | Ephemeral |
| Conversation session state | In-progress turn tracking | Session-scoped |
| Typing indicators | Real-time agent status | Short-lived |
Redis is not the source of truth for any persistent data. If Redis is lost, the orchestrator falls back to local-only mode for real-time events. Conversations and user data are in PostgreSQL.
Debugging
Check if dev Redis is running
kubectl get pods -n backend -l app.kubernetes.io/name=redis
View dev Redis logs
kubectl logs -n backend -l app.kubernetes.io/name=redis --tail=50
Check memory usage
After port-forwarding:
redis-cli INFO memory | grep used_memory_human
Common issues
| Symptom | Likely Cause | Fix |
|---|---|---|
| Real-time events not reaching mobile app | Redis/Valkey down or unreachable | Check pod status and logs (dev) or DO managed DB status (prod) |
| High memory usage | Large session state or pub/sub backlog | Check INFO memory and DBSIZE |
| Connection refused (dev) | Password mismatch or secret not synced | Verify backend-redis-auth secret exists |
| TLS handshake failure (prod) | CRAWBL_REDIS_TLS not set or cert issue | Confirm CRAWBL_REDIS_TLS=true in prod secrets and DO CA is trusted |
What's next: See the Billing & Usage guide for how Redis fits into the event pipeline.