Configuration and Synchronization

y2ysync synchronization heavily relies on the y2ysync and the Data Hub extensions. For that reason, it requires proper configuration, both on the Platform side and the Data Hub side.

Configuration

We've provided extensive configuration options for you. They allow you to specify the range and type of data you want to synchronize. To configure y2ysync on the Platform side, use the following items:

Item

Description

Y2YColumnDefinition

The most basic configuration item. It represents a single attribute (a column) that you can synchronize. The product's code is an example of such an attribute.

Y2YStreamConfiguration

Represents a single type that you can synchronize. It contains multiple Y2YColumnDefinition items that define attributes you want to synchronize. The product, as defined in Platform (contains multiple attributes), is an example of such a type.

Y2YStreamConfigurationContainer

Represents a single unit of synchronization that contains multiple Y2YStreamConfiguration items. When you initiate synchronization, you search for changes in all the items that belong to the types specified in Y2YStreamConfigurationContainer. These changes are then saved as medias for export.

In addition to preparing configuration on the source Platform side, you have to configure Data Hub with installed y2ysync-datahub-ext extension. Such a configuration describes:
  • The data model that you feed into Data Hub from Platform

  • Transformations the data model should undergo during the composition phase

  • The target systems to which you want to push the data.

You can generate your Data Hub configuration using the Data Hub Configuration Generator. It generates an xml based on Y2YStreamConfigurationContainer. Use the same Data Hub Configuration Generator to upload your configuration to the running Data Hub.

For more information, see Generating and Uploading Data Hub Configuration XML.

Synchronization

The synchronization process usually involves three parties:
  • The source system detects items that you created, changed, or deleted since the last synchronization. It creates files that contain information about the changes - medias. It finally sends a request to Data Hub to start executing its part of the synchronization process.

  • Data Hub acts as a middleman between the source and the target systems. Data Hub imports data from the source system, composes it and publishes to the target system. Depending on configuration, you can trigger these steps automatically or manually. For more information, see Target System Definition and Auto Passthrough.

  • The target system receives the new or updated data via impex

You can initiate synchronization programmatically using the startSync method from SyncExecutionService, or by clicking the Perform Y2YSyncJob Action button available in Backoffice. To initiate synchronization, an instance of Y2YSyncJobwith a unique code is required. It must be also assigned to a specific Y2YStreamConfigurationContainer. As a result of initiation, Y2YSyncCronJob is created. Each Y2YSyncCronJob represents a single execution of a synchronization action at a given time. It also holds SyncImpExMedia objects that contain the data that have changed since the last synchronization.

You can make Data Hub import the y2ysync media files again if the previous attempt failed. To do it, click the Resend to datahub action button available in Backoffice.

The relation between Y2YSyncJob and Y2YStreamConfigurationContainer is somehow similar to Factory and objects that it produces. The second execution of synchronization would create another Y2YSyncCronJob object. The result doesn't overwrite the previous Y2YSyncCronJob. Thanks to such a design approach, you can keep the history of synchronization attempts.

Data Hub Processing Details

When all y2ysync medias have been created, the source Platform calls the Data Hub endpoint. It is exposed by the y2ysync-datahub-ext extension at the address /y2ysync/v60. The request from Platform to Data Hub to start executing its part of the synchronization process contains the following information:
  • the synchronization execution id

  • the source Platform url

  • links to all medias created in the change detection process

  • a pool and a feed

  • the auto-publish target systems.

y2ysync uses a feed and a pool just as they are specified in Y2YStreamConfigurationContainer. If they don't exist in Data Hub, they get created.
The next step of the synchronization process depends on whether you have specified the target system earlier or not. If not, then y2ysync assumes the manual mode for composition and publication. In this case, you must trigger composition and publication manually in Data Hub. However, if you have specified your target system in Y2YStreamConfigurationContainer in the source Platform, the target system implicitly enables the automatic passthrough mode. In the automatic passthrough mode, composition and publication are triggered automatically. For more information, see Target System Definition and Auto Passthrough.