Why running Redis for Hyperswitch needs its own plan
Redis sits in the Hyperswitch hot path, so it needs a deliberate plan before go-live. In the Hyperswitch architecture, Redis backs caching and the scheduler queue, and both the Router and the Scheduler depend on it while the payment path runs. The architecture docs name Redis alongside PostgreSQL, which has a master and replica setup, so the two data stores are designed together. A team that treats Redis as a default add-on, installed with a chart and forgotten, will find out what it does during an incident rather than before one.
The plan has to answer three questions: which Redis product runs, where it runs, and how it recovers. The first is a licensing and compatibility decision. Redis 8 and later are available under a license of the user's choice, and earlier lines carry different terms, so the team should confirm which license applies to the version it intends to deploy with its own counsel. Valkey, a BSD-3-Clause fork that is compatible with Redis OSS 7.2 and earlier, is the other option the team should weigh. The second is hosting: self-managed, a Redis-compatible service, or a vendor-supported product, each with different responsibilities for patching and failover. The third is recovery, which depends on persistence and high availability choices covered later in this section group.
Treat the Redis choice as part of the Hyperswitch platform decision, not a later tuning task. Before build starts, confirm with your Hyperswitch deployment owner which Redis features the release you target expects, which client libraries the stack uses, and who on your team owns Sentinel or failover runbooks. Record the answers in the architecture decision log, because they determine how upgrades, load tests and chaos tests will be run against Redis.
How Router, Scheduler and Redis connect
The diagram starts with client traffic reaching the Router, which reads and writes Redis for cache, idempotency keys and locks. The Scheduler has a Producer and a Consumer that share the Redis-backed queue, and both services use PostgreSQL, with writes going to the primary and reads to the replica. Redis runs as a primary with replicas, watched by Sentinels that promote a replica on failure. Check that each service reaches the Redis endpoint your clients use after a failover.
Router and Scheduler traffic to Redis, with the Redis HA group and PostgreSQL alongside.
Which Redis option fits which operating model
This table compares five ways to run the Redis layer behind Hyperswitch, from a single standalone node to managed and Valkey options. Read each row against your team's operating capacity, your availability target and how much payment state you can afford to lose on failover. The main takeaway is that a single node is only defensible for non-production or where you accept losing cache and queue state, and that any production option needs a failover design you have tested.
| Option | When it fits | Operating cost and HA or persistence trade-off |
|---|---|---|
| Standalone Redis | Development, test and sandbox environments where losing cache, idempotency keys and scheduler queue entries is acceptable | Lowest operating effort, but one node is a single point of failure for the hot path; persistence settings decide how much state survives a restart |
| Redis with replicas and Sentinel | Production when you are not using Redis Cluster and need automatic failover of the master to a replica | Your team runs replicas and Sentinel; Sentinel guidance calls for at least three Sentinel instances; failover can lose recent writes that were not yet replicated |
| Managed Redis (Redis Cloud or cloud provider service) | Teams that want the provider to run patching, failover and backups and accept a managed service boundary | Recurring service fees set by the provider; less control over persistence and version timing; confirm failover behavior, data residency and backup terms in writing |
| Redis Software | Self-managed deployments that need vendor-supplied compliance, reliability and resiliency features | Commercial, non-open-source product from Redis Ltd. with recurring license cost; confirm supported features and licensing scope before you select it |
| Valkey | Teams that want a BSD-3-Clause, Linux Foundation governed fork compatible with Redis OSS 7.2 and earlier | Same Sentinel and replication pattern with at least three Sentinel instances; Redis 7.4 and later data files need a different migration method, so confirm your version first |
Choosing Redis or Valkey: license and version
The first decision is which engine and which major line you run, because the license terms differ by version. Redis 7.2 and earlier remain under BSD-3-Clause. Redis 7.4 through 7.8, then called Redis Community Edition, were offered under the dual RSALv2 or SSPLv1 license, neither of which is OSI-approved. Redis 8.0 and later can be used under a license of your choice among RSALv2, SSPLv1 and AGPLv3, effective from the Redis 8 general availability release. The Redis licenses page sets out these terms, and the license you pick for a version is the one that governs your use of it. Confirm the exact version boundaries against that page before you write them into a design document.
Valkey is the alternative to weigh. It is licensed under BSD-3-Clause, was forked from open-source Redis just before Redis moved to source-available licenses, and is governed by an open community project under LF Projects, LLC. Valkey states it is compatible with Redis OSS 7.2 and earlier, and existing Redis client libraries connect without code changes. The hard limit is data files: Valkey's migration guide warns that Redis Community Edition 7.4 and later write data files that Valkey cannot read, so a move from those versions needs a different method than the guide covers. If you already run Redis 7.4 or later, plan that migration separately and test it on a copy of your data.
Before you commit, get legal review of the license terms for your exact use, including whether your Hyperswitch deployment or any modifications you make would trigger obligations under the network-use provisions. Then confirm with the Hyperswitch maintainers and the Hyperswitch releases page which Redis or Valkey versions each Hyperswitch release supports, and check the compatibility notes in each release before upgrading either component. Record the chosen engine, its major version and the Hyperswitch release it was validated against, because that combination is what your upgrade and support plan must cover.
How to set up Redis for a self-hosted Hyperswitch stack
This sequence takes Redis from an engine choice to a highly available endpoint that Hyperswitch uses for caching, idempotency, locking and the scheduler queue, with a failover test and a deep health check confirming it works.
Choose the Redis engine and version
Your platform team decides between Redis Open Source and Valkey before anything is deployed, because the license terms and upgrade paths differ. Redis 8.0 and later can be used under RSALv2, SSPLv1 or AGPLv3, while Redis 7.4.x through 7.8.x use the dual RSALv2 or SSPLv1 license and Redis 7.2.x and earlier use BSD-3-Clause. Valkey is BSD-3-Clause and is compatible with Redis OSS 7.2 and earlier. Have legal review the chosen license against how you run it. You are done when the engine, the exact version and the license decision are written down and approved, and the version is confirmed against the Hyperswitch compatibility notes for your release.
Size memory and choose persistence settings
Estimate how much memory the cache, idempotency keys, locks and scheduler queue will use, then add headroom for growth and failover. Decide how persistence is configured: RDB snapshots, AOF, or both, and how often data is written to disk. Confirm the eviction policy with your Hyperswitch team, because evicting a lock or idempotency key can change payment behavior. Record the memory limit, the persistence mode and the eviction policy in the deployment plan. You are done when a reviewer can point to these three values and the Kubernetes memory request and limit match the plan.
Deploy the primary and replicas
Deploy one primary and at least one replica in separate failure domains, such as separate nodes or availability zones where your platform supports it. Set the same version and persistence configuration on each node, and confirm that the replicas attach to the primary with replication enabled. Keep the Redis service inside the cluster network and restrict access with network policy so that only Hyperswitch workloads can connect. You are done when the replication status on the primary shows the expected number of connected replicas and each replica reports a healthy sync state.
Deploy at least three Sentinel instances
Deploy three or more Sentinel instances, placed on separate nodes so that a single node loss does not remove quorum. Point each Sentinel at the primary and set the quorum value to match your Sentinel count, following the Redis Sentinel documentation linked from this page. Set authentication on the Redis nodes and Sentinels before exposing them to clients. You are done when each Sentinel reports the same primary, knows about every replica, and a query to the Sentinels returns the current primary address.
Point Hyperswitch at the Sentinel endpoint
Configure the Hyperswitch router and scheduler to reach Redis through the Sentinel-aware connection settings, not through a fixed primary address. Store the Redis password in your secrets store and reference it from the deployment rather than from a plain values file. Roll the services one at a time so that a bad setting shows up on one pod first. You are done when the router and scheduler pods start cleanly, log a successful Redis connection, and process a test payment flow in the sandbox without errors related to Redis.
Test failover on the primary
Run a controlled failover while a low, representative load is running in a test environment. Stop the primary or trigger a Sentinel-managed failover, then watch which replica is promoted and how long the router takes to reconnect. Record the failover time, any failed requests and any idempotency or lock errors in the logs. Repeat the test after any change to the Redis version, persistence setting or Sentinel count. You are done when a replica is promoted automatically, Hyperswitch reconnects to the new primary without manual intervention, and the results are recorded for the go-live review.
Confirm the deep health check reports Redis
Call the Hyperswitch deep health endpoint and confirm that its Redis check reports healthy. Then stop a replica or block Redis access from one router pod and confirm that the check reports the failure, so that you know the readiness probe will catch it. Wire the same check into your monitoring so that a Redis outage raises an alert. You are done when the deep health response shows Redis as healthy in normal operation, shows a Redis failure when the dependency is blocked, and the alert fires in your monitoring tool.
What fails when Redis fails
Redis sits in several places on the Hyperswitch payment path, so a Redis fault rarely stays in one component. The cards below cover the failure modes the design should plan for, the likely effect of each, and what to verify in your own environment before go-live.
Cache loss shifts load to PostgreSQL
Redis holds cached data that Router would otherwise read from PostgreSQL. If the cache is emptied or unreachable, requests that hit the cache fall through to the database, and the database load can rise sharply during the incident. Confirm which lookups Router caches, how Router behaves when a cache read fails, and whether your PostgreSQL connection limits can absorb the extra reads without starving writes.
Scheduler queue interruption
The Scheduler uses Redis for its queue, so a Redis outage can pause scheduled work such as card data deletion and API key expiry notices. Tasks may be delayed rather than lost, but you should confirm how the Producer and Consumer handle tasks already in flight when Redis returns. Test the queue backlog after a deliberate restart and check that delayed tasks run once, not twice.
Idempotency and lock inconsistency
Idempotency keys and locks protect against duplicate payment processing. During a failover, a replica promoted to master may lack the most recent writes, so a key or lock written just before the failure can be missing. Ask your team to document how Hyperswitch treats a retried request whose idempotency record is absent, and test duplicate submissions across a forced failover before accepting the design.
Memory eviction of working keys
When Redis reaches its memory limit, the eviction policy decides which keys are removed. If the policy can evict keys Hyperswitch needs for locks, idempotency or queue state, the failure looks like random errors rather than an outage. Confirm the maxmemory-policy setting against the keys Hyperswitch writes, size memory with headroom for queue growth, and alert on eviction counts from the Redis INFO output.
Network partitions between Router and Redis
A partition can leave Router unable to reach Redis while PostgreSQL and the processors remain reachable. Depending on how the client handles timeouts, requests may stall, fail fast, or proceed without Redis-backed checks. Set connection and command timeouts deliberately, then reproduce the partition with a network fault injection tool and record how request latency and error rates change at the Router.
Sentinel failover timing
Redis Sentinel promotes a replica automatically when the master fails, and the Sentinel docs recommend at least three Sentinel instances. The gap between the old master failing and the new one accepting writes is the window in which requests and locks are most exposed. Confirm the Sentinel timeout settings, confirm that Hyperswitch reconnects to the new master without a restart, and measure that window during a controlled failover test.
- Sentinel instances recommended
- 3
Questions buyers ask about running Redis for Hyperswitch
What does running Redis for Hyperswitch cost, and what drives it?
Cost depends on the work and the hosting model, not on a single list price. The one-time parts are design, the choice between a managed service and self-managed nodes, the high availability build, and load and failure testing. The recurring parts are the infrastructure your cloud account or data center bills, patching and upgrades, monitoring, and on-call time. Cost rises with the number of environments, the need for a Sentinel quorum across zones, the size of the working set, and how many failure modes your team must rehearse. Ask any partner for a quote built from a written scope that lists each environment, the Redis topology, the monitoring integration, and the test plan. DeployOpen does not publish a price list, and a quote follows from that scope.
How long does it take to validate a Redis high availability setup?
The duration depends on how many failure paths you test and how much of the environment is new to your team. Validation covers a planned failover, an unplanned loss of the master, loss of a Sentinel instance, network partitions between zones, and the behavior of Router and Scheduler pods while Redis is unavailable. Each scenario needs a repeatable test, a recorded result, and a fix-and-retest loop. Teams that already run Sentinel or a managed Redis service usually validate faster because the operational runbooks exist. Ask for the timeline in the written scope, with the scenarios and the environments named, rather than a single duration.
What must our team provide for a Redis deployment on Hyperswitch?
Your team provides the infrastructure and the people who decide things about it. In practice that means:
- Cloud accounts or data center capacity where Redis nodes, Sentinel instances and monitoring will run
- Network design, including subnets, firewall rules between Router, Scheduler and Redis, and DNS for failover endpoints
- Secrets handling for Redis passwords and TLS material
- An owner for on-call, alert routing and escalation to the payments team
- A named decision maker for upgrades, since Redis and Valkey release lines change over time
Confirm these responsibilities in the scope before work starts, because gaps in on-call and network ownership cause more delays than the technical build.
Can our in-house team run Redis for Hyperswitch without a partner?
Yes, if your team has operated stateful services in production and can staff on-call for a payment path. The skills that matter are Sentinel or cluster operations, persistence tuning, memory limits and eviction policy, failover testing, and reading the metrics Hyperswitch depends on. Redis is a small component in terms of configuration, but a fault in it reaches checkout, idempotency and the scheduler, so the risk sits in the operating discipline. A partner can shorten the build and run the failure tests, while your team keeps ownership of the running system. Assess the gap by listing who has done a failover drill on Redis before, and who will answer a page at night.
Does the Redis license affect a SaaS product that uses Hyperswitch?
It can, and the answer depends on which Redis version you run and whether you modify it. Per the Redis licenses page, Redis 8.0 and later can be used under a license of your choice among RSALv2, SSPLv1 and AGPLv3. Versions from 7.4 to 7.8 are under RSALv2 or SSPLv1, which are not OSI-approved, and 7.2 and earlier remain under BSD-3-Clause. The Redis licenses FAQ says teams running unmodified artifacts from 7.2 or earlier see no impact, while teams offering modified Redis code as a network service must make that modified source available to the service's users. Valkey is BSD-3-Clause. Have counsel review your version choice and any modifications before you build the platform.
Should we choose Redis or Valkey for Hyperswitch?
Choose based on license terms, version support and your team's compatibility needs. Valkey is licensed under BSD-3-Clause, is governed as a community project under LF Projects, LLC, and is compatible with Redis OSS 7.2 and earlier. Its migration guide says existing Redis client libraries connect without code changes. The guide also warns that Redis Community Edition 7.4 and later write data files that Valkey cannot read, so those deployments need a different migration method that the guide does not cover. Confirm with Hyperswitch's supported configuration which engine and version it expects, because the choice affects upgrades, failover tooling and the Sentinel setup.
What happens to payments if Redis fails?
The impact depends on which Redis role fails, and that is the first thing to test. Cache loss usually slows requests as data is reloaded from PostgreSQL. Losing idempotency or locking state can allow duplicate or blocked operations, which is a payment correctness issue. Scheduler queue loss can delay tasks. Test each role separately under load, record the observed behavior, and define what the on-call team does in each case. Ask your partner to show these results in the test report rather than relying on general statements about resilience.
How DeployOpen scopes and supports Redis for Hyperswitch
DeployOpen plans, builds, documents and supports the Redis layer of a self-hosted Hyperswitch stack inside your own infrastructure. Each engagement starts from a written scope that covers which Redis roles run in the hot path, how they are persisted and made highly available, and how failures are detected and tested before go-live.
How we scope
- Map which Hyperswitch paths use Redis for caching, idempotency, locking and the scheduler queue
- Agree the Redis deployment model, persistence settings and high availability approach in writing
- Confirm the Redis version and license choice against your procurement and legal requirements
How we build
- Deploy Redis in the infrastructure you control, with the Sentinel topology your scope specifies
- Configure persistence, memory limits and eviction settings for the Hyperswitch workload
- Verify failover behavior and Router and Scheduler responses to a Redis outage in a test environment
How we hand over
- Document the topology, configuration, failover runbook and the data each Redis role holds
- Deliver monitoring signals and alert conditions for Redis that connect to your observability stack
- Walk your platform and security teams through the runbook and record the test evidence
How we support
- Offer ongoing support, upgrades and continuous testing for Redis or Valkey as a retainer
- Review Redis and Hyperswitch release notes and plan changes to the Redis layer before upgrades
- Repeat failover and load tests after infrastructure changes, with results recorded for your team

