I just posted the question above on Quora in hope to get some answers.
I would like to know the pros and cons of choosing a URL structure for a multi tenant web-application. I also think that this could impact scalability of the site when traffic grows.
The dimensions of the application I see are two main things:
– customers can register per application
– the load/traffic hotspots can be for both (e.g. there could be one customer using very many resources and there could be also a mini-app which uses much more resources than other mini-apps. So we need to be able to route traffic to different machines / parts of the cluster, depending on the traffic patterns of either users and/or apps.
I thought about the following:
Main domains for each app, for guest users / anonymous:
Once the customer is registered I thought about:
The other way round I could also imagine:
What are the advantages and disadvantages of both approaches especially with regards to scaling / load-balancing?
Does allow Approach 1 easier routing of traffic to different machines per customer (e.g. via Amazon Route53) than Approach 2?
If you have any thoughts on this question feel free to add an answer on this Quora question. Thanks.