I mentioned before that you could use the idea of data persistency to rebuild your data from total failure. There are two types. RDB and AOF.
RDB – persists a snapshot of your cache in a binary format. The snapshot is saved in an Azure Storage account. AOF – saves every write operation to a log. The log is saved at least once per second into an Azure Storage account.
This is quite an in-depth topic area and I suggest further reading to determine which one suits you: https://redis.io/topics/persistence#aof-disadvantages
To set this up you will see data persistence section within your Redis Cache
Then I select RDB and a pre-built storage account that I have within the same resource group for this solution.
If you navigate to the relevant storage account you will see a container for your Redis.
Don’t forget that your auth method does not have to be key based, whenever I build Azure Solutions I rather not use keys if possible, here I use the preview Managed Identity.
Couple of other points worth mentioning.
- You can’t enable both types, only one at a given time.
- Don’t forget the logged data within the account has associated costs assigned to it.
- If you are dealing with high throughput data then you will probably want your storage account to be premium.
- RDB files are backed up to storage are stored in the form of page blobs.