You can create a pipeline that writes back data from an Anaplan Data Orchestrator dataset to a target table in MySQL.
Prerequisites
You need a connection to MySQL to create a pipeline. Make sure you meet the prerequisites in these sections before you create a connection to MySQL and a writeback pipeline.
Connectivity prerequisites
Writeback pipeline prerequisites
Create a connection to MySQL
You need your MySQL credentials to connect the MySQL data with Data Orchestrator. See the MySQL documentation for more information.
To create a connection:
Select Data Orchestrator from the top-left navigation menu.
Choose a dataspace from the list.
Select Connections on the left-side panel.
Select Create connection.
Select the MySQL connectorand then select Next.
If you can't find the connector, enter a search term in the Find... field.
Enter these details on the Connection details screen, and then select Next:
Name: Create a name for your connection. The name can contain alphanumeric characters and underscores.
Description: Enter a description about your connection.
Enter your MySQL credentials on the Connection credentials screen, and then select Next.
Username: The MySQL user name required to authenticate.
Password: The MySQL password required to authenticate.
Host: The MySQL host domain. The host is provided by the administrator of your MySQL instance.
Port: The MySQL port number. The port number is provided by the administrator of your MySQL instance.
Database: The MySQL database name.
CA Certificate: The MySQL connector supports TLS/SSL encryption. TLS/SSL encryption enables you to establish a secure, encrypted connection to MySQL instances. It protects data in transit from being intercepted or read by unauthorized parties. The connection is secured using a digital certificate installed on the server. This provides an essential layer of data protection.
For the connector to use the CA certificate, you must first decode the Base64-encoded CA certificate in the PEM format. For example:
After the connection test is complete, select Done.
Note: If you need to edit the connection, you must enter the CA certificate again.
Create a writeback pipeline
When you set up the writeback pipeline, you'll use your connection to export either a source dataset or a transformation view dataset (derived dataset) from Data Orchestrator to MySQL.
To create a writeback pipeline:
Select Data Orchestrator from the top-left navigation menu.
Choose a dataspace from the list.
Select Pipelines from the left-side panel.
Select Create pipeline.
Enter a Name for your pipeline and then select Create.
You are taken to the pipeline designer view.
Select the Source icon, and then complete these steps in the right-side panel:
Select Anaplan from the Connection type dropdown.
Select Datasets from the Choose connection dropdown.
Enter a new Label to change the source display name in the designer view.
Select Source location > Source, choose a Data Orchestrator dataset, and then select Confirm.
The dataset is used as the source for your pipeline.
Optionally, select the add icon that appears between the Source and Sink nodes. You can add steps to your pipeline to process data.
Select the Sink icon, and then complete these steps in the right-side panel:
Select MySQL from the Connection type dropdown.
Select the MySQL connection you created from the Choose connection dropdown.
Enter a new Label to change the sink name that displays in the designer view.
Select Target location > Table, select a MySQL table, and then select Done.
Select Target mapping > Mapping, map the Data Orchestrator source dataset values to the MySQL target values, and then select Done.
Select a Write option for the target table: Append, Full replace, or Upsert.
This determines how data is written to the target table. See the Write options section below for more details.
Select Publish, and then select Run to execute the data transfer.
Write options
Review this table to determine which write option to select.
Write options
Description
Append
Adds all rows from the source data to the existing rows in the target table.
If you select Append, a staging table in MySQL is required:
To automatically create a staging table, don't select the Specify staging table name checkbox. This checkbox is under the Advanced options section.
To manually specify an existing staging table in MySQL,
Expand the Advanced options section.
Select the Specify staging table name checkbox.
Enter the MySQL staging table name in the Specify staging table name field.
See the Staging table section below for more information.
Note: Append load isn't suitable for target tables with primary keys.
Full replace
Deletes all existing data in the target table and replaces it with the source data.
If you select Full replace, a staging table in MySQL is recommended and selected by default:
If you don't want to create a staging table, don't select the Stage data before replacing the target checkbox. This checkbox is under the Advanced options section.
If you want to create a staging table:
Expand the Advanced options section.
Select the Stage data before replacing the target checkbox.
Specify the staging table details:
To automatically create a staging table, don't select the Specify staging table name checkbox.
To manually specify an existing staging table, select the Specify staging table name checkbox. Then enter the existing staging table name in the Specify staging table name field.
See the Staging table section below for more information.
Upsert
Updates existing rows and adds new rows based on a specified key.
If you select Upsert,a staging table in MySQL is required:
Select a Primary key.
The columns you select are used to identify existing rows when using the upsert write option.
Specify the staging table details:
To automatically create a staging table, don't select the Specify staging table name checkbox. This checkbox is under the Advanced options section.
To manually specify an existing staging table in MySQL:
Expand the Advanced options section.
Select the Specify staging table name checkbox.
Enter the MySQL staging table name in the Specify staging table name field.
See the Staging table section below for more information.
Staging tables
Staging tables are used to compare and process data before Data Orchestrator loads the data to the final target table in MySQL.
If you want to use a staging table, you have the option to:
Automatically let Data Orchestrator create a staging table in MySQL.
Manually specify an existing staging table in MySQL.
This table describes how staging tables are used in MySQL for each option.
Staging table options
Results
Automatically create a staging table in MySQL
After you run the pipeline:
Data Orchestrator automatically creates a temporary staging table in MySQL. MySQL then merges the data in the temporary table with the target MySQL table you selected for the mapping.
After the data has been successfully loaded into the target table, Data Orchestrator deletes the temporary staging table.
Manually specify an existing staging table from MySQL
After you run the pipeline:
The data is pushed from Data Orchestrator to the MySQL staging table you specified.
MySQL automatically merges the Data Orchestrator data in the staging table with the target MySQL table you selected for the mapping.
Note: To prevent data mismatch errors with MySQL, make sure your data in Data Orchestrator and in MySQL have a schema alignment. This means the tables in Data Orchestrator and in MySQL must have the same columns and data types.
Verify the writeback in MySQL
Once the pipeline is successfully completed, you can log in to your MySQL account to verify the data load.
Navigate to the target database, schema, and table specified in the pipeline configuration. The data written from the Data Orchestrator dataset is available in the target table, based on the selected write option (append, full replace, or upsert).