Data Sync Map Objects
Object mapping defines how source objects (databases, schemas, tables) correspond to target objects in Tacnode. Each synchronization job has default mapping rules that can be customized to meet specific requirements.
Understanding Object Structure
Target objects in Tacnode follow the structure: database.schema.table
database
: The database nameschema
: The schema within the databasetable
: The table name
Object mapping shows how each source object maps to its corresponding target object during synchronization.
Managing Mapping Rules
Edit Individual Mappings
Configure mapping rules for specific nodes, including changing node attributes and setting inheritance behavior.
Global Edit Operations
Use the Global Edit button to apply mapping rules to multiple sibling nodes simultaneously, streamlining bulk configuration.
Mapping Rule Syntax
Data Sync supports three types of expressions for defining mapping rules:
1. Constants
Use single quotes to define static values:
2. Concat Function
Combine constants and source variables using the concat
function:
Available Source Variables:
SOURCE_DATABASE
: Name of the source databaseSOURCE_SCHEMA
: Name of the source schemaSOURCE_OBJECT
: Name of the source object (table, view, function)
Example:
This maps a source table to the same table name in the public
schema of the target database.
3. Case When Expressions
For complex mappings like consolidating sharded tables, use conditional logic:
Supported Conditions:
LIKE Pattern Matching:
Regular Expression Matching:
In regex patterns, captured groups are accessible as $1
, $2
, etc.
Practical Examples: MySQL to Tacnode
Example 1: Change Default Database and Schema
Map all tables to a different database and schema:
Example 2: Rename Specific Table
Change a specific table name during mapping:
Example 3: Consolidate Sharded Tables
Using LIKE patterns:
Using Regular Expressions:
This pattern matches tables like users_001
, users_002
, etc., and maps them all to a single users
table.
Column Mapping and Transformation
Configure field-level transformations including pruning, mapping, and type conversion.
Existing Target Tables
When the target table already exists, you can:
- Field Pruning: Select which source columns to include
- Field Mapping: Map source columns to different target column names
New Target Tables
When creating new target tables, additional options are available:
- Field Pruning: Select which source columns to include
- Field Renaming: Specify custom names for target columns
- Type Conversion: Change column data types during synchronization
Best Practices
- Start Simple: Begin with default mappings and customize as needed
- Test Patterns: Verify regex patterns match expected objects before deployment
- Plan for Scale: Design mapping rules that accommodate future growth
- Document Logic: Keep records of complex mapping rules for maintenance
- Use Descriptive Names: Choose clear, consistent naming conventions for target objects