在 PHP 中将 Firebird 与 MySQL 同步
我有两个数据库,一个是Firebird数据库,另一个是MySQL数据库。
Firebird数据库是信息变化的主要数据库。我必须将这些更改同步到其他 MySQL 数据库。
我无法控制 Firebird - 我只能从中选择。我无法添加触发器、事件或类似内容。我拥有 MySQL 数据库的所有控制权。
同步必须通过“互联网”完成,因为这两个服务器没有以任何方式连接并且位于不同的位置。
同步必须在同时托管 MySQL 数据库的服务器上用 PHP 完成。
目前,我只是检查每条记录(每 15 分钟),计算行的哈希值,比较两个哈希值,如果它们不匹配,我会更新整行。它有效,但看起来非常错误并且没有以任何方式优化。
还有其他方法可以做到这一点吗?我错过了什么?
谢谢。
I have two databases, one is a Firebird database, other is a MySQL database.
Firebird database is the main one where the information changes. I have to synchronize those changes to the other MySQL database.
I have no control over the Firebird one - I can just SELECT from it. I cannot add triggers, events or similar. I have all the control on the MySQL database.
The synchronization has to be done through 'internet' as these two servers are not connected in any way and are on different locations.
Synchronization has to be done in PHP on the server that also hosts the MySQL database.
Currently I just go through every record (every 15 minutes), calculate the hash of the rows, compare two hashes and if they don't match, I update the whole row. It works but just seems very wrong and not optimized in any way.
Is there any other way to do this? I am missing something?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我曾经做过同样的事情,我认为没有更好的解决方案。
您只能或多或少地优化您目前拥有的东西。例如:
I have made the same thing once and I don't think there is a generaly better solution.
You can only more or less optimize what you have so far. For example: