Real-time sync example
Last updated
Last updated
This example will take you through the creation and execution of a real-time data sync where data will be synced between two Cinchy tables based on real-time changes.
Your People table captures a view of various personnel information. Any time a new hire is added to the table, you want that information to be immediately synced into the New Employees table. We can solve this use case using the Cinchy Change Data Capture (CDC) function on our tables. This helps you to better keep track of all incoming people within your company.
This section has steps on how to:
Create the People table.
Create the New Employees table.
When you create tables to use with real-time syncs, make sure you turn on the Cinchy Change Data Capture feature through the Design Table > Change Notifications tab. This makes sure you capture real-time updates.
Login to your Cinchy platform.
From under My Network, click the Create > Standard Table > From Scratch.
Create a table with the following properties (Image 1):
Table Details | Values |
---|---|
If this domain doesn't exist, either create it or make sure to update this parameter where required during the data sync.
Click Columns in the left hand navigation to create the columns for the table.
Click the "Click Here to Add" button and add the following columns:
Select Change Notifications in the left hand navigation and select Publish Change Notifications.
Select Save to save your table.
Within the Cinchy platform, from under My Network, select Create
Select Table
Select From Scratch
Create a table with the following properties (Image 2):
Select Columns in the left hand navigation to create the columns for the table.
Select the "Click Here to Add" button and add the following columns:
Click the Save button to save your table.
You have two options when you create a data sync in Cinchy.
You can input all the necessary information through the Connections UI. Once saved, this data uploads as an XML file into the Data Sync configurations table.
You can bypass the UI and upload your XML config directly into the Data Sync configuration table yourself.
This example will walk you through both options.
Within your Cinchy platform, navigate to the Connections Experience (Image 3).
In the Info tab, input the name of your data sync. This example uses "New Hires" (Image 4).
As of 5.7, you can now configure the Topic JSON in the Source tab under the Listener section. If you still need to manually configure the Topic JSON, see the appendix for more information.
Navigate to the Source tab.
Under Select a Source, select Cinchy Event Broker (Image 5).
Under Listener, select the People table.
Navigate to the Destination tab and select Cinchy Table from the drop down (Image 6).
In the Connection section, input the Domain and Table name for your destination. This example uses the Sandbox domain and the People table.
Click Load.
Select the columns that you wish to use in your data sync (Image 8). These will be the columns that your source syncs to your target. This example uses the Name and Title columns. You also have many Cinchy system table available to use.
Click Load.
The Connections experience will try to automatically map your source and destination columns based on matching names. In the below screenshot, it has been able to correctly match the Name and Title columns (Image 8).
Navigate to the Sync Actions tab. Two options are available for data syncs: Full File and Delta. For this example, select Full File.
Set the following parameters (Image 9):
Navigate to the Permissions tab. Here you will define your group access controls for your data sync. You can set this how you like. This example gives all users access to Execute, Write, and Read our sync (Image 10).
Click Save.
Navigate to the Cinchy Listener Config table and validate your configuration. Make sure it's set to Enabled. Your real-time data sync should now be listening to your People table ready to push updates to your New Employees table.
Test your data sync by adding a new row to your People table. Ensure that the data is then updated across to the New Employees table (Images 11 & 12).
Instead of using the Connections UI, you can also set up a data sync by uploading a correctly formatted XML into the Data Sync Configs table within Cinchy.
We only recommend doing so once you have a good understanding of how data syncs work. Not all sources and targets follow the same XML pattern.
The below XML shows what a blank data sync could look like for our Cinchy Event Broker/CDC to Cinchy Table real-time sync with full file synchronization.
The below filled XML example matches the Connections UI configuration made in Use the Connections UI . You can review the parameters used in the table below.
Once you have completed your Data Sync XML, navigate to the Data Sync Configurations table in Cinchy (Image 13).
In a new row, paste the Data Sync XML into the Config XML column.
Define your group permissions in the applicable columns. This example gives All Users the Admin Access.
The Name and Config Version columns will be auto populated as they values are coming from the Config XML.
Be sure when you are pasting into the Config XML column that you double click into the column before pasting, otherwise each line of the XML will appear as an individual record in the Data Sync Configurations table.
Navigate to the Cinchy Listener Config table and set up your configuration. Ensure it's set to Enabled. Your real-time data sync should now be listening to your People table ready to push updates to your New Employees table.
To execute your Data Sync you will use the CLI. If you don't have this downloaded, refer to the CLI commands list page
In this example we will be using the following Data Sync Commands, however, for the full list of commands click here.
Launch PowerShell and navigate to the Cinchy CLI directory.
Enter and execute the following into PowerShell:
Test your data sync by adding a new row to your People table. Ensure that the data is then updated across to the New Employees table (Images 14 & 15).
This section provides information on how to manually set up the listener config using the Listener Config table. While this example shows how to configure the sync using the Cinchy Event Broker/CDC, Cinchy also supports other Event Stream Sources. For more information, see the supported real-time sync stream sources.
Navigate to the Listener Config table in Cinchy (Image 16).
In a new row, add in your listener config data using the below table as a guide:
Before executing the data sync command, encrypt the password using PowerShell.
To encrypt a password using PowerShell, complete the following:
Launch PowerShell and navigate to the Cinchy CLI directory (note, you can always type PowerShell in the windows explore path for the Cinchy CLI directory).
Enter the following into PowerShell .\Cinchy.CLI.exe encrypt -t "password"
.
Hit enter to execute the command.
Copy the password so you have it accessible at batch execution time.
You will need to replace password
with your specific password.
The Execution Log table is a system table in Cinchy that logs the outputs of all data syncs. You can always review the entries in this table for information on the progression of your syncs (Image 17).
The Execution Errors table is a system table in Cinchy that logs any errors that may occur in a data sync (Image 18). Any data sync errors will also be logged in the temp directory outlined in the data sync execution command (-d "C:\Cinchy\temp"
)
Column Details | Values |
---|---|
Table Details | Values |
---|---|
Column Details | Values |
---|---|
For Return Columns, select All.
Parameter | Description | Example |
---|---|---|
Parameter | Description | Example |
---|---|---|
Parameter | Description | Example |
---|---|---|
Column | Description | Example |
---|---|---|