Skip to main content

Sync actions

Overview

When configuring a data sync you must set your sync behaviour. You have two options for this: Full File or Delta.

Full File syncs intake both the source and the destination data and reconcile the records by matching up the sync key. This determines any differences and allows it to perform updates, inserts, ignores, or deletes at the destination.

Delta syncs skip the reconciliation process. In batch syncs, it simply grabs records from the source and inserts it into the destination. In real-time syncs, it may act differently depending on the event type. For example, when using the Cinchy Event Broker/CDC with an insert event, a delta sync will insert the data into the destination, an update event will update, etc.

Delta syncs also have the option to provide an "Action Type Column" for REST API destinations. This reads the value of the source record from a specified column. If the value is INSERT, then it inserts the record, UPDATE, then it updates, DELETE, then it deletes.

Full file sync

When using the Full File synchronization strategy there are four distinct sections that must be configured: the Sync Key and the Sync Record Behaviours, which include actions for New, Dropped, and Changed records. (Image 1).

Image 1: Full File Syncs

Sync key

The sync key is a unique key reference you use for data syncs from the data source into your destination. You can use it to match the data between the source and the target for updates on changed records.

To set this using a config XML, use the following guide:

  • Elements: <SyncKeyColumnReference>
    • This is used in the <SyncKey> element when specifying which columns in the Target Table to be utilized as a unique key for the syncing process.
  • Contained-In: <SyncKey>
  • Attributes: name. The name of a column in the destination that you are syncing data into.
<SyncKeyColumnReference
name:"string">
</SyncKeyColumnReference>

Sync Record Behaviour

The Sync Record Behaviour divides into three subsections which defines what action to take on certain records (Image 2).

Image 2: Sync Record Behaviour

caution

Values in the attributes section of the config XML for record behaviour are case sensitive.

New Record Behaviour

New Record Behaviour defines what action to take when a new record is found in the sync source. This can be either INSERT or IGNORE.

To set this using a config XML, use the following guide:

AttributeDescriptionValues
typeThe type defines the action upon the new record.It can either be INSERT or IGNORE.
  • INSERT will insert the new record.
  • IGNORE will do nothing to the record.
<NewRecordBehaviour type="INSERT" />

Dropped Record Behaviour

Dropped Record Behaviour defines what action to take when a new record isn't found in the sync source, but exists in the target. This can be either DELETE, IGNORE, or EXPIRE.

To set this using a config XML, use the following guide:

AttributeDescriptionValues
typeThe type defines the action upon the dropped record.It can either be IGNORE, EXPIRE, or DELETE.
  • IGNORE will do nothing to the record.
  • EXPIRE will populate a specified expiration timestamp field as the current time. An expirationTimestampField must be provided. This is a reference to a date/time column in the target that should be updated with the execution timestamp if the record is dropped.
  • DELETE will delete dropped records in the target data set.
expirationTimestampFieldThis attribute is only applicable if the type is equal to EXPIRE.The expirationTimestampField is the name of an existing date field to be filled with the current time.
<DroppedRecordBehaviour
type="EXPIRE"
expirationTimestampField="string">
...
</DroppedRecordBehaviour>

2.2.3 Changed Record Behaviour

Changed Record Behaviour defines what action to take when a new record with a sync key is found in the sync source and also exists in the target. This can be either Update or Ignore.

To set this using a config XML, use the following guide:

AttributeDescriptionValue
typeDefines the action upon the new record.- UPDATE: Updates the record.
- IGNORE: Does nothing to the record.
- CONDITIONAL: Opens a new UI for conditions. Review Appendix A for more info.
<ChangedRecordBehaviour type="UPDATE" />

Indexing

To ensure that the data lookup is performant, and to mitigate the impact on other operations within your system while the reconciliation occurs, an index should be added to Cinchy table (or other database) destinations when using an event based source.

For Cinchy table destinations, add an index to the deleted column, plus whichever columns contain your sync key. Click here for documentation on setting up an index in Cinchy.

For other database destinations, add an index in your system to whichever columns contain your sync key.

Delta Sync

When using the Delta synchronization strategy there is one optional configuration that you can expose when running a sync with a REST API destination (Image 3).

The Action Type Column reads the value of the source record from a specified column. If the value is INSERT, then it inserts the record, UPDATE, then it updates, DELETE, then it deletes.

Image 3: Delta Syncs

Appendix A

Full File Sync - Conditional Changed Record Behaviour

Added in Cinchy v5.6, the Changed Record Behaviour - Conditional feature allows you to define specific conditions upon which to update your records (Image 4).

  • You can add multiple Conditions to a single data sync by using the AND/OR and +Rule buttons.
  • You are able to group your Rules into a rule set by using the +Ruleset button.
  • If your Condition evaluates to true then it will update your records
  • Use the The left-most drop down to select either a source or a target column as defined in your Source and Destination tabs
  • Use The centre drop-down to select from the following options:
    • \=
    • !=
    • Contains
    • Is Null
    • Is Not Null
  • Use the The right-most drop-down to:
    • Add a plain value (ex: text, numerical, etc.) This will adjust based on the column data type picked in the left-most drop down. For example, if in the source schema the column is a date, then it renders a date picker.
    • Select either a source or a target column as defined in your Source and Destination tabs (when used in conjunction with the Use Columns checkbox)

Image 4: Conditional record behaviours

For example, the below condition would only update records where the target column "Name" is null (Image 5).

Image 5: Conditional Example