Skip to main content

Prerequisites

  • MariaDB version ≥ 11.4.3
  • binlog configured
  • Streamkap user and role

Granting Privileges

It’s recommended to create a separate user and role for Streamkap to access your MariaDB database. Below is an example script that does that.
-- Replace { ... } placeholders as required;
CREATE USER streamkap_user@'%' IDENTIFIED BY '{password}';

-- Grant Permissions
GRANT REPLICATION CLIENT, RELOAD, SHOW DATABASES, REPLICATION SLAVE ON *.* TO streamkap_user@'%';

-- Grant Select on all schemas needed
GRANT SELECT ON {schema}.* TO 'streamkap_user';

Enable Snapshots

You can perform ad-hoc snapshots of all or some of your tables in the Streamkap app. See Snapshots & Backfilling for more information. To enable this feature, there are 2 methods available for MariaDB databases.

Method 1: Enable GTID (default)

Global transaction identifiers (GTIDs) uniquely identify transactions that occur on a server within a cluster. Though not required, using GTIDs simplifies replication and enables you to more easily confirm if primary and replica servers are consistent as well as carry out incremental snapshots. For MariaDB, this is enabled by default, no additional setup is necessary.

Method 2: Create a table in the source database

If for some reason you have disabled GTIDs and cannot enable them, you will need to create the table and give permissions to the streamkap_user. Streamkap will use this collection for managing snapshots.
Please create the signal table with the name streamkap_signal. It will not be recognised if given another name.
-- Create the schema
CREATE SCHEMA streamkap;

CREATE TABLE streamkap.streamkap_signal (
  id VARCHAR(255) PRIMARY KEY, 
  type VARCHAR(32) NOT NULL, 
  data VARCHAR(2000) NULL
);

GRANT SELECT, UPDATE, INSERT ON streamkap.streamkap_signal TO streamkap_user;

Heartbeats

Connectors use “offsets”—like bookmarks—to track their position in the database’s log or change stream. When no changes occur for long periods, these offsets may become outdated, and the Connector might lose its place or stop capturing changes. Heartbeats ensure the Connector stays active and continues capturing changes. There are two layers of heartbeat protection:

Layer 1: Connector heartbeats (enabled by default)

The Connector periodically emits heartbeat messages to an internal topic, even when no actual data changes are detected. This keeps offsets fresh and prevents staleness. No configuration is necessary for this layer; it is automatically enabled. We recommend keeping this layer enabled for all deployments.
Why we recommend configuring Layer 2While Layer 2 is crucial for low-traffic or intermittent databases, we recommend configuring it for all deployments. It provides additional resilience and helps prevent issues during periods of inactivity.
You can configure regular updates to a dedicated heartbeat table in the source database. This simulates activity, ensuring change events are generated consistently, maintaining log progress and providing additional resilience. How this layer is configured depends on the connection type (if supported by the Source):
  • Read-write connections (when Read only is No during Streamkap Setup): The Connector updates the heartbeat table directly.
  • Read-only connections (when Read only is Yes during Streamkap Setup): A scheduled job on the primary database updates the heartbeat table, and these changes replicate to the read replica for the Connector to consume.
This layer requires you to set up a heartbeat table—and for read-only connections, a scheduled job (e.g., pg_cron for PostgreSQL, event_scheduler for MySQL)—on your source database.
For read-write connections (when Read only is No during Streamkap Setup), the Connector writes to the heartbeat table directly.
-- Create the streamkap schema
CREATE SCHEMA IF NOT EXISTS streamkap;

-- Switch to the streamkap schema
USE streamkap;

