Video in progress
Dozens of teams use one shared Redis cluster, and one team's mistake takes everyone down. How do you reorganize the platform?
I strengthen isolation: separate clusters for important or heavy services, ACL users restricted to prefixes on the shared cluster, banning dangerous commands, a memory/ops quota per team, and metrics that make it visible who is using what.
📖 Answer
The usual incidents with a shared Redis: one team sends KEYS * or a big HGETALL and everyone waits; another fills the cache without TTLs and causes eviction, and other teams' sessions disappear; a third runs FLUSHALL.
Redis has no resource isolation of its own: one thread, one memory pool. So the main weapon is physical separation.
- Split into tiers.
- Tier 1 (sessions, locks, rate limits, anything tied to payments): a separate cluster per service,
noevictionor an explicit policy, HA. - Tier 2 (an ordinary cache): several teams on a shared cluster,
allkeys-lru. - Experiments: a separate cheap instance.
Not mixing cache and sessions in one cluster is the biggest win.
- ACL (Redis 6+).
ACL SETUSER orders-svc on >secret ~orders:* &orders:* +@all -@dangerous -keys -flushall
Each service can write only to its own prefix, and KEYS, FLUSHALL and CONFIG are banned. This closes off both mistakes and the case of "reading another team's key".
-
A platform library: an internal starter with a mandatory prefix, a default TTL, timeouts, a serializer, and metrics (with
serviceandcachetags). Teams don't configureRedisTemplatedirectly. -
Observability: the count and memory of keys by prefix (a daily report from a
SCAN+MEMORY USAGEsample on a replica),SLOWLOGreports grouped by owner, and connections with a name for each client (CLIENT SETNAME). Finding who the "noisy neighbor" is often takes hours; named clients cut that to minutes. -
Chargeback or quotas: when memory and ops are visible per team, caches without TTLs disappear quickly.
The trade-off: many clusters means a lot of operational work. Without a managed service (ElastiCache, Memorystore) or a Kubernetes operator, managing 30 clusters by hand becomes a new problem. That's why I give full isolation only to Tier 1.
Sign up to mark studied questions and save your progress.