Search code examples
cachingredisazure-functions

Redis Cache used by multiple function apps


[[Sorry in advance if it is silly one :) New to Redis cache here]]

I have couple of function apps for different purposes, which will retrieve the data from the same database and possibly from same tables. So, the question really here is, can I use the same cache instance in both function apps? when I say same instance, I'm expecting if I load the data from 1 function app into the cache will that be available in other function app as well? and the same way invalidating/updating the cache in one instance will it do automatically effect on the other as well? I'm also thinking to use Event grid events to update the cache as well as and when my source application updates the data in the database.

Redis being "in-memory" cache, does it work like that? Or the cache instance would be totally different for both the function apps?

Thank you -Srikanth


Solution

  • Yes Redis is a centralized storage. If your apps are connected to the same instance, all the key-value pairs can be shared. So in your case you need to retrieve/update the same keys in different apps.