对许多站点使用中央数据库服务器:合理吗? [英] Using a central database server for many sites: plausible?
问题描述
基本上,我需要在多达数十个站点上同步数据库数据的某些部分.理想的解决方案是创建一个中央服务器来托管该数据.
Basically, I need some parts of database data synchronized on up to several dozens of sites. The perfect solution would be creating a central server to host that data.
每个页面加载程序都必须从两个数据库服务器中获取数据-本地和远程数据库服务器中的数据以及向远程服务器的写入也很常见.
Each pageload will have to fetch data from both database servers - the local and remote one and writes to the remote server will be quite common too.
虽然db服务器可以在所需的硬件上达到所需的速度,但是我对瓶颈很谨慎:
While the db server can be as fast as desired hardware-wise, I'm cautious of the bottlenecks:
- 必须在每个页面加载项上建立多个数据库连接.
- 在两个物理位置之间传播的信号的延迟时间.
我担心吗?将数据库与cronjobs或其他技术同步会更明智吗?
Am I right to worry? Would it be wiser to synch the databases with cronjobs or other technologies?
除了分配赏金外,我还要添加一个问题,希望有现实生活经验的专家能够做到这一点:
推荐答案
任何建议离线同步的方法都在浪费mysql复制的好处
(鉴于您提到的情况不清楚)
您的解决方案可以很简单,只需分别进行读取/写入
(given the unclear situation you have mentioned)
your solution can be as simple as keep READ/WRITE separately
这意味着在本地数据库上,
that's mean on the local database,
- 确保仅对要从集中式数据库同步的数据库启用本地读取功能
- 写操作将提交到集中式数据库(而不是本地数据库)
- 集中数据库将把更新复制到所有本地数据库
问题
- 由于网络延迟导致的复制延迟
好处
- 作为写入操作的数据完整性只能在集中服务器上完成,并使用复制将更改复制到各种本地数据库中
- 本地数据库可以允许单独的写操作(另一组数据/数据库)
- 从本地数据库读取要比集中式数据库快得多(考虑到读取操作要比写入操作更频繁)
这篇关于对许多站点使用中央数据库服务器:合理吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!