I am developing a multi tenant application. I keep customers on Db1Context and this customers data on Db2Context.
D2Context will have a private database for each client.
For example, I created a subdomain https://tenant1.mysite.com - https://tenant2.mysite.com - tenant3,4,5. But
I could not get the value of request.host. returns null all the time. In short, how should I go about creating a separate database structure for a single application and each customer?
I searched a lot on google. but none of them provided a solution. I'm using asp.net core 5.0. thanks.
Member
23 Points
67 Posts
multi tenant dbcontext
Mar 01, 2021 02:11 PM|uid853898|LINK
Hello there.
I am developing a multi tenant application. I keep customers on Db1Context and this customers data on Db2Context.
D2Context will have a private database for each client.
For example, I created a subdomain https://tenant1.mysite.com - https://tenant2.mysite.com - tenant3,4,5. But
I could not get the value of request.host. returns null all the time. In short, how should I go about creating a separate database structure for a single application and each customer?
I searched a lot on google. but none of them provided a solution. I'm using asp.net core 5.0. thanks.
Contributor
3550 Points
934 Posts
Re: multi tenant dbcontext
Mar 01, 2021 02:30 PM|l.laxmikant|LINK
As you are going to have a different structure and database for each customer however you have the same application for all clients.
You should develop a microservice for each customer.
For more info on microservice architecture - https://geeksarray.com/blog/microservice-architecture-pattern-for-architects
All-Star
58464 Points
15787 Posts
Re: multi tenant dbcontext
Mar 01, 2021 04:31 PM|bruce (sqlwork.com)|LINK
If the host is empty, then probably yours server is behind a firewall or balance server. This can be configured to pass the actual host header.