Sprinkle Docs
  • What is Sprinkle?
  • Quick Start
  • Analysing your data
    • šŸ”­Analytics Overview
    • šŸ’ Data Models
      • *ļøVariables
      • 🌲Hierarchies
      • 🤿Column Mask
    • šŸŽ‰Switch to New Reports & Dashboards
    • šŸ†•Reports
      • Overview
      • Build Using Tables
        • Create a new Report
        • Layout and options
        • Build and Format - Overview
        • Apply Row Limits
        • Identify Date Columns
        • Filter your data
        • Visualizations
          • Table
          • Pivot
          • Line Chart
          • Bar Chart
          • Column Chart
          • Area Chart
          • Combo Chart
          • Scatter & Bubble Plot
          • Pie Chart
          • Funnel Chart
          • Stat Card
          • Point Map
          • Heat Map
          • Radial gauge chart
        • Advanced Features
          • Custom Analysis
          • Variables
          • Table & Quick Calculations
          • Drill - Hierarchical & Date
          • Break Out
          • RLS in Table reports
          • Scheduled Exports
          • Embedding Table Reports
      • Build Using Models
        • Create a new report
        • Layout and options
        • Visualizations
        • Advanced Features
      • Build SQL Reports
        • Create a new Report
        • Layout and options
        • Writing a SQL Code on Editor
        • Visualizations
        • Variables in SQL Reports
    • šŸ†•Dashboards
      • šŸŒ€Filters
      • šŸ‘†Click Behaviour
      • ā°Data Alerts
      • šŸ—“ļøDate Drill
      • šŸ“¤Scheduled Exports
      • šŸ”—Embed link
      • šŸ–„ļøDashboard layout
      • šŸ“±Mobile Dashboards
  • Transforming your data
    • šŸ”°SQL Transform
    • šŸ““Python Notebooks
  • Integrating your data
    • ā˜ļøDestination Warehouses
      • AWS Athena
        • Manage storage of Flow tables
      • AWS Redshift
      • Azure Synapse
      • Databricks
      • Google BigQuery
      • MySQL
      • Postgres
      • Snowflake
      • SQL Server
      • K8 Setup
        • AWS EKS
        • Google GKE
        • Azure AKS
    • āš™ļøWarehouse & Storage Setup
  • Ingesting your data
    • ā˜„ļøData Imports
      • Databases
        • Azure Cosmos DB
        • Azure Table Storage
        • Google BigQuery
        • Mongo DB
        • MySQL DB
        • Oracle DB
        • Postgres DB
        • SQL Server DB
        • Features
          • Ingestion Modes
          • Add Multiple Datasets
          • CDC Setup
            • CDC setup in Mysql
            • CDC setup in Postgres
            • CDC setup in Mongo
            • CDC setup in SQL Server
          • Destination Create Table Clause
          • SSH Tunnel Setup
      • Files
        • AWS S3
        • AWS S3 External
        • Azure Blob
        • FTP
        • Google Cloud Storage
        • Google Sheet
        • SFTP
      • Applications
        • Apple Search Ads
        • Appsflyer
        • Branch
        • Clevertap
        • Facebook Ads
        • Freshdesk
        • Freshsales
        • Google Ads
        • Google Ads V2
        • Google Analytics
        • Google Analytics 4
        • Google Analytics MCF
        • Google Search Console
        • Hubspot
        • Impact Ads
        • Intercom
        • Klaviyo
        • Leadsquared
        • LinkedIn Ads
        • Magento
        • Mailchimp
        • Marketo
        • Mixpanel
        • MoEngage
        • Rocketlane
        • Salesforce
        • SAP S4
        • Shopify
        • Snapchat Marketing
        • TikTok Ads
        • WooCommerce
        • Zendesk Chat
        • Zendesk Support
        • Zoho Analytics
        • Zoho Books
        • Zoho CRM
        • Zoho Desk
        • Zoho Invoice
        • Zoho Subscription
      • Events
        • Apache Kafka
        • AWS Kinesis
        • Azure EventHub
    • šŸ“¤File Uploads
    • šŸ¤–API Pulls
    • šŸ•øļøWebhooks
  • Collaborating on data
    • šŸ“¤Sharing
    • šŸ’¬Comments
    • ⚔Activity
    • šŸ·ļøLabels
  • Managing Schedules and Data Refreshes
    • ā±ļøSchedules
    • šŸ””Notifications
  • User Management
    • šŸ”‘Access Management
    • šŸ§‘ā€šŸ¤ā€šŸ§‘Groups
    • šŸ“‚Folders
    • šŸ”„Syncing users, groups and RLS
    • šŸ“§Azure AD Integration
  • Data Security & Privacy
    • šŸ”Security at Sprinkle
    • šŸ“„GDPR
    • šŸ“„Privacy Policy
  • Release Notes
    • šŸ“¢Release Notes
      • šŸ—’ļøRelease Notes - v12.1 (New)
      • šŸ—’ļøRelease Notes - v12.0
      • šŸ—’ļøRelease Notes - v11.0
      • šŸ—’ļøRelease Notes - v10.8
      • šŸ—’ļøRelease Notes - v10.7
      • šŸ—’ļøRelease Notes - v10.6
      • šŸ—’ļøRelease Notes - v10.5
      • šŸ—’ļøRelease Notes - v10.4
      • šŸ—’ļøRelease Notes - v10.3
      • šŸ—’ļøRelease Notes - v10.2
      • šŸ—’ļøRelease Notes - v10.1
      • šŸ—’ļøRelease Notes - v10.0
      • šŸ—’ļøRelease Notes - v9.31
      • šŸ—’ļøRelease Notes - v9.30
      • šŸ—’ļøRelease Notes - v9.29
      • šŸ—’ļøRelease Notes - v9.28
      • šŸ—’ļøRelease Notes - v9.27
      • šŸ—’ļøRelease Notes - v9.25
      • šŸ—’ļøRelease Notes - v9.24
      • šŸ—’ļøRelease Notes - v9.23
      • šŸ—’ļøRelease Notes - v9.22
      • šŸ—’ļøRelease Notes - v9.21
      • šŸ—’ļøRelease Notes - v9.20
      • šŸ—’ļøRelease Notes - v9.19
      • šŸ—’ļøRelease Notes - v9.18
      • šŸ—’ļøRelease Notes - v9.17
      • šŸ—’ļøRelease Notes - v9.16
      • šŸ—’ļøRelease Notes - v9.14
      • šŸ—’ļøRelease Notes - v9.13
      • šŸ—’ļøRelease Notes - v9.12
      • šŸ—’ļøRelease Notes -v9.8
      • šŸ—’ļøRelease Notes - v9.7
      • šŸ—’ļøRelease Notes - v9.6
      • šŸ—’ļøRelease Notes - v9.5
      • šŸ—’ļøRelease Notes - v9.4
      • šŸ—’ļøRelease Notes - v9.3
      • šŸ—’ļøRelease Notes - v9.2
      • šŸ—’ļøRelease Notes - v9.1
      • šŸ—’ļøRelease Notes - v9.0 (Major)
      • šŸ—’ļøRelease Notes - v7.23
      • šŸ—’ļøRelease Notes - v7.21
      • šŸ—’ļøRelease Notes - v7.20
      • šŸ—’ļøRelease Notes - v7.15
      • šŸ—’ļøRelease Notes - v7.14
      • šŸ—’ļøRelease Notes - v7.13
