Home > Articles

This chapter is from the book

Challenges with Data Synchronization

Data synchronization technology is a very important part of enabling offline usage of data, but it also presents some challenges that need to be solved in order to provide a sound solution. The following section focuses on the central master topology, since it is currently the most widely used.

The main challenges are:

  • Conflicting updates
  • Conflict detection
  • Conflict resolution

Another challenge with data synchronization is the need to agree on a common content format for data exchanges. For PIM data, SyncML requires the support of specific content formats to ensure successful synchronizations.

Conflicting Updates

In Data Synchronization, where copies of the same data reside on more than one device, it is very likely that the same entry is manipulated on more than one device.

Consider a datastore with customer records, containing the customer's name, address (street and city), and data about recent orders. This data is centrally stored in the corporation's mainframe computer. The salesmen who visit customers during the day synchronize their PDAs with this corporate datastore every morning and every evening.

During his visit at a customer, the salesman changed the fax number for the customer "Smith" to "12345". The same day, the customer relations department received a letter from Mr. Smith notifying them that his fax number has changed. The customer relations agent updated Mr. Smith's record, but unfortunately made a typo while entering the number and updated the entry with "92345".

Two conflicting updates to the same record have been made since last time the salesman synchronized the customer datastore. It is now up to the synchronization server to first detect the conflict and then resolve it.

If the synchronization server could not detect the conflict, it would send the update it had received from the customer relationship department to the salesman's PDA and would also update the master datastore with the update the salesman made during the day. As a result, the content of the two copies would not contain the same data—the master datastore would have the fax number "12345", and the salesman's PDA would contain "92345". This problem would probably remain, undetected and uncorrected, until somebody updated the same object again. The problem described below is illustrated in Figure 1–8.

The update conflict described above is known as a write-write conflict: The same field is updated in the same time period in two different copies of the datastore. Other update conflicts include read-write conflict and constraint violations. They are explained later in this chapter.

Figure 1-8Figure 1–8 Synchronization without conflict detection

For example, examine the following scenario: During the day a salesman is entering a new order for the customer with the name "Smith" and changes his fax number from "98765" to "12345". At the same time, the corporate marketing department is creating a list of all customers' fax numbers for a mass mailing. The salesman hasn't synchronized his PDA yet, and therefore the central datastore's entry for the fax number of the customer "Smith" still contains "98765", where "12345" is the correct value. This situation is called a stale read, where one retrieves an entry from one copy of the datastore that is not up to date because a change was made to another copy of the same datastore and wasn't propagated to all other copies of the datastore. Figure 1–9 illustrates this situation.

Figure 1-9Figure 1–9 Stale reads

In the case of a read-write conflict, the update to a data field is made based on the value of another field in the datastore. While making this update in one copy of the datastore, the field that determined the decision to update the other field was changed in another copy of the datastore. Therefore the update is made based on a stale read. Detecting these conflicts is especially important for Relational Databases. PIM systems rarely have these conflicts.

One possible example of a conflict based on a constraint violation is where a certain field in the datastore is constrained to accept only values

between "1" and "10". Now this constraint is changed such that only values between "1" and "5" are acceptable. In another copy of the datastore, somebody enters a value of "8" into the field with this constraint. During the next synchronization the synchronization server has to detect this conflict if the datastore is to be kept consistent.

One possible way of preventing conflicting updates (especially read-write conflicts) is to obtain exclusive access to an object before updating it. In the central master scenario this would require the device to contact the central master and request exclusive access. This might be possible in intranet scenarios, but is not an option with mobile devices. Mobile devices might be in areas that currently have no network coverage. Also, setting up a wireless network connection, for example via GSM, takes a few seconds and can be quite expensive (especially when roaming internationally). Therefore getting exclusive access to the object before updating it is not a practical alternative. Thus, a synchronization server must be capable of detecting and resolving conflicts.

The conflicts mentioned above all belong to a category of conflicts called mechanical conflicts, since there have been concurrent modifications to the same record. It is also possible, however, for a user to enter a meeting with a customer from 8:00 to 10:00 in the morning while his secretary blocks the 9:00 to 10:30 slot for a meeting between the user and his manager. From a synchronization technology point of view, there is no conflict. Both records were newly added distinct calendar entries. But the user now has to attend two meetings from 9:00 to 10:00, which is a semantic conflict that the user needs to solve. The calendar application can in this case support the user by detecting the conflict and informing the user about this.

Conflict Detection

Conflict detection is important in order to keep different datastores in "sync," meaning keeping them consistent.

One important prerequisite of being able to synchronize data is the ability to uniquely identify each record in the datastore. Relational Databases have primary keys that serve this very purpose. In other types of datastores, such as PIMs for example, UIDs (unique identifiers) are used. The UIDs in the datastore on the central master are usually called GUIDs (globally unique identifiers; possibly only unique in the scope of that one datastore). Each copy of the datastore on a client has

its own UIDs to identify the records, which are called LUIDs (locally unique identifiers).

The central master maintains a datastore to store the LUID of each record for every client that synchronized a given datastore. While synchronizing, the central master uses this LUID to tell the client which record to modify.

A synchronization session usually starts with the client sending a list of changed records since the last synchronization for a particular datastore to the server. Next, the central master then generates a list of all modifications that occurred during in the same time period. To detect possible conflicts, the server then compares the two lists and identifies every LUID/GUID combination that exists in both of the lists as a conflict, as shown in Figure 1–10.

Figure 1-10Figure 1–10 Identifying an update conflict

Conflict Resolution

Conflict resolution is the action that the server must take after a conflict has been detected.

There exists a wide variety of methods a server can use to resolve conflicts. The easiest way for the server is to duplicate the entries and to mark them as conflicts. This strategy does not lose any data, but puts the burden of resolving the conflicts on the user (who has to manually choose the correct record or merge the two records).

The next possibility is for the server to identify one of the two conflicting records as the winner and delete the other one. The decision can be based on user preferences, such as:

  • Updates made on the client always win.

  • Updates made on the server always win.

  • The latest change wins.

Basing the decision on where the change was made is a pretty simple method to implement. Making the decision based on which one of the two conflicting updates was the latest one is more complicated. First, this requires the datastores to record the time when the change was made. This is often impossible, especially with mobile devices, like mobile phones, or PDAs, like the Palm Pilot™. For this to work, the system time needs to be synchronized across all the devices involved, or a scheme must be set up to address time-drift.

The third method to resolve conflicts is to merge the two conflicting records into one new one. This could be done in cases where complete records are synchronized, for example an address book record containing name, street, city, and phone number. Additionally, this requires the synchronization server to understand the structure of the data that is synchronized and to be able to identify the field within that structure that was changed. This is not possible if the records contain only single fields that are to be synchronized, and the synchronization server cannot interpret the data in the field.

Resolving conflicts with PIM data is relatively easy. It is more complex with Relational Databases, which usually have relationships between different records that need to be honored during conflict resolution.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020