Question: What is the difference between a Redis slave and a replica?
Answer
In Redis, the terms "slave" and "replica" essentially refer to the same concept but are used in different versions of the software. With the release of Redis 5.0, the term "slave" was replaced with "replica", but it's important to note that their functional roles remain the same.
Both terms refer to the mechanism by which Redis achieves data replication - an essential feature for data redundancy and failover support. When "replicaof" command is issued from a Redis instance, it turns that instance into a replica (or slave in older versions) of the specified master instance. All write operations performed on the master are propagated to its replicas.
Here's a simple example of how to make one Redis instance a replica of another:
redis-cli replicaof <master_host> <master_port>
Remember, there's no difference in functionality or performance between "slave" and "replica". The change in terminology was made purely for more inclusive language use in the software industry.
Was this content helpful?
Other Common Redis Questions (and Answers)
- What is the default port used by Redis?
- How to start Redis server?
- Is Redis persistent?
- How fast is Redis?
- How to install Redis on Mac?
- How to check if Redis is running?
- How to restart Redis?
- Does Redis persist data?
- How to install Redis on Ubuntu?
- How to stop Redis server?
- How to see Redis version?
- Does Redis have tables?
Free System Design on AWS E-Book
Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.
Switch & save up to 80%
Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement. Instantly experience up to a 25X boost in performance and 80% reduction in cost