{
  "schema_version": 2,
  "id": "operate/rs/databases/active-active/disaster-recovery/client-library-based",
  "title": "Client library-based disaster recovery",
  "url": "https://redis.io/docs/latest/operate/rs/8.0/databases/active-active/disaster-recovery/client-library-based/",
  "summary": "Client library-based disaster recovery for Active-Active databases using Redis client libraries with built-in failover logic.",
  "content": "\nSome Redis client libraries support geographic failover and failback. These client libraries monitor all Active-Active database members and instantiate connections for all endpoints in advance to allow faster failover and failback.\n\nAdvantages:\n\n- No additional hardware or software components required.\n\n- No high availability considerations.\n\n- No scalability concerns.\n\n- Tighter control over connectivity, such as timeouts, connection retries, and dynamic reconfiguration.\n\n- OSS Cluster API support (currently only available in redis-py)\n\n- Low latency.\n\nConsiderations:\n\n- Requires code changes for failover and failback logic.\n\n- Concurrent access across replicas is possible, but can be mitigated using the distributed health status provided by the database availability API requests.\n\n- When a development framework uses Redis transparently, failover and failback might not be easy to configure.\n\nThe following diagram shows a client library-based disaster recovery approach:\n\n\u003cdiv class=\"flex justify-center\"\u003e\n\u003cimg src=\"../../../../../../images/active-active-disaster-recovery/client-library.svg\" alt=\"Diagram of client libraries routing traffic to Active-Active database members\" width=\"50%\"\u003e\n\u003c/div\u003e\n\nThe following diagram shows a client-based disaster recovery approach that also uses [connection pooling](https://redis.io/docs/latest/develop/clients/pools-and-muxing#connection-pooling):\n\n\u003cdiv class=\"flex justify-center\"\u003e\n\u003cimg src=\"../../../../../../images/active-active-disaster-recovery/client-library-connection-pool.svg\" alt=\"Diagram of client libraries with connection pooling routing traffic to Active-Active database members\" width=\"50%\"\u003e\n\u003c/div\u003e\n\nFor additional information, see the the introduction to\n[Client-side geographic failover](https://redis.io/docs/latest/develop/clients/failover)\nand also the following client library guides for failover and failback:\n\n- [Jedis (Java)](https://redis.io/docs/latest/develop/clients/jedis/failover)\n\n- [Lettuce (Java)](https://redis.io/docs/latest/develop/clients/lettuce/failover)\n\n- [redis-py (Python)](https://redis.io/docs/latest/develop/clients/redis-py/failover)\n\n",
  "tags": ["docs","operate","rs","rc"],
  "last_updated": "2026-08-24T11:13:03-07:00"
}
