I'm trying to create a multi-tenant application and which will be hosted in a single instance. To complete this application I need to implement a Redis cache system. I have two solutions for multi-tenant caching. They are,
- I can prefix the keys with tenant name like tenant1:myKey etc
- I can use different in-memory DB provided by Redis. I can store different tenant details in different DB. To fetch them connect with the respective DB.
If I go with the second option, is there any disadvantages/performance issue? and if you can suggest any other solutions please help me!!
Note: I don't want to use Redis clustering