Base solution for your next web application
Open Closed

Caching & Multi-tenancy #6743


User avatar
0
feloff created

Would I be correct in assuming that cached items aren't tenancy safe, i.e. if one tenant loaded an entity into the cache, retrieving that entity can be done by all tenants?

E.g. if entity 1 belongs to tenant 1, and tenant 2 tries to load entity 1 from the database the tenant filter will block that request, but if entity1 is already stored in the entity cache created for that type of entity, there is no more tenantID filter and the entity can be retrieved from the cache by all tenants?

A simple workaround would be to append the tenant id to the key used, but that would mean not being able to use the EntityCache base classs?


1 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, @feloff, i think you are right. EntityCache does not seem to support multitenancy.

    I have created an issue at aspnetboilerplate repo and move the dicussion over.

    https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4416