Introducing Dragonfly Cloud! Learn More

Question: How can high availability be achieved with Redis Enterprise?

Answer

High availability in Redis Enterprise can be achieved by setting up replication, auto-failover, and data persistence features. Let's look at each of these elements.

Replication

Replication involves creating multiple copies of your data across different nodes or clusters. In Redis Enterprise, you can set up a master-replica configuration where the replica continuously updates itself to match the data on the master node.

# Connect to your Redis cluster redis-cli -h master-host -p 6379 # Set up replication SLAVEOF replica-host 6379

Auto-Failover

Auto-failover mechanism reduces downtime by automatically switching to a replica if the master node fails. The Redis Sentinel subsystem handles this process in Redis Enterprise.

No explicit code is required as the auto-failover mechanism is configured through the Redis Enterprise dashboard.

Data Persistence

Data persistence involves storing data in a non-volatile location so that it can survive server restarts or crashes. Redis Enterprise supports two types of data persistence: RDB (Redis DataBase file) and AOF (Append Only File).

You can configure RDB and AOF persistence from the Redis Enterprise dashboard or using the 'CONFIG SET' command.

# Connect to your Redis cluster redis-cli -h master-host -p 6379 # Enable AOF persistence CONFIG SET appendonly yes

Remember, achieving high availability requires careful planning and consideration of your specific application and infrastructure requirements.

Was this content helpful?

White Paper

Free System Design on AWS E-Book

Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.

Free System Design on AWS E-Book

Start building today 

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.