Understanding Redis High-Availability Architectures
<p>High-Availability is crucial in Redis to ensure the continuous availability of data and prevent downtime. Although Redis is known for its high performance, there are instances where a single server might not be sufficient to meet the data requirements of an organization. Running Redis across multiple servers provides a resilient architecture where the system can continue to operate without interruption and data loss in-spite of one or more server failures. This also has an added benefit of enhanced performance.</p>
<p>This article covers Redis High-Availability (HA) strategies. We will start off with Leader-Follower architecture which is based on data replication and learn how Redis Cluster builds on top of it. This will be followed by a discussion of Redis Sentinel, which uses a set of external processes (sentinels) to monitor Leader-Follower deployments before closing off by covering Proxy based setup.</p>
<h1>What is Redis?</h1>
<p><a href="https://redis.io/" rel="noopener ugc nofollow" target="_blank">Redis</a> is an open-source, in-memory data structure store. Its core data types include <code>String</code>,<code> Lis</code>t, <code>Has</code>h, <code>Se</code>t, Sorted Set <code>Geospatial </code>indexes, <code>HyperLogLog</code> and <code>Bitmap</code>. You can use Redis as a messaging system, thanks to its support for Redis Streams, Pub/Sub as well as <code>List</code> (which can act as a queue). Although it’s an in-memory store, you can choose from a spectrum of persistence options. Transactions and Pipeline capabilities help build performant applications at scale, while Lua scripting, server-side Functions and Redis Modules enable you to extend Redis’ functionality.</p>
<p>Now, let’s dive into the various Redis HA architectures.</p>
<h1>Leader-Follower topology</h1>
<p>A Leader-Follower architecture consists of multiple Redis nodes, where one node is designated as the Leader (also known as the Primary), while the others function as Followers (or Replicas). The Leader-Follower replication mechanism in Redis is the cornerstone of operating Redis in a distributed and highly-available manner. By default, replicas are configured to be read-only, which means they <em>reject</em> all <em>write</em>commands. This design ensures that the data on the replicas remains consistent with that of the primary node.</p>
<p>Writable replicas can introduce inconsistencies between the primary and the replica, hence they are <em>not</em> recommended for use.</p>
<p><a href="https://semaphoreci.medium.com/understanding-redis-high-availability-architectures-2b544fe3ec1e">Read More</a></p>