MariaDB
Write data to a MariaDB table using INSERT ON DUPLICATE KEY UPDATE for upsert. Use Zeotap to materialize model results, enriched profiles, or audience membership into MariaDB.
Prerequisites
- A MariaDB database (version 10.3+)
- A database user with INSERT, UPDATE, DELETE, and CREATE TABLE privileges
- Network connectivity between Zeotap and the MariaDB server
Authentication
MariaDB uses Username & Password authentication.
- Enter the database Username and Password in Zeotap
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
| Host | Text | Yes | MariaDB server hostname or IP address |
| Port | Number | No | Server port. Default: 3306 |
| Database | Text | Yes | Database name |
| Enable TLS | Toggle | No | Enable TLS encryption. Default: Off |
Target Settings
| Field | Type | Required | Description |
|---|---|---|---|
| Table | Text | Yes | Target table name |
Supported Operations
Sync Modes
| Mode | Supported |
|---|---|
| Upsert | Yes |
| Insert | Yes |
| Update | Yes |
| Mirror | Yes |
Audience Sync Modes
| Mode | Supported |
|---|---|
| Add | Yes |
| Remove | Yes |
| Mirror | Yes |
| Upsert | Yes |
Features
- Field Mapping: Yes
- Schema Introspection: Yes — Zeotap reads column metadata from MariaDB’s
information_schema - Auto-create Target Table: Yes — Zeotap creates the table automatically on the first sync if it does not exist
How It Works
- Zeotap opens a connection to MariaDB using the configured host, port, database, and credentials
- A temporary staging table is created for each batch
- Rows are inserted into the staging table with their diff operation (
added,changed,removed) and primary key - Based on the sync mode, Zeotap applies the appropriate SQL operations:
- Upsert:
INSERT ... ON DUPLICATE KEY UPDATEfor added and changed rows - Insert:
INSERTfor added rows only - Update:
UPDATE ... INNER JOINfor changed rows - Mirror: Upsert for added/changed rows, then
DELETE ... INNER JOINfor removed rows
- Upsert:
- The staging table is dropped after each batch
- Missing columns are automatically added to the target table as
TEXTcolumns
Rate Limits
MariaDB does not impose API rate limits. Performance depends on the server’s hardware, network bandwidth, and concurrent workload. For large syncs, consider:
- Increasing
max_allowed_packetfor large batch inserts - Ensuring adequate
innodb_buffer_pool_sizefor write-heavy workloads - Using connection pooling if running frequent syncs
Best Practices
- Use a dedicated database user with only the privileges required (INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE)
- Enable TLS when connecting over public networks or cloud-hosted instances
- Define a primary key on the target table before the first sync to enable upsert and update modes
- Monitor disk space on the MariaDB server, especially for mirror syncs that may grow the table over time
- Use InnoDB tables (the default storage engine in MariaDB 10.2+) for transactional consistency
Troubleshooting
Connection refused
Verify the host, port, and that the MariaDB server allows remote connections. Check the bind-address setting in the MariaDB configuration file (/etc/mysql/mariadb.conf.d/50-server.cnf).
Access denied
Verify the username and password. Ensure the user has the required privileges on the target database. You can verify with:
SHOW GRANTS FOR 'your_user'@'your_host';Table does not exist
Zeotap creates the target table automatically on the first sync. Ensure the user has CREATE TABLE privileges on the target database.
TLS connection issues
If the server requires TLS, enable the Enable TLS toggle. MariaDB cloud-hosted instances (SkySQL, AWS RDS for MariaDB) typically require TLS for all connections.
Packet too large
If you see Error 1153: Got a packet bigger than 'max_allowed_packet' bytes, increase the max_allowed_packet setting on the MariaDB server.
Duplicate column name errors
Zeotap automatically adds missing columns to the target table. If the column already exists with a different type, the sync will continue without modification. To change a column type, alter it manually in MariaDB before the next sync.