Powered by GitBook
On this page
  • Postgres CDC setup on Linux
  • CDC setup in AWS Postgres
  1. Ingesting your data
  2. Data Imports
  3. Databases
  4. Features
  5. CDC Setup

CDC setup in Postgres

Postgres CDC setup on Linux

1. Need to set the following in postgresql.conf. To find the conf file, go to postgres and run query SHOW config_file. It will give a path to the conf file.

wal_level=logical

max_replication_slots=5

max_wal_senders=5

2. Add the following in the pg_hba.conf conf file. First create the sprinkle user as mentioned in step5 and use that in the below configuration settings. Replace 0.0.0.0 with IPs of sprinkle whitelisted hosts.

host replication [user] 0.0.0.0/0 md5

host replication [user] ::0/0 md5

3. Post this restart Postgres DB

sudo service postgresql restart

4. To check Logical replication is enabled, run the below command with the user who has replica permission. That should give** Logical **as. output if it is enabled.

show wal_level;

5. Login to Postgre console and login with super-user or member of rds-super-user (Hint: \du will give the details of each user). Need to create a sprinkle user or use an existing user which will be used for CDC ingestion. Below permissions need to be granted to that user.GRANT rds_replication TO user_name;

GRANT USAGE ON SCHEMA ā€˜public’ TO user_name;

