0

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

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your help. I will evaluate it once. It would be great if you can clarify few more things. 1) Do I need to use replica for enabling this option? 2) How will it affects other clients who access the redis-server during that point of time? 3) Is it session/client wise or it applies for all other sessions/clients
Assuming you mean the "Note", 1) no, 2) like any command, the script will block until it completes, 3) this is per script invocation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.