MariaDB to Snowflake: CDC via Apache Iceberg
MariaDB to Snowflake comes down to one choice. Copy the rows into tables Snowflake owns, or write them once as Apache Iceberg tables that Snowflake and every other engine can read. This guide does the second.
OLake Go reads MariaDB changes from the binary log and commits them as Iceberg tables into a catalog Snowflake reads. With Snowflake's own Horizon catalog, the default on this page, the files sit on Snowflake-managed storage.
Nothing else is in the path: no Kafka, no Debezium, no Spark. With AWS Glue, the files sit in your S3 bucket and Snowflake reads them through a catalog integration.
Key takeaways
- OLake Go replicates MariaDB into Snowflake as Iceberg tables: a full historical snapshot first, then change data capture (CDC) from the binlog, with no Kafka or Debezium in between.
- Through the Horizon catalog the tables land as Snowflake-managed Iceberg tables. You query them in Snowsight right away, with no
CREATE ICEBERG TABLE, no external volume and no refresh. - The same tables, written once by OLake Go, are also queryable from DuckDB and Spark through the same catalog. In the run on this page all three engines returned identical rows.
The short answer. To replicate MariaDB to Snowflake with change data capture (CDC), run OLake Go with MariaDB's binary log as the source and the Snowflake Horizon catalog as the Iceberg destination. The first sync copies each table in full (the historical snapshot); every later sync replays inserts, updates and deletes from the binlog. Snowflake, DuckDB and Spark then query the same Iceberg tables, with no second copy.
How MariaDB CDC reaches Snowflake here
Two things happen in order, and OLake Go does both on its own. The first sync records the current binlog position, then reads each table in parallel chunks and writes Parquet data files: that is the historical load.
Every later sync opens the binlog at the saved position and replays the inserts, updates and deletes since. Nothing written during the snapshot is lost, and there is no separate backfill job.
Each sync ends with one commit to Horizon. OLake Go asks Horizon for short-lived storage credentials, uploads the data and delete files, then posts the new snapshot to the catalog. Snowflake sees it the moment the commit lands; DuckDB and Spark see it on their next catalog load.
One thing to keep an eye on: the binlog is MariaDB's replay window. MariaDB deletes binlog files after binlog_expire_logs_seconds.
A job paused for longer than that cannot resume and needs a fresh snapshot. Keep retention longer than your longest planned pause, and alert on SHOW BINARY LOGS size if disk is tight.
What you need
- MariaDB 10.5 or later with the binlog on in
ROWformat and a user that can read it. The tables on this page ran on MariaDB 11. Hosted MariaDB on Amazon Relational Database Service (RDS), Azure Database for MariaDB or SkySQL works the same way; step 1 links the setup guides. OLake Go reads MariaDB through its MySQL connector, so every MariaDB step on this page applies as written. - A Snowflake account where you can run the one-time setup as
ACCOUNTADMIN. Snowflake-managed storage means no cloud bucket or IAM role on your side. - OLake UI from the Docker Compose install, with the OLake Go MySQL source on v0.11 or later. The run on this page used v1.1.0.
- Docker, and about 30 minutes.
Step 1: Prepare MariaDB for CDC
Most readers point OLake Go at tables they already have. If you want to follow along with the exact data from this page, create these two tables first:
The two sample tables used on this page
CREATE TABLE customers (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100), email VARCHAR(200), city VARCHAR(100), tier VARCHAR(20),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
CREATE TABLE orders (
id INT AUTO_INCREMENT PRIMARY KEY,
customer_id INT, product VARCHAR(100), amount DECIMAL(10,2), status VARCHAR(20),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (customer_id) REFERENCES customers(id));
-- Then insert whatever you like. This page started with 8 customers and 40 orders.
OLake Go reads MySQL changes from the binary log (binlog), the same stream MySQL replicas use. Four things must be in place on the server before the first sync.
| Setting | Value | Why it matters |
|---|---|---|
log_bin | ON with a server_id | Without a binlog MySQL records no row changes, so there is nothing to replicate. Changing it needs a restart. |
binlog_format | ROW | Statement-based logging does not carry the row images OLake Go needs. |
binlog_row_metadata | FULL | Adds column names and types to every event, so OLake Go can map changes to columns after a schema change. |
| Replication user | SELECT, REPLICATION SLAVE, REPLICATION CLIENT | The snapshot reads the tables; the change stream reads the binlog. |
-- 1. Binary logging: put these in my.cnf (or the parameter group on managed MySQL) and restart
-- server-id = 1
-- log_bin = mysql-bin
-- binlog_format = ROW
-- binlog_row_metadata = FULL
-- binlog_expire_logs_seconds = 604800 -- keep 7 days, so a paused job can catch up
-- gtid_mode = ON, enforce_gtid_consistency = ON -- optional; gives microsecond _cdc_timestamp
-- 2. A user for OLake Go
CREATE USER IF NOT EXISTS 'olake'@'%' IDENTIFIED BY '<password>';
GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'olake'@'%';
FLUSH PRIVILEGES;
-- 3. Table statistics: the chunked snapshot plans its chunks from them
ANALYZE TABLE customers, orders;
Check the result before moving on:
SHOW VARIABLES WHERE Variable_name IN ('log_bin', 'binlog_format', 'binlog_row_metadata', 'server_id');
SHOW GRANTS FOR 'olake'@'%';
Managed MySQL sets these through a parameter group or server setting rather than my.cnf. Each flavour has its own guide:
| Where MySQL runs | Guide |
|---|---|
| Amazon RDS | RDS MySQL CDC setup |
| Amazon Aurora | Aurora MySQL CDC setup |
| Azure Database for MySQL | Azure MySQL CDC setup |
| Google Cloud SQL | Cloud SQL MySQL CDC setup |
| Your own server or VM | Generic MySQL CDC setup |
| Docker, for a local test | Local MySQL with Docker Compose |
MySQL deletes binlog files after binlog_expire_logs_seconds. If a job is paused longer than that, the next sync cannot find its saved position and needs a fresh full snapshot. Keep retention longer than your longest planned pause.
Step 2: Set up the catalog in Snowflake
Snowflake reads Iceberg tables from two kinds of catalog. Horizon is Snowflake's own: OLake Go writes straight into it, the tables are Snowflake-managed, and they appear in Snowsight the moment a sync commits. AWS Glue is a catalog outside Snowflake, so the files stay in your S3 bucket.
Snowflake reaches them through a catalog integration: a read-only link to that external catalog, refreshed after each sync.
Horizon is the default on this page. Glue is the right pick when Athena, Redshift or Spark on Amazon Elastic MapReduce (EMR) will read the same tables and you want the files in your own bucket.
| Catalog | OLake Go writes | Snowflake reads | Verified on this page |
|---|---|---|---|
| AWS Glue | Yes | Yes: catalog integration (read-only) | Documented, not yet run by us |
| Snowflake Horizon | Yes | Yes: native: tables are Snowflake-managed Iceberg tables | Yes, end to end |
- Snowflake Horizon
- AWS Glue
Snowflake Horizon is the catalog built into every Snowflake account. OLake Go talks to it through the Iceberg REST endpoint at https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog, and the tables it creates are Snowflake-managed Iceberg tables. Writing through this endpoint needs OLake Go 0.11.0 or later.
Run the following once in a Snowsight worksheet as ACCOUNTADMIN. It creates a database for the tables, a role OLake Go writes as, a service user that holds the token, and the authentication policy the token needs.
USE ROLE ACCOUNTADMIN;
-- A small warehouse for your own queries, and the database OLake Go writes into.
CREATE WAREHOUSE IF NOT EXISTS OLAKE_WH WAREHOUSE_SIZE = XSMALL AUTO_SUSPEND = 60 AUTO_RESUME = TRUE;
CREATE DATABASE IF NOT EXISTS OLAKE_DEMO;
ALTER DATABASE OLAKE_DEMO SET CATALOG = 'SNOWFLAKE';
ALTER DATABASE OLAKE_DEMO SET EXTERNAL_VOLUME = 'SNOWFLAKE_MANAGED';
-- The role OLake Go uses. It needs to create schemas; tables are created inside them.
CREATE ROLE IF NOT EXISTS OLAKE_ROLE;
GRANT USAGE, CREATE SCHEMA ON DATABASE OLAKE_DEMO TO ROLE OLAKE_ROLE;
GRANT USAGE ON WAREHOUSE OLAKE_WH TO ROLE OLAKE_ROLE;
GRANT ROLE OLAKE_ROLE TO ROLE SYSADMIN;
-- A service user for OLake Go. It holds the programmatic access token.
CREATE USER IF NOT EXISTS OLAKE_SVC TYPE = SERVICE DEFAULT_ROLE = OLAKE_ROLE;
GRANT ROLE OLAKE_ROLE TO USER OLAKE_SVC;
-- Snowflake issues a token to a service user only under a network policy, unless an
-- authentication policy waives that. This one waives it. Any schema can hold the policy.
USE SCHEMA OLAKE_DEMO.PUBLIC;
CREATE AUTHENTICATION POLICY IF NOT EXISTS olake_pat_policy
PAT_POLICY = (NETWORK_POLICY_EVALUATION = ENFORCED_NOT_REQUIRED);
ALTER USER OLAKE_SVC SET AUTHENTICATION POLICY olake_pat_policy;
-- The two values OLake Go asks for.
SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME() AS account_identifier,
CURRENT_REGION() AS region;
-- The token. Snowflake shows the secret once; copy it straight into OLake Go.
ALTER USER OLAKE_SVC ADD PROGRAMMATIC ACCESS TOKEN OLAKE_PAT
ROLE_RESTRICTION = 'OLAKE_ROLE' DAYS_TO_EXPIRY = 30;
What each block is for:
CATALOG = 'SNOWFLAKE'andEXTERNAL_VOLUME = 'SNOWFLAKE_MANAGED'on the database make every table OLake Go creates a Snowflake-managed Iceberg table on Snowflake's own storage. No S3 bucket, IAM role or external volume on your side. To keep the files in your own bucket, create an external volume and name it here instead.- The authentication policy is the step people miss. Without it, the
ADD PROGRAMMATIC ACCESS TOKENline fails withNetwork Policy is required when creating a programmatic access token for user OLAKE_SVC. In production, attach a network policy that allows OLake Go's egress IP instead of waiving the check. ROLE_RESTRICTIONpins the token toOLAKE_ROLE, so a leaked token cannot act asACCOUNTADMIN. Tokens expire afterDAYS_TO_EXPIRY(15 by default, 365 at most). Rotate it before then or the sync fails with an authentication error.
You can check the token outside OLake Go by exchanging it for a session token, the same call OLake Go makes on every sync:
curl -s -X POST "https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog/v1/oauth/tokens" \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode grant_type=client_credentials \
--data-urlencode scope=session:role:OLAKE_ROLE \
--data-urlencode client_secret=<your PAT>
A good token returns a JSON object with an access_token. The other authentication methods (key-pair JWT, External OAuth, workload identity federation) are on the Horizon catalog page.
AWS Glue Data Catalog is the default catalog in OLake Go. The tables live as Parquet and metadata files in an S3 bucket you own, and Glue holds the pointer to the current metadata file. Athena, Redshift, EMR, Spark and DuckDB read the same tables through Glue, which is why it is the catalog to pick when more than one AWS engine will read the data.
You need:
- An S3 bucket for the table files, in the region where your engines run.
- An IAM user or role for OLake Go with Glue and S3 permissions. The exact policy is on the AWS Glue catalog page.
- No Glue database in advance: OLake Go creates one per job, named after the source database and schema (for example
pg_to_snowflake_shop_public).
Glue has no built-in compaction for tables written by external engines, so plan on OLake Fusion or Spark for maintenance once the change volume grows.
Step 3: Connect MariaDB to OLake Go
- OLake UI
- OLake CLI
- In the OLake UI, open Sources and click Create Source. Pick MySQL as the connector, give the source a name and keep the OLake Go version on the latest release.
- Under Change data capture (CDC), leave Enable CDC on. The default Initial Wait Time is fine; raise it only if the binlog is large and the next sync times out while finding its saved position.
- Under Connection details, fill in the host, port, database name, username and password. Keep TLS off for a local test; on managed MySQL use the provider's certificate.
- Click Set up source. OLake Go tests the connection, then checks the binlog prerequisites (
binlog_access,log_bin,binlog_format,binlog_row_metadata) and shows the current and recommended value for anything that fails.
Here is the source form from the run on this page. MariaDB ran in another container, so the host is host.docker.internal; the user is the replication user from step 1.
Set up source runs the connection test and the binlog checks (binlog_access, log_bin, binlog_format, binlog_row_metadata) before anything is saved. When one fails, the dialog names the setting and its recommended value.
The full field reference, including SSL and SSH tunnels, is on the MySQL connector page.
Create source.json in your config folder. The update_method block is what turns CDC on:
{
"hosts": "mysql-host",
"username": "mysql-user",
"password": "mysqlpwd",
"database": "my-db",
"port": 3306,
"tls_skip_verify": true,
"update_method": {
"initial_wait_time": 10
},
"max_threads": 5,
"backoff_retry_count": 4,
"ssh_config": {
"host": "my-tunnel-host",
"port": 22,
"username": "my-tunnel-user",
"password": "tunnel-password"
},
"ssl": {
"mode": "disable"
},
"jdbc_url_params": {
"connectTimeout": "10000"
}
}
Then confirm OLake Go can reach the database:
docker run --pull=always \
-v "$PWD/config:/mnt/config" \
olakego/source-mysql:latest \
check --config /mnt/config/source.json
A working setup returns "status": "SUCCEEDED" together with a prerequisites list that reports the binlog settings as passed. Every field is described on the MySQL connector page.
Step 4: Configure the Iceberg destination
- Snowflake Horizon
- AWS Glue
- OLake UI
- OLake CLI
- Open Destinations and click Create Destination.
- Pick Apache Iceberg as the connector and Horizon as the catalog type.
- Choose Programmatic Access Token (PAT) as the authentication type and fill in the fields below.
- Click Create. OLake Go calls the Horizon endpoint, exchanges the token and saves the destination.

