本文介绍了多个数据库与使用 ID 用于分隔组织的一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在组织可以注册并用于管理数据的 Web 应用程序的情况下,以下两个选项的优缺点是什么?

In the situation of a web application that organizations can sign up for and use to manage data, what are the pros and/or cons of the two following options?

  • 每个组织一个数据库,其中每个组织的数据完全分离到单独的数据库中,一个(非常小的)集中式数据库保存了组织及其数据库标识符的基本列表.

  • One database per organization where the data for each organization is entirely separated into individual databases, with one (very small) centralized database that keeps a basic listing of the organizations and their database identifiers.

整个应用程序的一个数据库,其中所有实体都存储在一个大型数据库中,并使用每个表上的组织标识符列进行分隔.

One database for the entire application where all the entities are stored in one large database and separated using an organization identifier column on each table.

需要考虑的其他一些方面:

Some other aspects to consider:

  • 永远不会在数据库中的组织之间共享数据,登录凭据也不会.
  • 一些组织将允许公众在应用程序中注册一个帐户以提交数据,而其他组织则不允许.
  • 我们计划为组织公开一个公共 API,以便将他们当前的流程与我们的应用程序集成.组织将能够生成 API 密钥以允许访问其数据,但不会有跨组织的公共 API.
  • 公司将在应用程序中存储潜在的敏感数据.

根据您的经验和/或知识,做出此设计决策的正确方法是什么(或者根本没有正确"的方法?)

From your experience and/or knowledge, what is the right way to go about this design decision (or is there a "right" way at all?)

推荐答案

这里 是对 MSDN(多租户数据架构)的深入讨论.

Here is an in-depth discussion on MSDN (Multi-Tenant Data Architecture).

我想补充一点,没有正确/错误的方式.这完全取决于要求、现有专业知识和成本.

I would add that there is no right/wrong way. It all depends on requirements, existing expertise and cost.

这篇关于多个数据库与使用 ID 用于分隔组织的一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 15:18