Skip to main content

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

EnvironmentServiceType
devSelf-hosted Bitnami Redis in-clusterNo TLS
prodDO Managed Valkey (db-s-1vcpu-1gb, fra1)TLS required

Dev Connection Details

PropertyValue
Service namebackend-redis-master
Namespacebackend
Port6379
ArchitectureStandalone (no sentinel/cluster)
ChartBitnami Redis v25.3.9
ArgoCD sync wave5 (data layer)
Persistence2Gi PVC
MetricsRedis Exporter sidecar on port 9121
TLSDisabled

Getting the dev password

kubectl get secret backend-redis-auth -n backend \
-o jsonpath='{.data.redis-password}' | base64 -d

Prod Connection Details (Valkey)

PropertyValue
Hostcrawbl-prod-valkey-do-user-34900141-0.k.db.ondigitalocean.com
Port25061
TLSRequired (CRAWBL_REDIS_TLS=true)
ProviderDigitalOcean Managed Valkey
Plandb-s-1vcpu-1gb
Regionfra1

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

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

DataPurposeTTL
Socket.IO adapter stateMulti-pod event fan-outEphemeral
Conversation session stateIn-progress turn trackingSession-scoped
Typing indicatorsReal-time agent statusShort-lived
tip

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

SymptomLikely CauseFix
Real-time events not reaching mobile appRedis/Valkey down or unreachableCheck pod status and logs (dev) or DO managed DB status (prod)
High memory usageLarge session state or pub/sub backlogCheck INFO memory and DBSIZE
Connection refused (dev)Password mismatch or secret not syncedVerify backend-redis-auth secret exists
TLS handshake failure (prod)CRAWBL_REDIS_TLS not set or cert issueConfirm 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.