软件即服务最佳应用程序设计
正在使用 ASP.NET MVC3 C# 和 MS SQL 2008
我 开发一个软件即服务站点。这是一款面向汽车经销商的汽车库存应用程序。我对该网站的架构有一些想法,但想听听其他意见。
每个经销商都将受到布局的限制,但可以上传徽标并选择一些颜色主题。
起初我想过为每个经销商创建单独的网站,但升级将是一场噩梦。
所以我的想法是,一个根据主机名动态变化的主站点。 IE。因此,如果输入 miamicars.carinventory.com,他们会看到他们的配色方案和徽标。
我将为用户和公司设置建立一个主数据库,但为每个包含大量数据(汽车库存等)的站点建立一个单独的数据库。这样我就可以单独备份和处理每个站点的数据,但应用程序的主要代码将位于一个位置。
此外,每个公司都会有一个目录来存储他们各自的图像。
欢迎任何反馈。
谢谢
Using ASP.NET MVC3 C# AND MS SQL 2008
I'm developing a Software As Service site. It's a Car Inventory app for Car Dealers. I have a few ideas of the architecture of the site but wanted a second opinion.
Each dealer will be restricted to a layout, but can upload a logo and select some color theme's.
At first I thought about creating separate sites for each dealer, but upgrading would be a nightmare.
So my thought is, one main site which dynamically changes based on the hostname.
ie. So if miamicars.carinventory.com is entered, they would see their color scheme and logo.
I would have one master database for the users and company settings, but a separate database for each site with the bulk of the data (car inventory, etc). This way I can backup and handle each site's data individually, but the main code of the application would be in one place.
Also, each company would have a directory to store their individual images.
Any feedback would be welcomed.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
考虑到这些公司是多家公司,我建议您查看多租户设计。我知道它看起来更复杂,但它可以帮助您随着应用程序的成长而干净地发展应用程序。这是另一个关于 ASP.NET MVC。这是 MSDN 中另一个有趣的内容。
总而言之,如果您正在考虑从多租户开始并在此基础上发展它,那就更好了。特别是如果您使用 Azure,这可能是使其可扩展的唯一方法。
华泰
Considering these are multiple companies, I would recommend looking into multi-tenant designs. I know that it looks more complex but it helps you to grow the application cleanly as you grow. Here is another blog entry that is pretty interesting about ASP.NET MVC. Here is another interesting on in MSDN.
All in all, it is better if you are thinking about multi-tenancy to start from and grow it based on that. Particularly if you are going on Azure, it might be the only way to make it scalable.
HTH
我从数据库的角度来看,你有这些选项。话又说回来,我从未在实现过程中编写过多租户应用程序和小精灵表面。
1. 为所有租户提供一个数据库(集群)。
设置单一数据库,将来采用主/副本集群。所有租户共享站点,数据的分离在于数据本身。
简化应用程序物理方面的管理。
简化编码。
阻碍可扩展性。
妨碍性能(轻微)。
2. 每个租户都有一个数据库。
每个租户都有一个数据库,可能位于不同的数据库服务器上。
推出新网站更加痛苦。
更容易扩展,因为数据将自然分区。租户 A 通常不需要访问租户 B 的数据。除非您尝试编写某种聚合报告,在这种情况下,您需要编写丑陋的分片代码。
良好的可扩展性。如果租户可以消耗足够的资源,您可以为他们提供相当高端的专用硬件。
就 Web 服务器而言,我会考虑使用具有 memcached 或类似功能的自定义 SessionProvider,并将服务器本身仅用作不保留状态的处理器。
The way I see it from a database perspective you've got these options. Then again I've never written a multitenant application and gremlins surface during implementation.
1. Have a single database (cluster) for all the tenants.
Set up a single database, with master/replica clustering in the future. All tenants share the site, the separation of data is in the data itself.
Simplify the management of the physical aspect of your application.
Simplify the coding.
Hamper scalability.
Hamper performance (slightly).
2. Have a database per tenant.
Each tenant gets a database, possibly on a different database server.
Much more of a pain to roll out new sites.
Simpler to scale since the data will be partitioned naturally. Tenant A usually wouldn't need access to data from tenant B. Unless you're trying to write some kind of aggregate reports, in which case you get to write ugly sharding code.
Good scalability. If a tenant can consume enough resources you can give them pretty high end dedicated hardware.
As far as the web servers, I'd look into using a custom SessionProvider with memcached or similar and using the servers themselves solely as processors that keep no state.
关于数据库,您是否考虑过使用NoSql数据库?
我目前正在编写一个非常大的网络应用程序,其中包含大量(TB 级数据),并且正在使用 MongoDb。
以下是一些选项:
并使用。超级容易扩展并且可以
做一些非常高级的查询。有
多种语言的驱动程序
包括.Net。
可以无限扩展。没那么富有
设置为 Mongo 的查询,我已经
听说设置起来比较困难,但没有
与它的经验。
Hadoop。雅虎使用,打开
来源来自 Apache。再多一点
复杂
对于其他东西,我使用 ASP.NET MVC。非常容易部署,并且编写代码速度很快。
In regards to database have you thought of using a NoSql database?
I am currently writing a very large web app with lots and lots (TBs of data) and am using MongoDb.
Here are some options:
and use. Super easy to scale and can
do some very advanced queries. Has
drivers for loads of languages
including .Net.
Can infinately scale. Not as rich
of a query set as Mongo and I've
heard harder to set up but no
experience with it.
Hadoop. Used by Yahoo, open
source via Apache. Little more
complicated
In regards to other stuff ASP.NET MVC is what I use. Very easy to deploy, and write code fast.