开发一个多租户asp.net MVC应用程序时有什么需要注意? [英] What to keep in mind when developing a multi-tenant asp.net MVC application?
问题描述
下午好 - 今天我有一个pretty普遍的问题 - 我一直在负责创建Web应用程序来管理客户的一些基本信息。这是一个非常简单的应用程序,但我不知道什么是要牢记发展在工地附近在他们自己的域名或网址我们的子域支持多个用户?
Good afternoon - I have a pretty general question today - I've been tasked with creating a web application to manage some basic information on customers. It's a very simple application, but what I don't know is what to keep in mind to develop the site around supporting multiple users at their own domains or subdomains of our url?
我怎么会限制用户登录到每个人部分应用程序?
How would I restrict users from logging in to each others portion of the app?
我见过的堆栈溢出类似的问题数据库作用域的提及,可能有人阐述最佳实践这样一个实现?
I've seen mention of database scoping in similar questions on Stack Overflow, could anybody elaborate on best practices for an implementation like this?
是否有在MVC3任何新功能,支持多租户?我现在面临这个问题与MVC2和我的电子商务网站,我们决定,我们希望它白色标签和可定制的多店老板,不知道在哪里,在现有的应用程序中实现这些功能开始。任何输入AP preciated。
Are there any new features in MVC3 to support multi-tenancy? I am facing this issue with MVC2 and my eCommerce site where we decided we wanted it white-labeled and customizable for multiple shop owners, and don't know where to begin in implementing these features in an existing application. Any input is appreciated.
的修改的
要详细说明多租户,我的意思 - 在例如商店的背景下,多个用户www.mystore.com注册了自己的店铺,并分别赋予一个唯一的子域名来访问自己的实例商店,在user1.mystore.com,user2.mystore.com等。每个商店将有客户订单记录,这些客户将有登录。我需要从user2.mystore.com访问user1.mystore.com的客户历史记录中没有一个新的帐户,同样prevent user2.mystore.com限制user1.mystore.com的客户。
To elaborate on multi-tenancy, what I mean - in the context of a store for example, multiple users sign up for their own store at www.mystore.com and are each given a unique subdomain to access their own instance of the store, at user1.mystore.com, user2.mystore.com etc. Each store would have customers with order histories, and those customers would have logins. I would need to restrict customers of user1.mystore.com from logging in at user2.mystore.com without a new account, and likewise prevent user2.mystore.com from accessing user1.mystore.com's customer history.
推荐答案
我实现了一个完整的MVC多坦应用程序。这里有一些链接,我发现得心应手,一些示例应用程序:
I implemented a complete MVC multi-tennant app. Here are some links I found handy and some sample apps:
<一个href=\"http://msdn.microsoft.com/en-us/library/aa479086.aspx\">http://msdn.microsoft.com/en-us/library/aa479086.aspx
<一个href=\"http://$c$cofrob.com/archive/2010/02/14/multi-tenancy-in-asp.net-mvc-controller-actions-part-i.aspx\">http://$c$cofrob.com/archive/2010/02/14/multi-tenancy-in-asp.net-mvc-controller-actions-part-i.aspx
<一个href=\"http://www.developer.com/design/article.php/10925_3801931_2/Introduction-to-Multi-Tenant-Architecture.htm\">http://www.developer.com/design/article.php/10925_3801931_2/Introduction-to-Multi-Tenant-Architecture.htm
<一个href=\"http://msdn.microsoft.com/en-us/library/aa479086.aspx#mlttntda_cc\">http://msdn.microsoft.com/en-us/library/aa479086.aspx#mlttntda_cc
<一个href=\"http://lukesampson.com/post/303245177/subdomains-for-a-single-application-with-asp-net-mvc\">http://lukesampson.com/post/303245177/subdomains-for-a-single-application-with-asp-net-mvc
HTTP://$c$c.google.com/p/multimvc/
http://www.paulstovell.com/widgets
<一个href=\"http://www.agileatwork.com/bolt-on-multi-tenancy-in-asp-net-mvc-with-unity-and-nhibernate/\">http://www.agileatwork.com/bolt-on-multi-tenancy-in-asp-net-mvc-with-unity-and-nhibernate/
<一个href=\"http://ayende.com/blog/3530/multi-tenancy-approaches-and-applicability\">http://ayende.com/blog/3530/multi-tenancy-approaches-and-applicability
<一个href=\"http://weblogs.asp.net/zowens/archive/tags/Multi-tenancy/default.aspx\">http://weblogs.asp.net/zowens/archive/tags/Multi-tenancy/default.aspx
HTTP://cloudsamurai.$c$cplex.com/
HTTP://cloudninja.$c$cplex.com/
<一个href=\"http://msdn.microsoft.com/en-us/library/hh534484.aspx\">http://msdn.microsoft.com/en-us/library/hh534484.aspx
<一个href=\"http://blog.maartenballiauw.be/post/2009/05/20/ASPNET-MVC-Domain-Routing.aspx\">http://blog.maartenballiauw.be/post/2009/05/20/ASPNET-MVC-Domain-Routing.aspx
<一个href=\"http://blog.tonywilliams.me.uk/asp-net-mvc-2-routing-subdomains-to-areas\">http://blog.tonywilliams.me.uk/asp-net-mvc-2-routing-subdomains-to-areas
即使从头开始,你是在伤害的世界。 MVC框架确实很少帮你解决问题。
Even starting from scratch, you are in for a world of hurt. The MVC framework does very little to help you address the issues.
这篇关于开发一个多租户asp.net MVC应用程序时有什么需要注意?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!