Redis Configuration
Configure the cache layer for distributed and standalone modes.
Compozy’s cache layer supports two modes:
distributed: connect to an external Redis instance (production/staging)standalone: run an embedded, Redis‑compatible server with optional snapshots (development/CI)
Configuration Structure
redis:
mode: distributed | standalone
distributed:
addr: localhost:6379
password: ""
db: 0
tls:
enabled: false
insecure_skip_verify: false
standalone:
persistence:
enabled: false
dir: ./.tmp/redis
interval: 60sDistributed Mode (External Redis)
Use this for production and shared environments.
redis:
mode: distributed
distributed:
addr: redis.prod.internal:6379
password: ${REDIS_PASSWORD}
tls:
enabled: trueEnvironment Variables
| Path | Env |
|---|---|
redis.mode | REDIS_MODE |
redis.distributed.addr | REDIS_ADDR |
redis.distributed.password | REDIS_PASSWORD |
redis.distributed.db | REDIS_DB |
Standalone Mode (Embedded)
Runs a Redis‑compatible server inside the Compozy process.
redis:
mode: standalone
standalone:
persistence:
enabled: true
dir: ./.tmp/redis
interval: 30sPersistence Options
enabled: turn on periodic snapshots for CI scenarios that need restartsdir: where snapshots are stored; ensure the process can write hereinterval: snapshot frequency (time.Durationsyntax)
Performance Tuning
- Prefer
distributedwith managed Redis for high throughput - For
standalone, disable snapshots in tight loops to minimize I/O - Use separate DB indexes (
db) per tenant in shared dev boxes
Monitoring & Metrics
- In distributed mode, use
INFO, latency monitors, and your provider’s dashboards - In standalone, observe Compozy logs; enable debug logs when diagnosing cache behavior
Troubleshooting
- "connection refused" (standalone): ensure the process owns the snapshot
dirand no port conflicts - Authentication failures (distributed): verify
passwordand TLS settings - Snapshot errors: validate
intervalformat and directory permissions