1

I want to use Redis Cache. I want to store some data but it needs to be refreshed automatically at regular intervals.

If I have 100 rows and if any row has been updated in Cosmos DB, the row should get updated.

I want to know how to smoothly achieve this. Do I need to update the cache manually?

RKh
  • 13,818
  • 46
  • 152
  • 265
  • 2
    Might be duplicate with [this question](https://stackoverflow.com/questions/49299958/how-would-redis-get-to-know-if-it-has-to-return-cached-data-or-fresh-data-from-d) – for_stack Mar 19 '18 at 10:11

1 Answers1

2

I want to know how to smoothly achieve this. Do I need to update the cache manually?

Redis has no idea if the data has been updated in somewhere else. Yes, you need to do it manually.

Your client/application which is updating the main-DB should also invalidate/update Redis cache(key corresponding to updated data) accordingly.

MD Ruhul Amin
  • 4,386
  • 1
  • 22
  • 37