MBO Synchronization Groups

Understand how to effectively use MBO synchronization groups.



Synchronization groups allow MBOs with similar characteristics to be synchronized together. See Synchronization Groups



Consider the cost of multiple synchronization sessions with a single synchronization group, versus a single session with multiple groups. See Synchronization Sessions.



For flexibility, separate MBOs into appropriate synchronization groups.



To implement synchronization priority, use synchronization groups; indicate which group to synchronize first.



Use synchronization groups to break up large synchronization units into smaller coherent units to deal with low-quality connectivity.



Use one synchronization session for multiple synchronization groups during runtime to reduce overhead if appropriate.



Relationships should not span multiple synchronization groups.



Too many MBOs within a synchronization group defeats the purpose of using a group; limit groups to no more than five MBOs.

Synchronization Groups

A synchronization group specifies a set of MBOs that are to be synchronized together. Usually, the MBOs in a group have similar synchronization characteristics. By default, all MBOs within a package belong to the same group.

A synchronization group enables the mobile application to control which set of MBOs is to be synchronized, based on application requirements. This flexibility allows the mobile application to implement synchronization prioritization, for example, to retrieve service tickets before retrieving the product information associated with those tickets. Another advantage is the ability to limit the amount of data to be synchronized in case of poor connectivity. A large synchronization may fail repeatedly due to connectivity issues, whereas a smaller group may succeed.

Placing too many MBOs in a synchronization group may defeat the purpose of using groups: the granularity of the synchronization group is influenced by the data volume of the MBOs within the group, urgency, data freshness requirement, and so on. As a general guideline, limit synchronization groups to no more than five MBOs. And keep in mind that a package can contain no more than 30 synchronization groups.

Synchronization Sessions

You can use multiple synchronization groups within a single synchronization session. If no synchronization groups are specified, the default synchronization group is used. A session with multiple groups is more efficient than multiple sessions using one group at a time. More sessions means more transactions and more overhead. Therefore, the mobile application developer should determine or allow the user to choose what to synchronize through an appropriate user interface. For example, when WiFi connectivity is available, the user can choose an action that synchronizes all MBOs together in one session. Specifying a synchronization session provides flexibility to both the application developer and user. This code snippet shows how to synchronize multiple groups within a single session.

ObjectList syncGroups = new ObjectList();
syncGroups.add(CustomerDB.getSynchronizationGroup("orderSyncGroup"));
syncGroups.add(CustomerDB.getSynchronizationGroup("activitySyncGroup"));
CustonmerDB.beginSynchronize(syncGroups, "mycontext");

Relationships and Synchronization Groups

Relationships that span multiple synchronization groups can cause inconsistent object graphs on the client database, which may in turn cause application errors and user confusion. In general, the only reason to have an object graph that spans synchronization groups is to implement a deferred details scenario. For example, in a field service use case, the engineer wants to review his latest service ticket assignments without worrying about all the relevant details associated with the ticket (product manuals). One obvious solution is to forgo the relationship since it is an association (in UML terminology). Although the navigation ability provided by the relationship has been sacrificed, it can easily be addressed by using a custom function that locates the product manual.