Finbuckle.MultiTenant
Finbuckle.MultiTenant copied to clipboard
How to use multitenancy over an Ocelot Api Gateway?
Hi, I work on a multitenant microservice architecture. I have also IdentityServer4 on my arch and tenants info are kept there with users. The request sended by client is being checked on both Ocelot and on Resource Api. So I need to know what tenant to move on in both Gateway and Resource Api.
I know that I can implement mutitenancy on both sides but we use remote store since we keep tenant dbcontext on IdentityServer. So I thougth that would cause some performance issues because a request would had to go to IdentityServer two times for checking tenantInfo and for Auth operations, both on Gateway and the resource side.
First I tried to implement Finbuckle.Multitenant on Gateway only and tried to carry TenantInfo by context to the resourse microservice but I am not sure if that's possible. I couldn't manage it. How can I implement an efficient solution to this problem? Or would this even cause a performance problem like I guess?
Thanks in advance.
hi I'm sorry I'm not familiar with Ocelot but perhaps someone else will be able to help you. I see what you mean about performance as a concern. I'd probably go with some sort of smart caching so the API gateway wouldn't have to constant query the tenant store but it's not a trivial thing to setup.
This issue has been automatically marked for closure because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.