This article explains different ways to disable persistence to a disk file in the Redis database.

How to disable persistence in Redis Database?

There are two types of persistence in the Redis server.

  • Append only file(AOF) feature:

It saves every write operation in the Redis server to an append-only file, and it reloads at server startup to recreate the original data.

  • Redis database backup file(RDB)

It-dumps of all operations data in a backup file with compressed serialization format. It takes backup with the point-in-time recovery of a timestamp. rdb saves data to dump.rdb file

  • using redis.conf

We have to do the following things to disable complete persistence To disable the append to only file feature, change the appendonly value to no to disable persistence i.e default value

appendonly no

To disable the Redis remote data backup(rdb) feature, uncomment below in Redis.conf file

# save 900 1
# save 300 10
# save 60 10000

After changing the above configurations, Restart the server.

Another way using the config set command

redis-cli config set appendonly no: Disable aof feature redis-cli config set save “” : disable rdb feature redis-cli config rewrite: Rewrite and save the changes to redis.conf permanently.