Quick revision
The short answer
Run Redis in every region next to the application, because synchronous cross-region writes add tens of milliseconds to every request. Sessions and rate limits stay regional and we accept, and document, that a region failure logs users out or resets their limits. Carts are worth more, so they live in a durable database replicated across regions with Redis as a cache, or in an active-active Redis offering with CRDT merges if its semantics fit. Inside each region we use Cluster or Sentinel with replicas across zones, and we set RPO and RTO per use and test regional failover.
What to remember
In this answer, we kept Redis regional because it is only useful when it is close, then gave each kind of data its own failure promise. Sessions and rate limits reset in a regional failure, and we document that. Carts survive through a replicated database with Redis as a cache, or through CRDT-based active-active replication when its merge rules fit. Inside each region, Sentinel or Cluster with replicas across zones handles node and zone failures, and RPO and RTO per use, regular drills and lag and memory monitoring keep the design honest.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Run Redis in every region next to the application, because synchronous cross-region writes add tens of milliseconds to every request. Sessions and rate limits stay regional and we accept, and document, that a region failure logs users out or resets their limits. Carts are worth more, so they live in a durable database replicated across regions with Redis as a cache, or in an active-active Redis offering with CRDT merges if its semantics fit. Inside each region we use Cluster or Sentinel with replicas across zones, and we set RPO and RTO per use and test regional failover.
Why this question is asked
Multi-region designs fail when every piece of data is given the same treatment. Treat everything as critical and the platform becomes slow and expensive; treat everything as disposable and a region outage empties every customer's cart on the busiest day of the year. Interviewers ask this at senior level to see whether we can separate data by what its loss costs and pick a different consistency for each. In this answer, we will look at why Redis stays regional, decide the fate of sessions, rate limits and carts in a regional failure, choose the topology inside a region, and define the targets and tests that make the design trustworthy.
1Why Redis Stays Close to the Application
Redis is used for these three jobs because it answers in under a millisecond. A request that reads a session, checks a rate limit and loads the cart might make five Redis calls. If those calls went to a primary in another region with a 70 ms round trip, the request would gain about 350 ms, which defeats the purpose. Synchronous replication across regions would add the same latency to every write.
So the baseline is one independent Redis deployment per region, used only by the application in that region, with traffic steered to a region by geo DNS or a global load balancer. The design question is then what happens to each kind of data when a region disappears and its users are sent elsewhere.
Let us define the two targets we will use. RPO, the recovery point objective, is how much recent data we can afford to lose. RTO, the recovery time objective, is how long recovery may take.
2Sessions and Rate Limits: Regional and Allowed to Reset
Sessions are easy to recreate: the user signs in again. If our identity provider supports silent re-authentication or we use refresh tokens, many users will not even notice. So sessions stay regional, with an RPO of everything in that region. We write this down as an accepted loss so nobody is surprised during an incident.
Rate limits are counters over short windows, typically a minute. If a region fails, its users arrive in another region with fresh counters, so for at most one window they could exceed their limit. That is acceptable for abuse protection. If some limits are contractual, such as a paid API quota per month, those counters belong in a database, not in regional Redis.
3Carts: Two Ways to Survive a Region
A cart represents intended revenue, and customers notice when it vanishes. There are two reasonable designs.
The first keeps the cart's source of truth in a durable database that replicates across regions, such as a relational database with a cross-region replica or a globally replicated NoSQL table, and uses Redis only as a regional cache with cache-aside reads. On region failure, users land in another region, the cache misses, and the cart is read from the replicated database. The RPO is the database's replication lag, usually a second or less, and Redis needs no cross-region features at all.
The second uses an active-active Redis offering, available in some commercial distributions, where each region accepts writes and replicates asynchronously, and conflicts are merged with CRDTs, conflict-free replicated data types designed so concurrent updates merge deterministically. This keeps carts fast and writable everywhere, but we must accept its merge rules, licence costs and a narrower set of supported commands. Open source Redis does not offer this; its replication has one primary.
| Data | Where it lives | On region loss | RPO / RTO |
|---|---|---|---|
| Sessions | Regional Redis | Users sign in again | all / minutes |
| Rate limits | Regional Redis | Counters reset for one window | all / minutes |
| Carts | Replicated DB + regional cache | Read from DB in new region | about 1 s / minutes |
| Carts (alt) | Active-active Redis (CRDT) | Already present, merged | replication lag / seconds |
My default is the first option, because it uses tools the team already understands and keeps Redis disposable. I would choose active-active only if cart write latency in the database is a measured problem.
4Topology Inside One Region
Within a region we still want to survive the loss of a node or an availability zone. For a small dataset, such as sessions of a few gigabytes, Sentinel with one primary and two replicas in three zones is simple and enough. For larger or busier data, Redis Cluster spreads slots over several primaries, each with a replica in a different zone, so losing a zone promotes replicas and keeps every slot available.
Key design still matters in Cluster: a cart's keys share a hash tag such as {cart:9f3a} so a Lua script can update its items and totals atomically. We also set maxmemory and an eviction policy per use: allkeys-lru is fine for a cache of carts, while a session store should rather alert before it evicts live sessions.
- Global traffic steeringGeo DNS or global load balancer picks a region
- Application podsSpread across three zones
- Sessions and limitsSentinel: primary + 2 replicas across zones
- Cart cacheCluster: 3 primaries, replicas in other zones
- Cart databaseDurable, replicated to the other regions
5 layers, from the top down. Step through them one at a time.
Only the bottom layer crosses regions.
5Targets, Tests and Monitoring
A design like this is only true if it is tested. We write the RPO and RTO for each use into the service documentation, and once a quarter we run a regional failover drill: steer all traffic away from one region and measure how many users had to sign in again, whether carts reappeared, and how long the error rate stayed raised.
Day to day we monitor replication lag of the cart database, memory per Redis shard against maxmemory, evictions, and failover events. A slowly growing shard is the most common surprise, usually caused by a hot hash tag or keys without TTL.
6Follow-up questions
How would conflict resolution for a cart work in active-active?
Suppose a user adds a book in region A while a retry adds a pen in region B before replication catches up. If the cart is a CRDT set or map, both additions survive the merge, because adds commute. Quantities modelled as counters merge by summing increments. The hard case is add versus remove of the same item: common designs let the add win, so a removed item can come back, which is usually acceptable for carts but must be checked against product expectations. With plain last-write-wins on a whole cart value, one of the two updates would simply be lost, which is why the data type matters.
Why not keep one global Redis and accept the latency?
Because it puts a cross-region round trip into every request and makes every region depend on one location, so a single region outage takes the whole platform down. That is the opposite of the regional failure tolerance we were asked for.
Should rate limits ever be global?
Some limits, like a partner's total quota, must hold across regions. Those are rare and slow-moving, so we enforce them from a central store with a small local allowance per region, accepting slight overshoot, rather than making every request call another region.
7Conclusion
In this answer, we kept Redis regional because it is only useful when it is close, then gave each kind of data its own failure promise. Sessions and rate limits reset in a regional failure, and we document that. Carts survive through a replicated database with Redis as a cache, or through CRDT-based active-active replication when its merge rules fit. Inside each region, Sentinel or Cluster with replicas across zones handles node and zone failures, and RPO and RTO per use, regular drills and lag and memory monitoring keep the design honest.
Open with
I would run a separate Redis deployment in each region, next to the application, because Redis is only useful at sub-millisecond latency and cross-region synchronous writes would add tens of milliseconds to every call.
Then, if they want more
Then I would decide per use what a regional failure is allowed to cost. Sessions stay regional; if a region fails, users sign in again, and we document that as an accepted loss. Rate limits also stay regional and simply reset for one window, unless a limit is contractual, which goes to a database.
Carts matter for revenue, so their source of truth would be a durable database replicated across regions, with Redis as a regional cache, giving an RPO of about the replication lag.
If the database latency were a measured problem, I would consider an active-active Redis offering with CRDT merges, as long as we accept its merge semantics, for example that an add can beat a concurrent remove. Inside each region I would use Sentinel for small datasets like sessions and Cluster for larger ones, with replicas in different zones.
Finally I would write down RPO and RTO for each use, run regional failover drills, and monitor replication lag, memory per shard and evictions.
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
- Redis documentation
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 "Design the Redis topology for a multi-region e-commerce platform that uses Redis for...": https://scrivio-interview-library.netlify.app/databases/redis/37ba6d3ff7/