Skip to main content

Overview

Wirekite supports SingleStore as a target database for:
  • Schema Loading - Create target tables from Wirekite’s intermediate schema format
  • Data Loading - Bulk load extracted data using LOAD DATA INFILE
  • Change Loading (CDC) - Apply ongoing changes using merge table approach
SingleStore loaders use MySQL-compatible LOAD DATA INFILE for high-performance bulk loading. The Change Loader uses shadow tables with $wkm suffix for atomic change application.

Prerequisites

Before configuring SingleStore as a Wirekite target, ensure the following requirements are met:

Database Configuration

  1. Version: SingleStore 7.x or above
  2. User Permissions: Create a dedicated Wirekite user with:
    • CREATE TABLE privilege
    • FILE privilege for LOAD DATA operations
    • INSERT, UPDATE, DELETE on target tables
    • Read/write access to Wirekite internal tables (wirekite_progress and wirekite_action)

Connection Requirements

The SingleStore DSN must include allowAllFiles=true and multiStatements=true parameters for LOAD DATA operations to work correctly. These are automatically added if missing.
Use the mysql client or Wirekite cmdline tool to verify database connectivity before running loaders.

Schema Loader

The Schema Loader reads Wirekite’s intermediate schema format (.skt file) and generates SingleStore-appropriate DDL statements for creating target tables.
The Schema Loader generates both base tables and merge tables (with $wkm suffix) for CDC operations.

Required Parameters

schemaFile
string
required
Path to the Wirekite schema file (.skt) generated by the Schema Extractor. Must be an absolute path.
createTableFile
string
required
Output file for CREATE TABLE statements. Includes both base tables and merge tables for CDC operations.
createConstraintFile
string
required
Output file for constraint definitions (indexes, unique constraints).
createForeignKeyFile
string
required
Output file for FOREIGN KEY constraints.
logFile
string
required
Absolute path to the log file for Schema Loader operations.

Optional Parameters

dropTableFile
string
default:"none"
Output file for DROP TABLE IF EXISTS statements. Set to “none” to skip generation.
createRecoveryTablesFile
string
default:"none"
Output file for recovery table creation SQL. Set to “none” to skip.
createMergeTables
boolean
default:"true"
When true, generates merge tables ($wkm suffix) for CDC operations. Set to false if only doing data loads.
mergeTablesOnly
boolean
default:"false"
When true, only creates merge tables, skipping base table creation.

Data Loader

The Data Loader reads Wirekite’s intermediate data format (.dkt files) and loads records into SingleStore tables using LOAD DATA INFILE.

Required Parameters

dsnFile
string
required
Path to a file containing the SingleStore connection string.
Connection string format:
username:password@tcp(host:port)/database?allowAllFiles=true&multiStatements=true
Example:
wirekite:secretpass@tcp(singlestore.example.com:3306)/myapp?allowAllFiles=true&multiStatements=true
inputDirectory
string
required
Directory containing data files (.dkt) to load.
schemaFile
string
required
Path to the Wirekite schema file used by Schema Loader. Required for table structure information.
logFile
string
required
Absolute path to the log file for Data Loader operations.

Optional Parameters

maxThreads
integer
default:"5"
Maximum number of parallel threads for loading tables.
hexEncoding
boolean
default:"false"
Set to true if data was extracted using hex encoding instead of base64. Uses unhex() for decoding.
databaseRemote
boolean
default:"true"
When true, uses LOAD DATA LOCAL INFILE. When false, uses LOAD DATA INFILE (requires file access from server).
For best performance, set maxThreads equal to the number of CPU cores available on the loader host.

Change Loader

The Change Loader applies ongoing data changes (INSERT, UPDATE, DELETE) to SingleStore tables using a merge approach with shadow tables.
The Change Loader implements virtual MERGE operations using INSERT-SELECT, UPDATE, and DELETE statements since SingleStore doesn’t have native MERGE support.

Required Parameters

dsnFile
string
required
Path to a file containing the SingleStore connection string.
Connection string format:
username:password@tcp(host:port)/database?allowAllFiles=true&multiStatements=true
inputDirectory
string
required
Directory containing change files (.ckt) from the Change Extractor.
workDirectory
string
required
Working directory for temporary CSV files during merge operations. Must be writable.
schemaFile
string
required
Path to the Wirekite schema file for table structure information.
logFile
string
required
Absolute path to the log file for Change Loader operations.

Optional Parameters

databaseRemote
boolean
default:"true"
When true, uses LOAD DATA LOCAL INFILE for loading changes to merge tables.
maxFilesPerBatch
integer
default:"30"
Maximum number of change files to process in a single batch before executing merge operations.
The Change Loader should not start until the Data Loader has successfully completed the initial full load.

Orchestrator Configuration

When using the Wirekite Orchestrator, prefix target parameters with target.schema., target.data., or target.change.. Example orchestrator configuration for SingleStore target:
# Main configuration
source=mysql
target=singlestore

# Schema loading
target.schema.schemaFile=/opt/wirekite/output/schema/wirekite_schema.skt
target.schema.createTableFile=/opt/wirekite/output/schema/create_tables.sql
target.schema.createConstraintFile=/opt/wirekite/output/schema/constraints.sql
target.schema.createForeignKeyFile=/opt/wirekite/output/schema/foreign_keys.sql
target.schema.logFile=/var/log/wirekite/schema-loader.log

# Data loading
target.data.dsnFile=/opt/wirekite/config/singlestore.dsn
target.data.inputDirectory=/opt/wirekite/output/data
target.data.schemaFile=/opt/wirekite/output/schema/wirekite_schema.skt
target.data.logFile=/var/log/wirekite/data-loader.log
target.data.maxThreads=8
target.data.databaseRemote=true

# Change loading (CDC)
target.change.dsnFile=/opt/wirekite/config/singlestore.dsn
target.change.inputDirectory=/opt/wirekite/output/changes
target.change.workDirectory=/opt/wirekite/work
target.change.schemaFile=/opt/wirekite/output/schema/wirekite_schema.skt
target.change.logFile=/var/log/wirekite/change-loader.log
target.change.maxFilesPerBatch=30
target.change.databaseRemote=true
For complete Orchestrator documentation, see the Execution Guide.