有什么方法可以让MySQL服务器“推送"数据库更新到客户端程序吗? [英] Is there any way to let MySQL server 'push' DB updates to a client program?

查看:155
本文介绍了有什么方法可以让MySQL服务器“推送"数据库更新到客户端程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个典型的场景:假设用户正在将数据馈送到MySQL,而客户端则远程连接到MySQL.每当用户更新数据库中的字段时,我希望立即通知客户端.

A typical scenario: imagine a user is feeding data to MySQL, while a client is connected to MySQL remotely. Whenever the user updates a field in the DB, I would like for the client to be notified immediately.

将其视为Blackberry的推送邮件"功能.

Think this as the 'push-mail' function from Blackberry.

我不希望的是,客户端必须不时地"ping" MySQL服务器,以查看是否有任何更新.我相信这将是昂贵的计算.

What I do NOT want, is that the client has to 'ping' MySQL server once in a while to see if there is any update. I believe this will be to expensive, computation wise.

如何实现这样的想法?是否有任何基于MySQL的CALLBACK机制?如果不是,是否还有其他数据库(最好是开源的)支持这种机制?

How can I implement such an idea? Is there any MySQL-based CALLBACK mechanism? If not, is there any other database (better be open-source) that support this kind of mechanism?

推荐答案

对于对缓存失效技术感兴趣的主动连接的客户端:

For an actively connected client interested in cache invalidation techniques:

  • SQL Server支持查询通知
  • Oracle支持连续查询通知
  • MySQL支持复制流,但是它们与更新通知不同:它们无法为客户端动态设置和拆除,并且不能很好地监视特定应用程序感兴趣的单个行. li>
  • SQL Server support Query Notifications
  • Oracle support Continuous Query Notifications.
  • MySQL supports replication streams, but they're not the same as update notification: they cannot be set up and tear down dynamically for a client and they do not work well for monitoring individual rows a particular application is interested in.

对于对数据同步感兴趣的断开连接的客户端,所有供应商都支持某种复制.

For a disconnected client interested in data sync, all vendors support some sort of replication.

这篇关于有什么方法可以让MySQL服务器“推送"数据库更新到客户端程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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