0

Using Redis (Azure Redis Cache) for caching. I would like to organize my keys based on application/domain. How do i achieve this while using Redis Cache? Can someone elaborate whether usage of Databases and/or namespaces can help? IF so provide examples of how to use a Database and Namespaceing the keys?

SO looking at something like Application->Feature->KeyName like so.

TIA.

blogs4t
  • 2,329
  • 5
  • 20
  • 33

1 Answers1

0

I think I found the answer here: However, I will keep this question open to see if this attracts other responses. Thanks for the SO community!

So there are multiple things that you can do:

  • You can prefix the keys with app name like app1:userid:uuid etc
  • You can use different in memory db provided by redis. Redis supports upto 16 DBs.
  • You can store keys for different apps in different db. To fetch them connect with respective DB.
  • You can use both of the above methods.
blogs4t
  • 2,329
  • 5
  • 20
  • 33