0
0
Redisquery~30 mins

Why replication provides redundancy in Redis - See It in Action

Choose your learning style9 modes available
Understanding Redundancy with Redis Replication
📖 Scenario: You are managing a small online store that uses Redis to store product inventory data. You want to make sure your data is safe even if one Redis server stops working.
🎯 Goal: Build a simple Redis setup with one master and one replica to see how replication creates redundancy and protects your data.
📋 What You'll Learn
Create a Redis master server configuration
Create a Redis replica server configuration that replicates the master
Add a key-value pair to the master
Verify the key exists on the replica to confirm redundancy
💡 Why This Matters
🌍 Real World
Many online services use Redis replication to keep data safe and available even if one server crashes.
💼 Career
Understanding replication and redundancy is important for roles like database administrator, backend developer, and system engineer.
Progress0 / 4 steps
1
Set up Redis master server configuration
Create a Redis configuration file named redis-master.conf with the default settings and specify the port as 6379.
Redis
Need a hint?

The master server listens on port 6379 by default. Just specify port 6379 in the config file.

2
Set up Redis replica server configuration
Create a Redis configuration file named redis-replica.conf that sets the port to 6380 and configures it to replicate the master at 127.0.0.1 on port 6379 using the replicaof directive.
Redis
Need a hint?

Use replicaof 127.0.0.1 6379 to tell the replica where the master is.

3
Add data to the master server
Connect to the Redis master server on port 6379 and add a key called product:1001 with the value "In Stock" using the SET command.
Redis
Need a hint?

Use the Redis command SET product:1001 "In Stock" on the master server.

4
Verify data replication on the replica server
Connect to the Redis replica server on port 6380 and use the GET command to check that the key product:1001 has the value "In Stock", confirming replication and redundancy.
Redis
Need a hint?

Use GET product:1001 on the replica server to confirm the value.