GRANT SELECT ON ALL TABLES IN SCHEMA ā€˜public’ TO user_name;

ALTER DEFAULT PRIVILEGES IN SCHEMA ā€˜public’ GRANT SELECT ON TABLES user_name;

Now you can create a slot or configure any slot name with the plugins : wal2json or pgoutput. If the slot does not exist, sprinkle will create a slot with the passed name with the user configured.

7. Need to grant below permissions to the user. For pgoutput plugin it is important to create publication and users must have create permissions for the database.

Grant create permission to the user on schema.

GRANT CREATE ON SCHEMA PUBLIC TO user_name;

Publication must be created for the database(name should be the same).

CREATE PUBLICATION dbz_​publication FOR ALL TABLES;

8. If you are creating a new slot then you can create a slot using pgoutput plugin as below.

SELECT pg_create_logical_replication_slot(slot_name, 'pgoutput');

9. Post this verify that your slot is created and you can access from particular user you had given permission run

select * from pg_replication_slots;

Note: When a slot is used for sprinkle CDC ingestion then it should not be used in any other cases.

ā€

CDC setup in AWS Postgres

Note: This CDC setup is allowed only in master instances not in read replica.

1. In configuration change rds.logical_replication to 1.

2. Post this DB reboot should be done.

3. To check Logical replication is enabled, run the below command with the user who has replica permission. That should give Logical as output if it is enabled.

show wal_level;

4. Login to Postgre console and login with super-user or member of rds-super-user (Hint: \du will give the details of each user). Need to create a sprinkle user or use an existing user which will be used for CDC ingestion. Below permissions need to be granted to that user.GRANT rds_replication TO user_name;

GRANT USAGE ON SCHEMA ā€˜public’ TO user_name;

GRANT SELECT ON ALL TABLES IN SCHEMA ā€˜public’ TO user_name;

ALTER DEFAULT PRIVILEGES IN SCHEMA ā€˜public’ GRANT SELECT ON TABLES user_name;

Now you can create a slot or configure any slot name with the plugins : wal2json or pgoutput. If the slot does not exist, sprinkle will create a slot with the passed name with the user configured. rds_replication permission should be sufficient for creating slots.

6. If you are using pgoutput plugin then need to grant below permissions to the user. For pgoutput it is important to create publication and users must have create permissions for the database.

Grant create permission to the user on schema.

GRANT CREATE ON SCHEMA PUBLIC TO user_name;

Publication must be created for the database(name should be the same).

CREATE PUBLICATION dbz_​publication FOR ALL TABLES;

7. If you are creating a new slot then you can create a slot using any of the two plugins.

SELECT pg_create_logical_replication_slot(slot_name, 'wal2json');   

OR

SELECT pg_create_logical_replication_slot(slot_name, 'pgoutput');

But make sure that if you are using pgoutput plugin then grant required permissions as mentioned above in step 5.

Post this verify that your slot is created and you can access from particular user you had given permission run

select * from pg_replication_slots;

Note: When a slot is used for sprinkle CDC ingestion then it should not be used in any other cases.

PreviousCDC setup in MysqlNextCDC setup in Mongo

Last updated 1 year ago

6. You are required to configure a for reading the WAL from sprinkle. ā€˜pgoutput’ plugin is recommended for reading from Postgres on Linux.

If you are planning to use wal2json plugin, it needs to be installed on the Postgres machine.

5. You are required to configure a for reading the WAL from sprinkle. ā€˜wal2json’ plugin is recommended for reading from AWS RDS.

For more details

ā˜„ļø
debezium plugin
Detailed steps available on debezium
debezium plugin
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Replication.Logical.html#AuroraPostgreSQL.Replication.Logical.Configure