Ashu
Ashu

Reputation: 1733

Redis Cache data back up

I have started reading about Redis Cache. At very basic level it stores data in memory like any other in memory cache. So my question is what will happen to the data stored in it if it crashes or restarted. Is there any persistence (data back policy) for it or the data will be lost? Any reference about this feature will be helpful.

Thanks in Advance!!

Upvotes: 0

Views: 193

Answers (1)

Santosh Joshi
Santosh Joshi

Reputation: 3320

There are two ways to achieve persistence

  • RDB persistence
  • AOF persistence

RDB persistence

It takes periodic snapshot of your in-memory data and then replaces your existing data.

AOF persistence

Every time there comes a write operation that modifies the dataset in memory, Redis logs that operation which can be played later.

So to answer your question, it all depends upon what configuration are you following. Both RDB and AOF have advantages and disadvantages. AOF is much more durable than RDB.

Have a look at below links for more details.

Referrences

Upvotes: 1

Related Questions