Alexander Mills
Alexander Mills

Reputation: 99960

Redis callback upon persistence on disk

I am using Redis at work and I am wondering if there is a built-in way to incorporate a hook or callback upon Redis persisting an in memory key on disk? In the end it might be unnecessary but I'd like to update a key in Redis once a different key has been stored on disk? Is this possible?

Upvotes: 0

Views: 63

Answers (1)

Nick Bondarenko
Nick Bondarenko

Reputation: 6351

No, it`s not possible. Yes, it's unnecessary to update key in Redis if in memory and disk data is different. Also, you can (but your realy do not want to this in production in most of cases) force saving data to disk with BGSAVE or SAVE.

Please read about redis persistence and persistence demystified to understand how redis save data on disk and what guarantees the relevance of the data you have.

Upvotes: 2

Related Questions