策略同步保持两个MySQL数据库(在不同的地点)? [英] Strategies for keeping two mySQL databases (in separate locations) in sync?

查看:121
本文介绍了策略同步保持两个MySQL数据库(在不同的地点)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  <一href=\"http://stackoverflow.com/questions/325791/which-is-the-best-way-to-bi-directionally-synchronize-dynamic-data-in-real-time\">Which是用来双向同步定向实时动态数据的最佳方式MySQL的

我需要建议:

如何保持在2个地点同步增长2个MySQL数据库(结构相同)?

我在做什么:

我有两个位置创建一个业务的应用程序。他们需要共享/更新数据库中的信息,但所有人希望它是内部没有外部的,因为他担心能在互联网中断的情况下运行。

What am I doing:
I am creating an application for a business with two locations. They need to share/update information in a database BUT the proprietor wants it to be internal not external, as he is worried about being able to run in case of an internet outage.

我的策略迄今:

我设置了两个服务器(每个位置)每个正在运行的本地的Apache + MySQL的。 web应用程序是无法访问在互联网上,只能在本地。 MySQL的是通过SSL访问通过互联网(使用复杂的密码)。

My Strategy so far:
I've set up two servers (one in each location) Each running local Apache + MySQL. The webapp is NOT accessible over the internet, only locally. The mySQL is accessible over SSL via the internet (with a complex password).

本地Web应用程序运行,并与当地的MySQL读取交互。对于写操作,在本地写然后到远程服务器(写入2×)。

The local webapp runs and interacts with local mySQL for reads. For writes, it writes locally then to the remote server (writing 2x).

我关心创建重复/损坏的条目时记录ID可能会被复制/不同,等等。这就是为什么我不靠记录ID,而是在一个单独的唯一的号码,我控制(不能自动-Increment)。

I am concerned about creating duplicate/corrupted entries when record ids might be duplicated / different, etc... This is why I don't rely on record id, but rather on a separate unique number that I control (not auto-increment).

底线......这是我能想出这样做广泛的研究之后最好的。我对吗?或有人可以提供建议?

Bottom line... This is the best I could come up with after doing extensive research. Am I right? Or can someone offer advice?

推荐答案

这就是所谓的复制,和MySQL(像任何成熟的数据库管理系统)有它的原生支持。参见:<一href=\"http://dev.mysql.com/doc/refman/5.0/en/replication.html\">http://dev.mysql.com/doc/refman/5.0/en/replication.html

This is called replication, and MySQL (like any mature database management system) has native support for it. See: http://dev.mysql.com/doc/refman/5.0/en/replication.html

这篇关于策略同步保持两个MySQL数据库(在不同的地点)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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