Subbi Reddy K
Subbi Reddy K

Reputation: 412

Redis using as disk persistance with RDB and AOF file

We are using redis server in production with 6 GB data size, Initially we thought redis can be used as memory cache only, If it restarts then we can repopulate from the persistants data store with minimal downtime.

Now we realized that re-population of data from persistence store is not a good idea at all, It is causing major service downtime.

We want to evaluate redis persistant option by using RDB and AOF combination.We tried taking RDB snapshot once in a hour and committing to the AOF file with one second interval in test environments. AOF file is growing too big in test environment only. We tried to analyze the AOF file content and noticed that lot of keys we don't want to persist to the disk, We need them only in redis memory.

Is there any way to stop logging certain type of keys (block list keys) while logging to the AOF file

Upvotes: 0

Views: 676

Answers (1)

Itamar Haber
Itamar Haber

Reputation: 49972

Generally, Redis does not provide a way to exclude certain types of keys from persistency. If you need some keys to persist to disk and others not to, you should use two independent Redis instances - one for each type and configure their persistency settings approriately. Divide and conquer.

Note: it is possible, however, to control what gets persisted in AOF inside the context if a Lua script - see the "Selective replication of commands" section of EVAL's documentation. That said, besides the consistency risks, it would be too much of a hassle to use this approach for what you need imo.

Upvotes: 3

Related Questions