问题描述
假设我需要设计一个数据库,该数据库将托管多个公司的数据.现在出于安全和管理目的,我需要确保不同公司的数据被正确隔离,但我也不想启动 10 个 mysql 进程来在 10 台不同的服务器上托管 10 家公司的数据.使用 mysql 数据库执行此操作的最佳方法是什么.
Let us say I need to design a database which will host data for multiple companies. Now for security and admin purposes I need to make sure that the data for different companies is properly isolated but I also do not want to start 10 mysql processes for hosting the data for 10 companies on 10 different servers. What are the best ways to do this with the mysql database.
推荐答案
多租户数据库有多种方法.为了便于讨论,它们通常分为三类.
There are several approaches to multi-tenant databases. For discussion, they're usually broken into three categories.
- 每个租户一个数据库.
- 共享数据库,每个架构一个租户.
- 共享数据库,共享架构.租户标识符(租户键)将每一行与正确的租户相关联.
MSDN 有一篇关于 每种设计的优缺点,以及实现示例.
MSDN has a good article on the pros and cons of each design, and examples of implementations.
<小时>微软显然已经删除了我提到的页面,但它们在 archive.org 上.链接已更改为指向那里.
Microsoft has apparently taken down the pages I referred to, but they are on on archive.org. Links have been changed to point there.
作为参考,这是第二篇文章的原始链接一个>
这篇关于如何设计一个多租户的mysql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)