Configuring selective replication v6.3.1

Use replication sets to control which tables replicate to which nodes, keeping sensitive or location-specific data within its region.

Each node group has a pre-configured replication set with the same name. By default, all tables belong to the top-level group's replication set and replicate to every node in the cluster.

To see the group hierarchy and their associated replication sets:

SELECT node_group_name, default_repset, parent_group_name
FROM bdr.node_group_summary;

To see which replication sets your tables currently belong to:

SELECT relname, set_name FROM bdr.tables ORDER BY relname, set_name;

To restrict a table to specific locations, add it to those locations' replication sets and remove it from the top-level group's replication set:

SELECT bdr.replication_set_add_table('<table_name>', '<location_a>');
SELECT bdr.replication_set_add_table('<table_name>', '<location_b>');
SELECT bdr.replication_set_remove_table('<table_name>', '<top_level_group>');

After this change, writes to the table on nodes in <location_a> replicate only to other nodes in <location_a>, and writes on <location_b> nodes replicate only within <location_b>.

Tables that remain in the top-level replication set continue to replicate everywhere. Use the top-level replication set for global reference data, such as product catalogs and configuration, that all locations need.