Scrivio Interview library
LeadershipAdvanced7 min read · updated 12 November 2026

Redis is used by 50 services for caching, sessions, rate limiting and queues in one shared cluster. What risks do you see, and what would you change?

One shared cluster for 50 services means noisy neighbours, one failure domain for everything, and nobody who clearly owns capacity or keys. The worst risk is mixing uses with different needs: caches can lose data but queues and sessions cannot, yet one instance has one eviction policy and one persistence setting. I would separate clusters, or at least isolate logically, by criticality and use, set eviction policies per use, enforce key naming, TTL and size standards, monitor hot and big keys, and review the licence situation, since Redis changed its licence in 2024 and the Valkey fork appeared; check the current terms.

Why this question is asked

Shared Redis clusters grow by convenience. One team needed a cache, the cluster was there, and five years later it carries sessions, rate limiters, job queues and leaderboards for half the company. It works until one bad deploy fills memory or runs a slow command, and then 50 services fail together. Interviewers ask this leadership question to see whether we can find the structural risks, prioritise them, and plan changes that teams can adopt without a freeze. In this answer, we will look at why a shared cluster fails as a unit, why mixed uses conflict, how to split and standardise, what to monitor, and how licensing enters the decision.

1A Quick Recap of What Redis Is Good and Bad At

Redis is an in-memory data store. All data lives in RAM, which makes reads and writes take well under a millisecond, and each shard executes commands one at a time on a single main thread. Those two facts explain most of the risks. Memory is finite, so when it fills up Redis must either evict keys or reject writes. And because commands run one at a time, one slow command, such as KEYS over millions of keys or reading a list with a million elements, blocks every other client on that shard while it runs.

Persistence is optional. Redis can write periodic snapshots (RDB) or an append-only log of writes (AOF), but by default it is tuned to be fast, and with AOF fsync once per second a crash can still lose the last second of writes.

2Risk 1: Noisy Neighbours, Shared Failure and No Owner

A noisy neighbour is a tenant whose load hurts others on the same resource. In a shared cluster, a batch job that writes 20 GB of cache entries pushes other services' keys out of memory, and a service that calls a slow command adds latency for all 50. A failure is shared too: a failover, a memory exhaustion or a misconfigured client storm takes down sessions, rate limiting and caches at once, so an incident in one feature becomes a company-wide outage.

Ownership is the quieter problem. When nobody owns the cluster's capacity, nobody can say who uses which keys, which ones can be deleted, or whose growth will exhaust memory next month. Every change is risky because the blast radius is unknown.

3Risk 2: Uses With Conflicting Requirements

The four uses need opposite settings. A cache wants to evict the least recently used keys when memory is full, maxmemory-policy allkeys-lru, and losing data is fine because it can be reloaded. A queue or a session store must never silently lose data, so it wants noeviction, which rejects writes instead, plus persistence and replication. Rate limiting tolerates loss but needs low latency. One Redis instance has one maxmemory-policy, so a shared cluster forces a single compromise: either caches cannot evict and writes start failing when memory fills, or sessions and queued jobs get evicted like cache entries.

Using Redis as a queue or a primary store without planning persistence is the most serious risk. A job queue on a cache-tuned cluster can lose queued work on a restart or under memory pressure without anyone noticing until customers ask where their export went. Durable queues belong in a system built for them, such as Kafka or a database-backed queue, or on a Redis deployment explicitly configured and owned for durability.

What each use needs
UseLoss acceptable?Eviction policyPersistence
Cacheyes, reload from sourceallkeys-lru or allkeys-lfunot needed
Rate limitingyes, brieflyvolatile-ttl or allkeys-lrunot needed
Sessionsno, users get logged outnoeviction or volatile-lru with TTLsreplication, AOF
Queuesno, work disappearsnoevictionAOF, or move to Kafka

4What I Would Change: Isolation by Criticality and Use

The main change is to split the cluster. We do not need 50 clusters; we need a handful, grouped by what they must guarantee. A typical result is a cache cluster tuned for eviction, a durable cluster for sessions with replication and persistence, and dedicated clusters for the two or three services whose load or criticality justifies them. Queues move to a real queue or to the durable cluster with explicit ownership.

Where full separation is too expensive, logical isolation helps: ACL users per service, restricted to their own key prefix with patterns such as ~orders:*, so one service cannot read or delete another's keys, and per-service memory budgets watched through monitoring. Redis Cluster does not support numbered databases, so key prefixes and ACLs are the practical boundary. Each resulting cluster has a named owning team, an on-call rotation and a capacity plan.

