0
0
Redisquery~30 mins

Redis persistence overview (RDB, AOF) - Mini Project: Build & Apply

Choose your learning style9 modes available
Redis Persistence Setup with RDB and AOF
📖 Scenario: You are managing a Redis database for a small online store. You want to ensure that your data is saved safely so it won't be lost if the server restarts or crashes.Redis offers two main ways to save data: RDB snapshots and AOF logs. You will set up both to understand how they work together.
🎯 Goal: Set up Redis persistence by configuring RDB snapshotting and enabling AOF logging. This will help you keep your data safe and recoverable.
📋 What You'll Learn
Create a Redis configuration snippet to enable RDB snapshotting every 60 seconds if at least 5 keys changed
Add a configuration line to enable AOF persistence
Set the AOF rewrite policy to trigger when the AOF file grows to twice its original size
Complete the Redis configuration with both RDB and AOF settings combined
💡 Why This Matters
🌍 Real World
Redis persistence ensures that data is not lost during server restarts or crashes, which is critical for applications like online stores, chat apps, and caching layers.
💼 Career
Understanding Redis persistence is important for roles like backend developers, DevOps engineers, and database administrators who manage data reliability and recovery.
Progress0 / 4 steps
1
Enable RDB Snapshotting
Write a Redis configuration line to save a snapshot every 60 seconds if at least 5 keys changed. Use the exact syntax: save 60 5.
Redis
Need a hint?

Use the save directive followed by the time in seconds and the number of changes.

2
Enable AOF Persistence
Add a Redis configuration line to enable Append Only File (AOF) persistence. Use the exact syntax: appendonly yes.
Redis
Need a hint?

Set appendonly to yes to turn on AOF persistence.

3
Set AOF Rewrite Policy
Add a Redis configuration line to set the AOF rewrite policy to trigger when the AOF file size grows to twice its original size. Use the exact syntax: auto-aof-rewrite-percentage 100.
Redis
Need a hint?

The auto-aof-rewrite-percentage sets the growth percentage to trigger rewrite. 100 means 2x the original size.

4
Complete Redis Persistence Configuration
Combine all previous lines into a single Redis configuration snippet with RDB snapshotting and AOF persistence enabled. The final code must include save 60 5, appendonly yes, and auto-aof-rewrite-percentage 100.
Redis
Need a hint?

Make sure all three configuration lines are present together.