Redis is an in-memory data platform useful for shared low-latency state with explicit expiry or replay semantics. SupportDesk AI may use it for cache entries, rate limits, token quotas, job coordination, streams, and ephemeral progress. PostgreSQL remains the durable system of record; the application must remain correct when Redis is flushed or unavailable.
Add it only if at least one requirement is measured and PostgreSQL or process memory is not adequate:
Do not add Redis merely to store sessions, JSON, embeddings, or every object “for speed.” Every new data system adds security, backup, capacity, monitoring, and failure work.
Bind local development to loopback, require authentication outside isolated development, enable TLS where supported, use ACLs, and never expose Redis to the public internet.
Version tags are examples; consult current supported releases before production.
Use namespaced, non-PII keys such as:
Cache keys must include tenant and authorization-sensitive variation. Never cache a response under a key that omits permissions. Decide whether failure should fail open (serve from PostgreSQL) or fail closed (security quota) for each feature.
A Redis lease expires; a paused owner may resume after another owner acquired it. Use fencing tokens when a downstream resource must reject stale owners, or prefer database constraints for durable exclusivity. For queues, document delivery guarantees, acknowledgment, retries, dead-letter behavior, ordering, observability, and what survives a Redis failure.
Redis can enforce fast per-tenant token/request budgets and distribute streaming progress. It must not be the only record of an AI run, approval, tool effect, or billed usage. Write durable outcomes to PostgreSQL and reconstruct ephemeral state after failure.
Design a per-tenant, per-user sliding-window limit for AI drafts plus a cache for public ticket summaries. Explain different failure behavior for each.
Acceptance criteria: atomic tests cover the boundary second, keys never collide across tenants, memory is bounded, cache outage falls back safely, and quota outage follows a documented security policy.