暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

pglogical 2.x 逻辑复制已经很成熟了

原创 digoal 2022-01-20
485

作者

digoal

日期

2022-03-04

标签

PostgreSQL , 逻辑复制 , pglogical


pglogical 基于PG的logical replication protocol, 同时开发了自己的decoder plugin, 支持row_filter, column filter等. 同时打包了大量常用的订阅、发布、DDL的管理函数, 便于操作.
由于采用logical replication protocol, 所以使用pglogical过程中PG原有的logical replication相关系统函数、视图、日志等依旧可以用于排查问题.

https://github.com/2ndQuadrant/pglogical

核心摘要如下

The pglogical 2 extension provides logical streaming replication for PostgreSQL, using a publish/subscribe model. It is based on technology developed as part of the BDR project (http://2ndquadrant.com/BDR).

We use the following terms to describe data streams between nodes, deliberately reused from the earlier Slony technology:
- Nodes - PostgreSQL database instances
- Providers and Subscribers - roles taken by Nodes
- Replication Set - a collection of tables

Use cases supported are:
- Upgrades between major versions (given the above restrictions)
- Full database replication
- Selective replication of sets of tables using replication sets
- Selective replication of table rows at either publisher or subscriber side (row_filter)
- Selective replication of table columns at publisher side
- Data gather/merge from multiple upstream servers

Architectural details:
- pglogical works on a per-database level, not whole server level like physical streaming replication
- One Provider may feed multiple Subscribers without incurring additional disk write overhead
- One Subscriber can merge changes from several origins and detect conflict between changes with automatic and configurable conflict resolution (some, but not all aspects - required for multi-master).
- Cascading replication is implemented in the form of changeset forwarding.
- 支持通过 ddl 复制(必须通过函数执行ddl)

DDL
- Automatic DDL replication is not supported. Managing DDL so that the provider and subscriber database(s) remain compatible is the responsibility of the user.
- pglogical provides the pglogical.replicate_ddl_command function to allow DDL to be run on the provider and subscriber at a consistent point.

详细用法和使用限制, 请参考:
https://github.com/2ndQuadrant/pglogical

期望 PostgreSQL 增加什么功能?

PolarDB for PostgreSQL云原生分布式开源数据库

PostgreSQL 解决方案集合

德哥 / digoal's github - 公益是一辈子的事.

digoal's wechat

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论