Horizon Configuration Parameters
| Parameter | Sample Value | Description |
|---|---|---|
Authentication Typerequired | Programmatic Access Token (PAT) | Authentication method OLake Go uses for Horizon Catalog REST API requests. Set to match your workspace's authentication configuration. |
Horizon Iceberg REST Catalog URIrequired | https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog | Snowflake Horizon Catalog REST API endpoint. |
Snowflake Databaserequired | SNOW | The name of the database in Snowflake. |
Session Role Scoperequired | session:role:<HORIZON_ROLE> | Informs Snowflake which role to use for this Horizon Catalog REST session, which controls privileges for catalog and table operations. Space-separated if providing more than one. |
Programmatic Access Tokenrequired | ver:1-hint:... | Snowflake programmatic access token (PAT). |
Cloud Storage Regionrequired | AWS_AP_SOUTH_1 | Snowflake's account region used to route requests to the correct storage endpoint. Run SELECT CURRENT_REGION(); to know the region |
| Catalog Name | horizon | Name of the Iceberg catalog OLake Go registers tables under. Defaults to olake_iceberg if left empty. |
| Enable Arrow Writes | false | Writes data and delete files using Apache Arrow based writer and registers them in Iceberg. |
Create destination.json next to source.json:
{
"type": "ICEBERG",
"writer": {
"catalog_type": "horizon",
"catalog_name": "horizon",
"rest_catalog_url": "https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog",
"iceberg_s3_path": "OLAKE_DEMO",
"aws_region": "AWS_AP_SOUTH_1",
"scope": "session:role:OLAKE_ROLE",
"rest_auth_type": "Programmatic Access Token (PAT)",
"credential": "<your PAT>",
"arrow_writes": false
}
}
Horizon Configuration Parameters
| Parameter | Sample Value | Description |
|---|---|---|
catalog_typerequired | horizon | Defines the catalog type used by the writer. |
rest_auth_typerequired | Programmatic Access Token (PAT) | Authentication method OLake Go uses for Horizon Catalog REST API requests. Set to match your workspace's authentication configuration. |
rest_catalog_urlrequired | https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog | Snowflake Horizon Catalog REST API endpoint. |
iceberg_s3_pathrequired | SNOW | The name of the database in Snowflake. |
credentialrequired | ver:1-hint:... | Snowflake programmatic access token (PAT). |
scoperequired | session:role:<HORIZON_ROLE> | Informs Snowflake which role to use for this Horizon Catalog REST session, which controls privileges for catalog and table operations. Space-separated if providing more than one. |
aws_regionrequired | AWS_AP_SOUTH_1 | Snowflake's account region used to route requests to the correct storage endpoint. Run SELECT CURRENT_REGION(); to know the region |
| catalog_name | horizon | Name of the Iceberg catalog OLake Go registers tables under. Defaults to olake_iceberg if left empty. |
| arrow_writes | false | Writes data and delete files using Apache Arrow based writer and registers them in Iceberg. |
- OLake UI
- OLake CLI
- Open Destinations and click Create Destination.
- Pick Apache Iceberg as the connector and AWS Glue as the catalog type.
- Enter the S3 path, the AWS region and the access key pair (or leave the keys empty to use the instance role).
- Click Create.
| Parameter | Sample Value | Description |
|---|---|---|
S3 Path required | s3://<BUCKET_NAME>/ | S3 bucket path where Iceberg table data and metadata files will be stored. |
AWS Region required | ap-south-1 | AWS Region where your S3 bucket and Glue Data Catalog exist. Required so OLake Go calls the correct regional S3 and Glue endpoints. |
| AWS Access Key | XXX | AWS access key ID for authentication. Optional if using IAM roles or instance profiles. If using IAM: Docker Compose: add the required IAM environment variables under x-envs in your compose file. See Service Environment Variables for setup details.Kubernetes: set up pod IAM in Cloud Integration. |
| AWS Secret Key | XXX | AWS secret access key for authentication. Optional if using IAM roles or instance profiles. If using IAM: Docker Compose: add the required IAM environment variables under x-envs in your compose file. See Service Environment Variables for setup details.Kubernetes: set up pod IAM in Cloud Integration. |
| S3 Endpoint | https://glue.ap-south-1.amazonaws.com | S3 API endpoint for writing Iceberg data files. Optional for AWS S3 but required for S3-compatible storage like MinIO. |
| Custom Glue Endpoint Configuration | true/false | Enable custom Glue catalog configuration when Glue catalog settings differ from S3 (different credentials, region, or endpoint). Shows additional Glue configuration fields. Leave off when Glue and S3 use the same AWS setup. |
| Enable Arrow Writes | true/false | Writes data and delete files using Apache Arrow based writer and registers them in Iceberg. |
The following fields appear in the UI after Custom Glue Endpoint Configuration is turned on. Configure Glue catalog connection settings here separately from the S3 fields above.
| Parameter | Sample Value | Description |
|---|---|---|
| Glue Catalog ID | 123456789012 | AWS account ID used as the Glue Data Catalog identifier. |
| Glue Access Key | XXX | Access key for authenticating Glue catalog requests. Required when Glue credentials differ from S3 credentials. |
| Glue Secret Key | XXX | Secret key for authenticating Glue catalog requests. Required when Glue credentials differ from S3 credentials. |
| Glue Endpoint | https://glue.ap-south-1.amazonaws.com | Custom endpoint URL for AWS Glue or a Glue-compatible catalog service. |
| Glue Region | ap-south-1 | Region for the Glue catalog, if different from the S3 region. Falls back to AWS Region if not set. |
{
"type": "ICEBERG",
"writer": {
"catalog_type": "glue",
"catalog_name": "olake_iceberg",
"iceberg_s3_path": "s3://<BUCKET_NAME>/",
"aws_region": "<AWS_REGION>",
"aws_access_key": "<AWS_ACCESS_KEY>",
"aws_secret_key": "<AWS_SECRET_KEY>",
"arrow_writes": false
}
}
| Parameter | Sample Value | Description |
|---|---|---|
iceberg_s3_path required | s3://<BUCKET_NAME>/ | S3 bucket path where Iceberg table data and metadata files will be stored. |
aws_region required | ap-south-1 | AWS Region where your S3 bucket and Glue Data Catalog exist. Required so OLake Go calls the correct regional S3 and Glue endpoints. |
| aws_access_key | XXX | AWS access key ID for S3 authentication. Optional if using IAM roles or instance profiles. If using IAM: add the required IAM environment variables in your shell or runtime environment. |
| aws_secret_key | XXX | AWS secret access key for S3 authentication. Optional if using IAM roles or instance profiles. If using IAM: add the required IAM environment variables in your shell or runtime environment. |
| s3_endpoint | https://glue.ap-south-1.amazonaws.com | S3 API endpoint for reading/writing Iceberg data files. Optional for AWS S3 but required for S3-compatible storage like MinIO. |
| glue_additional_config | true/false | Enable custom Glue catalog configuration when Glue catalog settings differ from S3 (different credentials, region, or endpoint). Leave off when Glue and S3 use the same AWS setup. |
| arrow_writes | false | Writes data and delete files using Apache Arrow based writer and registers them in Iceberg. |
When using separate Glue catalog settings, set glue_additional_config to true in destination.json and add the fields below. These configure Glue catalog connection settings separately from the S3 fields above.
| Parameter | Sample Value | Description |
|---|---|---|
| glue_catalog_id | 123456789012 | AWS account ID used as the Glue Data Catalog identifier. |
| glue_access_key | XXX | Access key for authenticating Glue catalog requests. Required when Glue credentials differ from S3 credentials. |
| glue_secret_key | XXX | Secret key for authenticating Glue catalog requests. Required when Glue credentials differ from S3 credentials. |
| glue_endpoint | https://glue.ap-south-1.amazonaws.com | Custom endpoint URL for AWS Glue or a Glue-compatible catalog service. |
| glue_region | ap-south-1 | Region for the Glue catalog, if different from the S3 region. Falls back to AWS Region if not set. |
Step 5: Create the job and run the first sync
- OLake UI
- OLake CLI
- Open Jobs and click Create Job. Give it a name and a schedule. Every Day at a fixed hour, or a cron expression, both work; the schedule is how often the change stream is drained, not how often a full copy runs.
- Select the source and the destination you created.
- Under Advanced Settings, set Target Query Engines to Snowflake, plus DuckDB and Apache Spark if they will read the tables too. OLake Go then resolves an Iceberg delete format every one of those engines can read, so you never pick one by hand.
- Click Next. OLake Go discovers the tables and opens the Streams page.
- Tick the tables to replicate. For each one, set the sync mode to Full Refresh + CDC and the ingestion mode to Upsert. Leave the Upsert Type as OLake Go resolved it (Positional Deletes in the run on this page).
- Click Create Job, then open the job's menu and choose Sync Now for the first run.
Three target query engines were set on this job. That is the only format decision you make: OLake Go works out which Iceberg delete format all three can read and sets it on every stream.

