What are the benefits of including a tenant ID in a URL in a multi-tenant site?

Asked 2 years ago, Updated 2 years ago, 51 views

Creating multi-tenant sites.

For example, the following sites include the tenant ID in the URL so that each tenant has a different URL, but I don't understand why. What are the advantages and disadvantages?

/survey/adatum
/survey/fabrikam

http://msdn.microsoft.com/ja-jp/library/ff966483.aspx

The site you are creating is

  • Use the same schema for each tenant.
  • Each table has a UserID column to separate the data.
  • There are no major customizations planned for each tenant

c# asp.net

2022-09-30 19:10

3 Answers

If you do not include tenant information in the URL, you will have to store tenant information in the session.

Doing so will result in a bug in which multiple tenants cannot be accessed simultaneously in the same browser.This is because there is only one tenant information to store in the session, but it is still busy with two tenants.

If you use Ajax, you may see inconsistent information as if it were legitimate data.

It's an in-house system that covers it for operations, so I don't mind, but if you don't know how to use it, you should design it so that it doesn't change as much as possible.


2022-09-30 19:10

What comes to mind is

  • Simply easy to write apps
  • Relieved to know that users are looking at the content of their tenants
  • Easy to statically deploy customized CSS and JS per tenant
  • Easy to move servers (cluster counties) from unusually heavy tenants in LB at once

That's about it.

I can only think of the disadvantages below (lol).

  • Easy to predict tenant URLs (but not a big deal)
  • It may be difficult to change the URL when you say you don't like it
  • You may be more likely to deploy the wrong CSS or JS due to programming or deployment errors

I'd like to hear other people's opinions.


2022-09-30 19:10

I think the advantages are the ease of remembering URLs and the ability to identify tenants.You don't have to include the tenant name in the URL, but I think it's easier to understand than the number.

The disadvantage is that this sample seems to be using ASP.NET URL routing, so I think they are not conscious of customization.On the other hand, individual customizations can take a lot of time.


2022-09-30 19:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.