Redis - Avoid Data Loss using Cluster (Using Gossip Protocol) Redis - Avoid Data Loss using Cluster (Using Gossip Protocol) kubernetes kubernetes

Redis - Avoid Data Loss using Cluster (Using Gossip Protocol)


Redis clustering would help with it, but it is a bit of a pain to set up and it's not a complete replacement for backups.

In your case a much simpler solution in my opinion would be to incorporate a recovery procedure in your redis pod startup. You do not have a permanent data loss as you have your MariaDB source of truth, so you can add an init containerthat runs a script to recover redis data from MariaDB.

Another approach that would limit your problem significantly would be to use a persistent volume to store redis data as redis can snapshot it's in-memory state in regular intervals. With use of StatefulSet instead of Deployment to manage your Redis node(s) pods would get the storage reattached on restart/rescheduling and you'd experiens no data loss (or at most the tiny window since the last snapshot)