Discover the tables, choose the streams, then sync:
docker run --pull=always \
-v "$PWD/config:/mnt/config" \
olakego/source-mysql:latest \
discover --config /mnt/config/source.json
discover writes two files: available_streams.json (every table it found, do not edit) and selected_streams.json (the tables you want and their settings). In selected_streams.json, set sync_mode to {props.cliSyncMode ?? 'cdc'} for each table and pick the delete format your readers can open:
{
"selected_streams": {
"public": [
{
"stream_name": "customers",
"sync_mode": "cdc",
"normalization": true,
"append_mode": false,
"update_type": "pos"
}
]
}
}
update_type accepts eq (equality deletes, the default), pos (positional deletes) and dv (deletion vectors). Positional deletes and deletion vectors keep a small index between runs, so give the container a persistent directory for it through OLAKE_INDEX_DB_DIR. The first sync runs without a state file; OLake Go writes one at the end of the run:
docker run --pull=always \
-v "$PWD/config:/mnt/config" \
-e OLAKE_INDEX_DB_DIR=/mnt/config/index-db \
olakego/source-mysql:latest \
sync \
--config /mnt/config/source.json \
--selected-streams /mnt/config/selected_streams.json \
--available-streams /mnt/config/available_streams.json \
--destination /mnt/config/destination.json
Every later run adds --state /mnt/config/state.json to the same command, which is how OLake Go knows to replay only the changes since the last run. The full selected_streams.json reference is on the Docker CLI page; the index directory is described under index DB setup.
On this page the first run copied 8 customers and 40 orders (48 records) and finished in 30 seconds, container start included. OLake Go names the destination schema after the job and the source database, so mariadb_to_snowflake on database shop produced mariadb_to_snowflake_shop. The Iceberg DB field at the top of the Streams page changes it before the first sync.
Step 6: Query the tables in Snowflake
- Snowflake Horizon
- AWS Glue
There is no registration step. The schema and tables OLake Go committed through Horizon are already Snowflake-managed Iceberg tables in the database you configured. One thing to know before the first query: OLake Go creates them with quoted, lowercase names, so Snowflake needs the double quotes.
-- What OLake Go created (schema = <job name>_<source database>[_<source schema>])
SHOW ICEBERG TABLES IN SCHEMA OLAKE_DEMO."mariadb_to_snowflake_shop";
-- Quoted identifiers: the names are lowercase, as they were in the source
SELECT "id", "name", "city", "tier"
FROM OLAKE_DEMO."mariadb_to_snowflake_shop"."customers"
ORDER BY "id";
SHOW ICEBERG TABLES reports catalog_name = SNOWFLAKE, iceberg_table_type = MANAGED and external_volume_name = SNOWFLAKE_MANAGED: Snowflake treats them as its own managed Iceberg tables, not as external tables that need a refresh.
OLake Go adds four columns to every table: _olake_id (a hash of the primary key), _op_type, _olake_timestamp and _cdc_timestamp. _op_type is r for a row from the first snapshot, c for an insert, u for an update and d for a delete. Filter them out of dashboards, or use them to see when a row last changed.

