A synchronization loop results from an overlapping of databases in two or more sync groups such that a change in a database in one sync group is re-written to the same database by another sync group. Synchronization loops are self perpetuating and can result in large amounts of data repeatedly overwriting identical data in two of more databases. This can significantly degrade performance and increase costs as you pay for unnecessary data movement.
This article discusses the causes of synchronization loops and how to prevent them.
Figure 1: Two sync groups sharing a database. No synchronization loop
Top
How Figure 2 works (or doesn't work)
It is worth noting that while our synchronization loop example involves only a single row, what is true for one row is true for any number of rows. Imagine a million row database where 1% of the unchanged rows are changed in each synchronization cycle. After one cycle you are infinitely looping 10,000 rows. After two cycles you are looping that 10,000 plus an addiitonal 9,900 rows for a total of 19,900 rows. And the number of rows in the loop continues to increase, never decrease.
Figure 2: Two sync groups with a synchronization loop
How Figure 3 works (big loops are still loops)
In Figure 3 there are three sync groups. Each sync group has a hub and two other databases. Each database is shared by two sync groups but no pair of sync groups share the same two databases.
Let's walk through the sequence of events that take place when a change is made to any database in Figure 3. We'll assume the change is made to database A.
Figure 3: Three sync groups with a synchronization loop
Design your synchronization system so the loops cannot exist. For example: In Figure 2 you could remove either database A or B from the shared area. In Figure 3 you could remove any database from any sync group and you would break the loop.
Use row filtering. If you create mutually exclusive filters when you configure each sync group then no two sync groups will synchronize the same data. For example: In Figure 2 you could add the row filter Region = "NA" to one sync group and Region = "EU" to the other.
Use synchronization direction For example: If you set the sync directions as illustrated in Figure 4 you no longer have a loop.
Figure 4: Use synchronization direction to prevent loops
Feedback
See Also