-- Create the heartbeat table with id, text, and last_update fields
CREATE TABLE streamkap_heartbeat (
    id INT AUTO_INCREMENT PRIMARY KEY,
    text TEXT,
    last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Grant permission to the Streamkap user
GRANT SELECT, UPDATE, INSERT, DELETE ON streamkap.streamkap_heartbeat TO STREAMKAP_USER;

-- Insert the first row into the heartbeat table
INSERT INTO streamkap_heartbeat (text) VALUES ('test_heartbeat');

Enable binary logging

The automated backups feature determines whether binary logging is turned on or off for MariaDB.
  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/
  2. In the navigation pane, choose Databases, and then choose the DB instance or Multi-AZ DB cluster that you want to modify
  3. Choose Modify
    1. For Backup retention period, choose a positive nonzero value, for example 3 days
  4. Choose Continue
  5. Choose Apply immediately
  6. Choose Modify DB instance or Modify cluster to save your changes and enable automated backups

Configure binary logging

  1. Open the Amazon RDS console at https://console.aws.amazon.com/rds/
  2. In the navigation pane, choose Parameter groups
  3. Choose the parameter group used by the DB instance you want to modify
  4. You can’t modify a default parameter group. If the DB instance is using a default parameter group, create a new parameter group and associate it with the DB instance
  5. From Parameter group actions, choose Edit
  6. Set the binlog_format parameter to the binary logging format of ROW
  7. Set the binlog_row_imageparameter to FULL
  8. Choose Save changes to save the updates to the DB parameter group

Verify binary logs are enabled

You can either:
  • Check the parameter group for the DB instance and that log_bin parameter is ON
  • Run the following SQL query on the DB instance SHOW VARIABLES LIKE '%log_bin%';. Result should be ON
  • Run SHOW BINARY LOGS

Consider Access Restrictions

Setup MariaDB Connector in Streamkap

  • Go to Sources and click Create New
  • Input
    • Name for your Connector
    • Hostname
    • Port (Default 3306)
    • Username (Username you chose earlier, our scripts use streamkap_user)
    • Password
    • Read only
      • Whether or not to use a read-only connection. MariaDB has GTID enabled by default, so no additional configuration is necessary. See Enable GTID for more information.
      • If you have disabled GTID mode and cannot enable it, set Read only to No and create the signal table as described here.
        • Signal Table Database: Streamkap will use a table in this database to manage snapshots e.g. streamkap. See Enable Snapshots for more information.
    • Heartbeats: Enabled by default.
      • For read-write connections, configure a heartbeat table in the source database and set Heartbeat Table Database. See Heartbeats for setup instructions.
      • For read-only connections, configure a scheduled heartbeat event on the primary database using the MariaDB Event Scheduler, and include the heartbeat table in Add Schemas/Tables. See Heartbeats for setup instructions.
    • Connection Timezone - The timezone of your database
    • Timezone conversionMariaDB converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. By default, the current time zone for each connection is the database server’s time zone but this option allows you to override that.As long as the time zones remain the same, you get back the same value you store.We recommend using the default SERVER option which attempts to detect the session time zone from the values configured on the MariaDB server session variables ‘time_zone’ or ‘system_time_zone’. It also reduces the chance of problems with daylight savings adjustment ‘fall back’ and ‘spring forward’.If either time zones change, an ad-hoc snapshot is recommended so your source and destination timestamps are consistent.
    • Connect via SSH Tunnel. See SSH Tunnel
  • Advanced Parameters
    • Represent Binary Data As (Default bytes)
    • Capture Only Captured Databases DDL (Default false) - Specifies whether the connector records schema structures from all databases defined in the server (the default) or only those databases for which you’ve explicitly configured the connector. Specify true to capture schema history only for the specific databases you’ve configured. This is particularly valuable when databases are large, to reduce the volume of DDL stored in the schema history topic. It also improves startup times when the connector restarts or recovers from failures. See Schema History Optimization for details.
    • Capture Only Captured Tables DDL (Default false) - Specifies whether the connector records the schema structure for all tables in the configured databases (the default) or only the tables whose changes the connector captures. Specify true to capture schema history only for the specific tables you’ve configured. This is particularly valuable when tables are large, to reduce the volume of DDL statements stored in the schema history topic. It also improves startup times when the connector restarts or recovers from failures. See Schema History Optimization for details.
  • Add Schemas/Tables. Can also bulk upload here. The format is a simple list of each schema or table per row saved in csv format without a header.
CDC only captures base tables, not ViewsChange Data Capture reads the MariaDB binary log (binlog), which only records changes to physical tables. Database Views are query-time computations with no physical storage—they don’t generate binlog entries.What you cannot capture: Views, temporary tables, MEMORY tables, BLACKHOLE tables, or system tables (information_schema, performance_schema).Solution: Specify only the underlying base tables that feed your views. You can recreate the view logic in your destination or transformation layer.
  • Click Save The connector will take approximately 1 minute to start processing data.