0
0
RedisHow-ToBeginner · 3 min read

How to Disable Persistence in Redis: Simple Steps

To disable persistence in Redis, set save "" in the configuration file to turn off RDB snapshots and set appendonly no to disable AOF. This stops Redis from saving data to disk, making it purely in-memory.
📐

Syntax

Redis persistence can be disabled by modifying two main configuration directives:

  • save "": Disables RDB snapshotting by removing all save points.
  • appendonly no: Disables the Append Only File (AOF) persistence.

These settings are placed in the redis.conf file or set dynamically via commands.

plaintext
save ""
appendonly no
💻

Example

This example shows how to disable persistence by editing the redis.conf file and restarting Redis.

bash
# Open redis.conf and add or modify these lines:
save ""
appendonly no

# Then restart Redis server to apply changes
sudo systemctl restart redis

# Alternatively, disable persistence at runtime:
redis-cli CONFIG SET save ""
redis-cli CONFIG SET appendonly no
Output
OK OK
⚠️

Common Pitfalls

Common mistakes when disabling persistence include:

  • Not removing all save directives, which keeps RDB snapshots active.
  • Forgetting to disable AOF with appendonly no, so data still persists.
  • Not restarting Redis or applying config changes dynamically, so settings don't take effect.

Always verify persistence is off by checking CONFIG GET save and CONFIG GET appendonly.

bash
redis-cli CONFIG GET save
# Expected output: ["save", ""]
redis-cli CONFIG GET appendonly
# Expected output: ["appendonly", "no"]
Output
1) "save" 2) "" 1) "appendonly" 2) "no"
📊

Quick Reference

DirectivePurposeValue to Disable Persistence
saveControls RDB snapshot intervals"" (empty string)
appendonlyEnables AOF persistenceno

Key Takeaways

Set save "" to disable RDB snapshot persistence in Redis.
Set appendonly no to disable AOF persistence.
Restart Redis or use CONFIG SET commands to apply changes.
Verify persistence is disabled with CONFIG GET commands.
Disabling persistence makes Redis purely in-memory with no data saved to disk.