0

我有一个奇怪的场景,我似乎找不到让它工作的最佳方法。

我有一个库存应用程序存储在 Linode 服务器上。这个应用程序处理不同的公司。每个公司都有自己的数据库。

所有公司在不同地点都有多家商店。所有商店都需要使用相同的应用程序,同时必须同步数据。

我需要复制数据,但所有商店/应用程序都需要能够同时写入/读取和复制。问题是他们中的大多数人几个小时都没有互联网连接。他们与世界完全脱节(只是局域网)。

传统的 MySQL 复制无法正常工作,因为它需要 Internet 连接才能保持运行。

我该怎么办???

拥有自己的软件解决方案可以在更高级别上复制数据是个好主意吗?如果是,我应该遵循任何最佳实践吗?

我也不能使用 mysql auto_increment step 和 offset 来生成 ID,因为一些客户不断开设越来越多的商店。我是否需要为每个实体生成自己的 GUID,以确保 id 不会通过为商店唯一 ID (STOREID-UNIQUEID) 加上前缀而发生冲突?

4

1 回答 1

1

MySQL's replication should be able to handle network downtimes as long as it has enough time, bandwidth and disc space to download the logs during uptime.

I'm not sure how the auto-reconnect handles extended downtimes, but you should be able to fix reconnection issues with a scheduled job which restarts the replication.

GUID's are a good option for multi-site key generation. The other option is to use a site (client) identifier along with the autoincrement for a PK.

于 2016-01-04T13:46:05.200 回答