天天看點

PostgreSQL Oracle 相容性之 - 消息隊列 DBMS_AQ

标簽

PostgreSQL , Oracle , 相容性 , dbms_aq , channel , pay_load , listen , notify

https://github.com/digoal/blog/blob/master/201803/20180308_01.md#%E8%83%8C%E6%99%AF 背景

資料庫支援消息隊列的功能,利用消息隊列可以實作異步廣播,結合流計算實作異常資料推送等。

Oracle中,通過dbms_aq這個包支援消息隊列。在PPAS中,有對應的包,相容Oracle。

在PostgreSQL中,使用listen, notify同樣能夠支援消息隊列的功能。在對應的驅動中有相應的介紹。包括libpq, jdbc等都支援了異步消息的接口。

https://github.com/digoal/blog/blob/master/201803/20180308_01.md#oracle Oracle

http://www.oracle.com/technetwork/database/features/data-integration/oracle-aq-tech-wp11-2-191324.pdf

https://github.com/digoal/blog/blob/master/201803/20180308_01.md#ppas PPAS

https://www.enterprisedb.com/docs/en/9.6/DB_Compat_Oracle_Built_in_Package/Database_Compatibility_for_Oracle_Developers_Built-in_Package_Guide.1.13.html

https://github.com/digoal/blog/blob/master/201803/20180308_01.md#postgresql PostgreSQL

https://www.postgresql.org/docs/devel/static/libpq-notify.html https://www.postgresql.org/docs/devel/static/sql-notify.html https://www.postgresql.org/docs/devel/static/sql-listen.html

https://github.com/digoal/blog/blob/master/201803/20180308_01.md#%E6%B6%88%E6%81%AF%E9%98%9F%E5%88%97%E5%BA%94%E7%94%A8 消息隊列應用

1、結合流計算,對計算結果進行異步廣播

《從電波表到資料庫小程式之 - 資料庫異步廣播(notify/listen)》 《PostgreSQL 業務資料品質 實時監控 實踐》

2、資料同步

https://bucardo.org/

3、作為消息總線

《PostgreSQL Notify/Listen Like ESB》