With Glue as the catalog, Snowflake reads the tables through a catalog integration: an external volume that points at the S3 bucket, an integration that points at the Glue database, and one CREATE ICEBERG TABLE per table. These tables are read-only in Snowflake, and Snowflake picks up new snapshots when you refresh them.
-- 1. The bucket OLake Go writes to
CREATE OR REPLACE EXTERNAL VOLUME olake_s3_volume
STORAGE_LOCATIONS = ((
NAME = 'olake-s3',
STORAGE_PROVIDER = 'S3',
STORAGE_BASE_URL = 's3://<bucket>/',
STORAGE_AWS_ROLE_ARN = 'arn:aws:iam::<account>:role/<snowflake-s3-role>',
STORAGE_AWS_EXTERNAL_ID = 'olake_s3_volume_ext_id' -- any string; it goes into the role's trust policy
));
-- 2. The Glue database OLake Go created for the job
CREATE OR REPLACE CATALOG INTEGRATION olake_glue
CATALOG_SOURCE = GLUE
CATALOG_NAMESPACE = 'mariadb_to_snowflake_shop'
TABLE_FORMAT = ICEBERG
GLUE_AWS_ROLE_ARN = 'arn:aws:iam::<account>:role/<snowflake-glue-role>'
GLUE_CATALOG_ID = '<account>'
GLUE_REGION = '<region>'
ENABLED = TRUE;
-- 3. The values your IAM roles must trust
DESCRIBE EXTERNAL VOLUME olake_s3_volume;
DESCRIBE CATALOG INTEGRATION olake_glue;
-- 4. One table per Iceberg table
CREATE OR REPLACE ICEBERG TABLE customers
EXTERNAL_VOLUME = 'olake_s3_volume'
CATALOG = 'olake_glue'
CATALOG_TABLE_NAME = 'customers';
SELECT id, name, city, tier FROM customers ORDER BY id;
Step 3 is where the AWS side gets wired up. DESCRIBE EXTERNAL VOLUME returns STORAGE_AWS_IAM_USER_ARN and STORAGE_AWS_EXTERNAL_ID; put both into the trust policy of the S3 role. DESCRIBE CATALOG INTEGRATION returns GLUE_AWS_IAM_USER_ARN and GLUE_AWS_EXTERNAL_ID; put those into the trust policy of the Glue role. Until the trust policies carry these values, step 4 fails with an access error.
After every OLake Go sync, run ALTER ICEBERG TABLE customers REFRESH; so Snowflake reads the new snapshot. The full walk-through, including the IAM trust policies, is in Query Iceberg in Snowflake with OLake and AWS Glue and Snowflake's Glue catalog integration guide.
Step 7: Change rows in MariaDB and sync again
To see the change path work, the run on this page made 12 changes in MariaDB after the first sync:
INSERT INTO customers (name, email, city, tier) VALUES
('Maya Patel', 'maya@example.com', 'Pune', 'silver'),
('Lucas Silva', 'lucas@example.com', 'São Paulo', 'bronze');
INSERT INTO orders (customer_id, product, amount, status) VALUES
(9, 'Laptop', 1299.00, 'placed'), (9, 'Mouse', 25.50, 'placed'),
(10, 'Monitor', 349.99, 'placed'), (3, 'Keyboard', 89.00, 'placed'), (7, 'Webcam', 79.90, 'placed');
UPDATE customers SET tier = 'gold' WHERE name = 'Liam Carter';
UPDATE customers SET city = 'Abu Dhabi' WHERE name = 'Zara Ali';
UPDATE orders SET status = 'delivered' WHERE id IN (1, 4, 7);
The second sync read 12 records (563 bytes) from the binlog and finished in 21 seconds end to end. For customers that meant one new data file with 4 rows: 2 inserts plus the new versions of 2 updated rows.
One small delete file retires the 2 old versions. OLake Go's commit report in the sync log shows it directly: addedDataFiles=1, addedRecords=4, addedPositionalDeleteFiles=1, addedPositionalDeletes=2, and orders the same shape with 8 rows and 3 deletes.

