I'm using Redis to store json messages, which need to be consumed by other services. I want the data to store in Redis for 2 days and the data need to be deleted after the 2 days.
Is there any approach to achieve it?
I'm using Redis to store json messages, which need to be consumed by other services. I want the data to store in Redis for 2 days and the data need to be deleted after the 2 days.
Is there any approach to achieve it?
Assuming that you are storing the data in a String—which is likely if you're using ElastiCache—you can SET the value and EXPIRE it in a single command:
SETEX foo 172800 value