Skip to main content

Configuring YugabyteDB to use Yugabyte Reader

Striim reads change data from YugabyteDB.

Yugabyte Reader requires logical replication. For general information about logical replication, see YugabyteDB / Explore / Change data capture / PostgreSQL protocol / Key concepts / PostgreSQL logical replication concepts. To capture CDC changes, enter the following in a YugabyteDB client to create a replication slot:

SELECT pg_create_logical_replication_slot('SLOT_NAME', 'wal2json');

Enter the following command to create a role (user) for use by Striim, replacing ****** with a strong password:

CREATE ROLE striim WITH LOGIN PASSWORD '******' REPLICATION;

Yugabyte setup for schema evolution

Using Schema evolution with Yugabyte Reader requires a tracking table in the source database. To create this table, run the following commands in a YugabyteDB client:

CREATE SCHEMA IF NOT EXISTS striim;
CREATE TABLE IF NOT EXISTS striim.ddlcapturetable
  (
    event           TEXT,
    tag             TEXT,
    classid         OID,
    objid           OID,
    objsubid        INT,
    object_type     TEXT,
    schema_name     TEXT,
    object_identity TEXT,
    is_extension    BOOL,
    query           TEXT,
    username        TEXT DEFAULT CURRENT_USER,
    db_name TEXT DEFAULT Current_database(),
    client_addr     INET DEFAULT Inet_client_addr(),
    creation_time   TIMESTAMP DEFAULT now(),
    id SERIAL PRIMARY KEY
  ); 
GRANT USAGE ON SCHEMA striim TO PUBLIC;
GRANT SELECT, INSERT ON TABLE striim.ddlcapturetable TO PUBLIC;