5Standards for Keys, TTLs and Sizes

Splitting fixes the structure; standards keep it healthy. We publish a short standard that every service follows: keys are named service:entity:id, such as orders:cart:42, so ownership is visible in the key itself; every cache key has a TTL, and a key without one fails review; values have a size limit, for example 100 KB, because big keys make commands slow and failovers heavy; and dangerous commands such as KEYS and FLUSHALL are disabled or renamed, with SCAN used instead. Client libraries get shared defaults for timeouts and connection pools so a slow Redis does not exhaust request threads.

Java
# a cache entry that follows the standard
SET catalog:product:42 '{"id":42,"name":"Lamp"}' EX 600
# finding problems
redis-cli --bigkeys # largest key per type
redis-cli --hotkeys # needs an LFU maxmemory-policy
redis-cli --latency-history # spikes often follow a slow command
SLOWLOG GET 10 # the 10 most recent slow commands

6Monitoring and Licensing

We monitor memory use against maxmemory, evicted keys per second, which should be zero on durable clusters, connected clients, command latency, replication lag, and the slow log. Hot keys, single keys that receive a large share of traffic, overload one shard in a cluster, and big keys cause latency spikes; both are found with the commands above or with keyspace analysis, and dashboards are broken down by key prefix so each team sees its own usage.

Finally, licensing. In 2024 Redis moved from the permissive BSD licence to source-available licences, and the Linux Foundation started Valkey, a fork of the last open-source version, which several cloud providers adopted for their managed offerings; Redis later added an AGPL option as well. For most companies running Redis internally the change may matter little, but whether it affects us depends on how we use and distribute it, so we check the current terms with legal advice. The re-platforming is a natural moment to decide between Redis, Valkey or a managed service, and keeping to the common command set keeps that choice open.

7Follow-up questions

How would you sequence the work?

First the risks that lose data: move queues and sessions off the cache-tuned cluster. Then ownership and standards, because they make the split possible: we cannot move keys nobody owns. Then the cache split by load, and finally the monitoring dashboards per team. Each step is useful alone.

How do you find out who uses which keys today?

Sample keys with SCAN and group by prefix, use the MONITOR command briefly on a replica or client tracking to see which client connections send which keys, and check client names set with CLIENT SETNAME. Unknown prefixes get announced with a deadline before their keys are given a TTL.

8Conclusion

In this answer, we saw that a shared Redis cluster for 50 services creates noisy neighbours, a single failure domain and unclear ownership, and that mixing caches with sessions and queues forces one eviction and persistence compromise that risks losing data. The changes are to split by criticality and use, isolate the rest with ACLs and prefixes, set eviction and persistence per cluster, enforce key naming, TTL and size standards, monitor memory, evictions, hot keys and big keys, and use the moment to review Redis, Valkey and managed options under current licence terms.

What to say in the interviewAbout 90 seconds aloud

Open with

I see three structural risks. First, noisy neighbours and a shared failure domain: Redis keeps everything in memory and runs commands one at a time per shard, so one service filling memory or running KEYS hurts all 50, and a failover is a company-wide incident.

Then, if they want more

Second, no ownership: nobody knows whose keys are whose or whose growth will exhaust memory. Third, and most serious, conflicting uses in one place. A cache wants allkeys-lru eviction and doesn't care about persistence, but sessions and queues must not lose data and want noeviction plus replication and AOF.

One instance has one policy, so today either caches can make writes fail or queued jobs can be evicted like cache entries. What I would change: split the cluster by criticality and use, so a cache cluster, a durable cluster for sessions, dedicated ones for the heaviest services, and move real queues to Kafka or a database-backed queue.

Where splitting is too costly, ACL users restricted to their key prefix. Then standards: service-prefixed key names, a TTL on every cache key, a value size limit, KEYS disabled. Monitoring of memory, evictions, latency, slow log, hot keys and big keys per prefix.

And I would review licensing, because Redis changed its licence in 2024 and Valkey forked; I would check current terms with legal and use the move to choose Redis, Valkey or a managed service.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring Data reference
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Redis is used by 50 services for caching, sessions, rate limiting and queues in one...": https://scrivio-interview-library.netlify.app/databases/spring-data-nosql/40cf2a592b/