Operations

Redis


Redis is optional. When configured, it provides two benefits:

  1. Fast queue notification — The orchestrator pushes execution IDs to Redis lists (LPUSH). Workers use BRPOP to wake as soon as work is queued, instead of periodic PostgreSQL polling.
  2. Query caching — Frequently accessed data is cached in Redis with configurable TTL (default: 5 minutes).

Enabling Redis

Set the REDIS_URL environment variable on the orchestrator:

1
REDIS_URL=redis://localhost:6379

Default Redis connection settings:

SettingDefaultDescription
pool_size10Number of connections
min_idle2Minimum idle connections
connection_timeout10sTimeout for establishing a connection
command_timeout5sTimeout for individual commands
key_prefixorcher:Prefix for all Redis keys
database0Redis database number

What Redis Stores

1
orcher:queue:{namespace}:{task_queue} → List of execution IDs (LPUSH/BRPOP)

Redis is used exclusively as a notification layer. All durable state lives in PostgreSQL. If Redis goes down, workers automatically fall back to PostgreSQL polling — no work is lost.

Redis in Docker Compose

1
services:
2
redis:
3
image: redis:7-alpine
4
command: redis-server --appendonly yes
5
ports:
6
- "6379:6379"
7
healthcheck:
8
test: ["CMD", "redis-cli", "ping"]
9
interval: 10s
10
timeout: 3s
11
retries: 5

Enable AOF (Append-Only File) persistence with --appendonly yes so Redis survives restarts. However, even without persistence, no data is lost — PostgreSQL is authoritative.


Next Steps