Kony Fabric console User Guide: Appendix - Sync Strategy

Appendix - Sync Strategy

During offline operation, the mobile application on the device is completely disconnected from the server. Instances of the same application that may run on other mobile devices at the same time, either connected to or disconnected from the server. Data stored locally on the mobile device running in offline mode may be modified or deleted or new data may be created. Potentially, the same data entity may be modified by multiple mobile clients concurrently, running either in online or offline operation, with potential effects on the server data store. These modifications that may be in conflict with others, have to be synchronized with the data on the server when a mobile application switches back to online operation. During this process, conflicts need to be reconciled and updates have to be made available to other application clients connected.

To enable the above synchronization needs the server may choose to store the data before merging it with the Enterprise Datasource. Though this is not a mandatory requirement, it is very desirable when the Enterprise Datasource has not been designed for handling additional mobile users or is only occasionally available.

Kony Fabric Sync Framework provides two flexible sync strategies that help the application developer design the application that best suites the enterprise needs.

Over The Air Sync (OTAsync)

In this strategy whenever the mobile application invokes sync API, the Kony Fabric Sync server immediately merges upload packets with the enterprise server. Similarly the Kony Fabric Sync server queries the enterprise server for "delta" changes real-time and sends the same to the mobile application.

In this strategy, Enterprise Datasource is assumed to be available when the device starts the sync session.

Persistent Sync

In this strategy the application data is first persisted on Kony Fabric Sync server and later merged with the Enterprise Datasource as part of the offline process. Though this results in some data latency but ensures that the system is still functional even though the Enterprise Datasource may not be available.

In this strategy, the Sync Framework buffers / persists the backend data; during synchronization of a mobile client, the delta for that client is calculated based on the existing data in the Kony Fabric Sync Server. You can schedule replication jobs to occur at predetermined intervals to update the Kony Fabric Sync Server data. These jobs compare backend data with the data that is persisted in the Kony Fabric Sync Server and decide whether an object needs to be updated.

When to Use which Sync Strategy?

Deciding upon to use a Sync Strategy is one of the key architectural / designs decisions that you need to make when developing any enterprise grade offline application. This is not a simple decision but is based on number of input parameters and system constraints. Below are some of the recommendations that can help you determine to choose the appropriate strategy:

OTASync Strategy is recommended solution when:

PersistentSync is recommended solution when:

What are the prerequisites for OTASync strategy ?

In order to select the OTASync strategy for a particular SyncScope, ensure that the follow prerequisites are met:

What are the prerequisites for PersistentSync strategy?

In order to select the PersistentSync strategy for a particular SyncScope, ensure that the follow prerequisites are met:

ChangeTracking

Applications requiring data synchronization capabilities require that changes are tracked in the server database so that these changes can be delivered to clients during a subsequent synchronization session (and vice versa). Below, we discuss different strategies that you can apply / configure to ensure that you can share only incremental updates between client and server.

Kony Fabric Sync framework provides the ability to either utilize change tracking that the datasource provides or in absence of such capability at the datasource, the Sync framework itself can change tracking in the server.

Conflict Resolution

During synchronizing two data stores (local device client and enterprise server), conflicts may occur if the same data object is modified in both participating stores independently. You can detect the conflicts by comparing state information of the two objects. The resolution of a conflict is called reconciliation and is always performed on the enterprise schema.

Copyright © 2020 Kony, Inc. All rights reserved.