Snowflake shows the result with no refresh. Liam Carter is gold, Zara Ali moved to Abu Dhabi, and the two new customers are there. The _op_type column shows how each row arrived:

Schema changes. When a column is added in MariaDB, OLake Go adds it to the Iceberg table on the next sync, and Snowflake shows it. Widening changes (int to bigint, float to double) are applied.
Narrowing or incompatible type changes fail the sync rather than corrupt the table. binlog_row_metadata = FULL is what lets OLake Go see the new column names in the binlog. Full rules are on the schema evolution page.
Query the same tables from DuckDB and Spark
This is the point of writing Iceberg instead of loading Snowflake tables. Nothing is exported, copied or refreshed: both engines read the files OLake Go wrote, through the same Horizon endpoint, with credentials vended by Snowflake.
- DuckDB
- Apache Spark
DuckDB attaches Horizon as an Iceberg REST catalog. It wants a bearer token rather than the raw PAT, so exchange the PAT first (the curl call from the catalog setup), then attach:
INSTALL iceberg; LOAD iceberg;
INSTALL httpfs; LOAD httpfs;
CREATE SECRET horizon_secret (TYPE iceberg, TOKEN '<access_token from /v1/oauth/tokens>');
ATTACH 'OLAKE_DEMO' AS horizon (
TYPE iceberg,
ENDPOINT 'https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog',
SECRET horizon_secret,
ACCESS_DELEGATION_MODE 'vended_credentials'
);
SHOW ALL TABLES;
SELECT id, name, city, tier FROM horizon.mariadb_to_snowflake_shop.customers ORDER BY id;
The session token lives about an hour; re-run the exchange and CREATE OR REPLACE SECRET when a query fails with an authorization error. DuckDB reads deletion vectors from duckdb-iceberg 1.5.3 onward, and only attaches REST catalogs backed by S3, S3 Tables or Google Cloud Storage, so pick an AWS- or GCP-hosted Snowflake account for this path.
Spark reaches Horizon as a plain Iceberg REST catalog. The token is the same PAT OLake Go uses; scope picks the Snowflake role and the X-Iceberg-Access-Delegation header asks Horizon for short-lived storage credentials, so Spark never needs S3 keys.
spark-sql \
--packages org.apache.iceberg:iceberg-spark-runtime-3.5_2.12:1.10.0,org.apache.iceberg:iceberg-aws-bundle:1.10.0 \
--conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions \
--conf spark.sql.catalog.horizon=org.apache.iceberg.spark.SparkCatalog \
--conf spark.sql.catalog.horizon.type=rest \
--conf spark.sql.catalog.horizon.uri=https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog \
--conf spark.sql.catalog.horizon.warehouse=OLAKE_DEMO \
--conf spark.sql.catalog.horizon.credential=<your PAT> \
--conf spark.sql.catalog.horizon.scope=session:role:OLAKE_ROLE \
--conf spark.sql.catalog.horizon.header.X-Iceberg-Access-Delegation=vended-credentials
SHOW TABLES IN horizon.mariadb_to_snowflake_shop;
SELECT id, name, city, tier FROM horizon.mariadb_to_snowflake_shop.customers ORDER BY id;
Use Iceberg 1.8 or later on the classpath when the tables carry deletion vectors; 1.10.0 is what this page was tested with. The AWS_REGION environment variable must be set to the region of the Snowflake account's storage (for example ap-south-1 for AWS_AP_SOUTH_1) or the vended credentials are rejected.
Spark 3.5.6 with Iceberg 1.10.0 returned the same 10 customers and the same orders roll-up as Snowflake and DuckDB in the run on this page.
An orders roll-up matched MariaDB to the cent in all three engines: 16 delivered orders for 8659.68, 18 placed for 10522.26, 11 shipped for 6397.25.
Data types: MariaDB to Iceberg to Snowflake
OLake Go maps MariaDB types to Iceberg types, and Snowflake maps Iceberg types to its own. Most columns pass through unchanged; three groups are worth knowing about.
| MariaDB | Iceberg (written by OLake Go) | Snowflake shows | Notes |
|---|---|---|---|
int, mediumint, smallint, tinyint (signed or unsigned) | int | NUMBER(10,0) | |
bigint, bigint unsigned | long | NUMBER(19,0) | |
decimal(p,s), float | float | FLOAT | OLake Go stores decimals as floats. The orders.amount sums on this page matched MariaDB to the cent in every engine; round at query time when you need exact decimal arithmetic. |
double, real | double | FLOAT | |
datetime, timestamp | timestamptz (UTC) | TIMESTAMP_LTZ(6) | datetime has no zone in MariaDB; it is read as UTC, so set the session zone before comparing. |
char, varchar, text family, enum, json, time, bit(1) | string | VARCHAR | Parse json with PARSE_JSON() in Snowflake. time arrives as text. |
binary(n) | fixed[n] | BINARY(n) | |
varbinary, blob family | binary | BINARY |
MariaDB types in the table come from the MySQL connector reference; the Snowflake side from Snowflake's Iceberg data types page (checked 2026-10-14).
Cost and maintenance
- Storage is Snowflake's with
SNOWFLAKE_MANAGED: you pay Snowflake storage rates for the Parquet and delete files. Point the database at your own external volume to keep the files in your bucket instead. - Compute. OLake Go runs wherever you run Docker; it does not use a Snowflake warehouse to write. Snowflake compute is spent only when you query.
- Maintenance. Snowflake expires old snapshots and compacts manifests on Snowflake-managed tables at no cost. Automatic data-file compaction is bundled only when Snowflake alone writes the table (Snowflake-managed Iceberg table maintenance). A CDC table that gets a new small file every minute will want compaction from the writer side; OLake Fusion does this for the catalogs OLake Go writes to, and Spark's
rewrite_data_filesworks through the same Horizon endpoint. - Binlog disk. Seven days of binlog on a busy server can be tens of gigabytes. Size the volume for it, or shorten retention once the job runs reliably every hour.
- Token rotation. The programmatic access token expires (30 days in the setup above, 365 at most). Put the renewal on a calendar; an expired token fails the next sync at the catalog handshake, before any data moves.
Troubleshooting
1. The first sync stops with a statistics error
failed to get or split chunks: stats not populated for table[shop.orders]. Please run ANALYZE TABLE to update table statistics
OLake Go plans the parallel snapshot from information_schema row estimates. A freshly created or freshly loaded table has none.
Run ANALYZE TABLE <table>; for each table in the job, then sync again. The run on this page hit this on its first attempt.
2. The source test fails on the binlog
binlog_format: current STATEMENT, recommended ROW
The test dialog names the setting. binlog_format and binlog_row_metadata can be changed at runtime with SET GLOBAL.
Put them in my.cnf (or the parameter group) too, or they revert on restart. log_bin itself needs a restart.
3. Snowflake cannot find the table
SQL compilation error:
Object 'OLAKE_DEMO.MARIADB_TO_SNOWFLAKE_SHOP.CUSTOMERS' does not exist or not authorized.
Snowflake upper-cased an unquoted identifier. OLake Go creates the schema and tables with their lowercase MariaDB names, so quote them: OLAKE_DEMO."mariadb_to_snowflake_shop"."customers".
4. The next sync cannot find its binlog position
idle timeout reached, exiting binlog syncer
Two causes. If binlog_expire_logs_seconds already removed the saved binlog file, run a fresh full snapshot and lengthen retention.
If the file exists but the server is slow to seek to the position, raise Initial Wait Time on the source. 10 seconds was enough for the two-table database on this page.
5. The destination test fails at the catalog handshake
OLake Go's destination test exchanges the token at /v1/oauth/tokens before anything else. Three causes cover nearly every failure: a service user without a network or authentication policy, a scope that does not match the token's ROLE_RESTRICTION, or an expired token. Run the curl exchange from the catalog setup; it returns the same error Snowflake gives OLake Go.
How this compares with other ways to move MariaDB data to Snowflake
| Method | Freshness | Updates and deletes | Where the data lands | What you run |
|---|---|---|---|---|
| Snowflake Openflow connector for MySQL | CDC through the binlog | Yes, as soft deletes plus journal tables | Native Snowflake tables; Snowflake is the only reader | An Openflow deployment in Snowpark Container Services or your own AWS account, billed in Snowflake credits |
| Debezium, Kafka and the Snowflake Kafka connector | Seconds | Yes, with the connector's tombstone handling | Kafka topics, then Snowflake tables | Kafka, Kafka Connect, Debezium and a schema registry |
| Managed ELT (Fivetran, Estuary, Airbyte Cloud) | Minutes, by plan | Yes | Snowflake tables, a second copy you pay to move and store | Nothing; priced per row, per GB or per connector |
Manual export (mariadb-dump or SELECT ... INTO OUTFILE, then COPY INTO) | Hours to daily | No; full reloads only | Files you control | A script and a scheduler |
| OLake Go to Iceberg on Horizon (this guide) | CDC on a schedule down to one minute | Yes, as Iceberg row-level deletes | Apache Iceberg tables that Snowflake, DuckDB, Spark and Trino all read | One Docker Compose stack, open source; Snowflake storage plus your own compute |
Openflow is the simpler choice when Snowflake is the only reader and you want Snowflake to run the pipeline. Writing Iceberg once avoids paying to move and store a second copy as soon as another engine needs the same rows, or you want to own the files.
When not to use this
- Your Snowflake account is on Azure and DuckDB is a reader. DuckDB attaches REST catalogs backed by S3, S3 Tables and Google Cloud Storage only, so pick Spark or Trino as the second engine there.
- Tables have no primary key. Inserts replicate; updates and deletes cannot be matched to a row and are not applied. Add a primary key or a unique index first.
FAQs
How do I replicate MariaDB to Snowflake without a managed connector?
Run OLake Go (open source, Apache 2.0) against a MariaDB server with row-based binary logging turned on, and point it at Snowflake's Horizon catalog. The first sync copies the tables in full, every later sync replays only the changes from the binlog, and the tables appear in Snowflake as Snowflake-managed Iceberg tables. No Kafka, Debezium or Snowflake connector sits in the path.
Does OLake Go copy the existing MariaDB data before it starts reading the binlog?
Yes, automatically. A job in Full Refresh + CDC mode records the binlog position, copies every selected table in parallel chunks, then switches to the binlog from that position. Nothing written during the copy is lost, and there is no separate backfill job.
What is the best way to migrate MariaDB to Snowflake?
For a one-time migration, a full load through OLake Go lands the tables as Iceberg in Snowflake in minutes and can be re-run. For an ongoing feed, keep the same job in Full Refresh + CDC mode and schedule it. Snowflake Openflow fits when Snowflake is the only reader and you want Snowflake to run the pipeline; OLake Go fits when the tables should also be readable from DuckDB, Spark or Trino. In OLake's published ingestion benchmarks it posted higher snapshot and CDC throughput than the other tools measured.
Does MariaDB CDC with OLake Go work on Amazon RDS, Azure or SkySQL?
Yes, as long as the binlog is on with row format. Managed MariaDB sets binlog_format, binlog_row_metadata and retention through a parameter group or server parameter instead of my.cnf; the MySQL setup guides on this site apply, because OLake Go reads MariaDB through its MySQL connector. On RDS the binlog is on once automated backups are enabled; set binlog_format to ROW in the parameter group.
Which MariaDB data types change on the way to Snowflake?
decimal columns become Iceberg float and show up in Snowflake as FLOAT, so round at query time when you need exact decimal arithmetic. datetime and timestamp become timestamptz in UTC (Snowflake TIMESTAMP_LTZ(6)). json, enum, time and bit(1) arrive as VARCHAR; binary(n) stays fixed-length binary. Integers and strings map one to one.
How much binlog does MariaDB need to keep for OLake Go?
Enough to cover your longest pause. OLake Go saves the binlog position after every sync and resumes from it; if MariaDB has already expired that file, the next sync cannot resume and needs a fresh snapshot. Seven days (binlog_expire_logs_seconds = 604800) is a safe default for a job that runs at least daily.
Can I use AWS Glue instead of the Horizon catalog?
Yes. With Glue as the catalog the files stay in your S3 bucket, Athena, Redshift and EMR read them natively, and Snowflake reads them through a catalog integration as read-only tables you refresh after each sync. Horizon is the better default when Snowflake is the main reader, because the tables are Snowflake-managed and need no refresh.
Related guides
Deeper reading on this site: