SaaS的:一个Web应用程序一个数据库VS.许多Web应用程序与多个数据库 [英] SaaS: one web app to one database VS. many web apps to many databases

查看:536
本文介绍了SaaS的:一个Web应用程序一个数据库VS.许多Web应用程序与多个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算开发一个相当小的SaaS服务。每个企业的客户都会有一个相关的数据库(客户数据库之间相同的架构,不同的数据)。此外,他们将指向Web应用程序一个独特的领域,在这里我看到这两个选项:

I am planning to develop a fairly small SaaS service. Every business client will have an associated database (same schema among clients' databases, different data). In addition, they will have a unique domain pointing to the web app, and here I see these 2 options:


  1. 该域名将指向一个独特的web应用程序,这将改变
    连接字符串到适当的客户端的数据库视
    域。 (也就是说,我需要部署只有一个Web应用程序。)

  2. 的域名将指向自己的Web应用程序,这是真的
    复制的每一个客户端,但用正确的相同的Web应用程序
    连接字符串到客户端的数据库中。 (也就是说,我需要
    多次部署Web应用程序。)

这是一个ASP.NET MVC 4.0 3.0的Web应用程序,将在IIS 7.0上运行。这将是相当小的,但我确实需要具有可扩展性。如果我有1或2去?

This is for an ASP.NET 4.0 MVC 3.0 web app that will run on IIS 7.0. It will be fairly small, but I do require to be scalable. Should I go with 1 or 2?

推荐答案

这MSDN文章是一个伟大的资源,进入有关的三种模式的优点细节:

This MSDN article is a great resource that goes into detail about the advantages of three patterns:


  1. 分居DB 。每个应用程序实例都有自己的数据库实例。更简单,但可能难以从数据库基础设施的角度来看,以管理。

  2. 分隔的模式即可。每个应用程序实例共享一个数据库,而是通过架构进行分区。需要更多一点的编码工作,并减轻一些完全独立的模式的挑战,但是如果你需要个人网站的备份仍然有困难/恢复之类的东西。

  3. 共享模式即可。您的应用程序负责划分基础上,应用实例中的数据。这需要最多的工作,但是最灵活的数据管理方面。

  1. Separated DB. Each app instance has its own DB instance. Easier, but can be difficult to administer from a database infrastructure standpoint.
  2. Separated schema. Each app instance shares a DB but is partitioned via schemas. Requires a little more coding work, and mitigates some of the challenges of a totally separate schema, but still has difficulties if you need individual site backup/restore and things like that.
  3. Shared schema. Your app is responsible for partitioning the data based on the app instance. This requires the most work, but is most flexible in terms of management of the data.

在你的应用程序如何处理这方面,DB设计可能会确定。我在过去所做的都共享数据库和共享模式。在分离数据库的方式,我通常单独应用程序实例为好。在共享模式的方法,它与逻辑修改哪些数据可基于登录和/或主机名相同的应用程序。

In terms of how your app handles it, the DB design will probably determine that. I have in the past done both shared DB and shared schema. In the separated DB approach, I usually separate the app instances as well. In the shared schema approach, it's the same app with logic to modify what data is available based on login and/or hostname.

这篇关于SaaS的:一个Web应用程序一个数据库VS.许多Web应用程序与多个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