oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

A Briefing on Syncing

by Michael E. Cohen

Editor's note: The following article is an excerpt from Take Control of Syncing in Tiger, a $10 electronic book available for download from TidBITS Electronic Publishing. This 135-page e-book covers tasks like syncing data between your Mac and mobile phone, iPod, or PDA with Apple and third-party software; offers suggestions for syncing effectively; and provides practical troubleshooting advice.

A Briefing on Syncing

The idea behind synchronizing, or syncing, is simple: take information you collect on one device, like the calendars and contact lists you keep on your laptop or mobile phone, and combine it with similar information on other devices, like your desktop Mac or your iPod, so that the two sets of information match.

Though the idea behind syncing may be simple, putting it into practice requires coming up with reliable solutions to some knotty problems. Here are the biggies:

  • How do you get the information from one device to another?
  • How can you guarantee that the most recently changed pieces of information replace the outdated ones?
  • How do you resolve conflicts when the same pieces of information are changed in different ways on different devices?
  • How do you translate between the internal storage formats that different devices may use for the information you want to sync?

All tough questions, but ones you don't have to answer because the developers who create syncing applications already have—in fact, Apple itself has answered these questions several times in several ways over the last few years.

The answers that Apple came up with in Tiger, and the path it took to get them, can help you better understand how syncing works (the first step in taking control of syncing), regardless of whether Apple or a third-party developer supplies the solution you end up choosing for your syncing needs.

Apple Syncing's Evolution

Apple's first stab at a syncing solution came in 2002, in the form of iSync for Jaguar, a one-stop syncing solution for portable devices and Macs. Apple designed iSync to work with Jaguar's new personal information applications—iCal and Address Book—providing an easy way for Mac users to sync calendar and contact information with other Macs (via Apple's .Mac online subscription service) and with mobile phones, PDAs, and iPods.

iSync for Panther added more compatible devices, fixed some bugs, and incorporated some minor new features, but it didn't change the basic concept: if you wanted to sync something, you used iSync.

But Apple had already begun to realize that there was more to syncing than just addresses and calendars, and that a more general, adaptable approach to syncing—one that third-party developers as well as Apple could exploit—was needed.

With Mac OS X 10.4 Tiger, Apple has introduced such a general, adaptable syncing strategy: syncing has become a system service that any application can use. In the process, iSync has become only one tool among several that you can use to sync information—the one-stop syncing solution is no more.

Apple's brave new world of system-wide syncing has its pros and cons. On one hand, you can expect to see more applications that take advantage of Tiger's syncing service and that can sync their data between Macs and other devices—for example, as this e-book was being written, Microsoft introduced a new version of Entourage that exploits Tiger's syncing service. On the other hand, you'll have to work harder to remember which applications sync which kinds of information, and with which devices.

No one said that living in the future would be easy.

Apple's Syncing Model

To make syncing into a system-wide service, Apple has devised a model that describes what syncing is and how it works, a model flexible enough to be useful in a variety of programs and devices. If you understand this model, you'll be better able to take control of syncing on your Macintosh and less apt to be confused by any hiccups in the syncing process.

The Players

Apple's syncing model includes three kinds of participants in the syncing process:

  • Client: A client consists of an application or a process running on your Mac that makes use of Mac OS X's syncing services. iSync, for example, is a syncing client. Clients usually initiate the syncing process.

  • Sync engine: The sync engine, provided by Mac OS X's syncing services, handles syncing requests from clients. Clients, in Apple's model, don't sync directly with each other; the sync engine handles all the syncing tasks between clients. The sync engine can also notify some clients that a sync session is taking place and invite those clients to join.

  • Truth database: The truth database contains records of all the information that clients have synced through the sync engine, as well as descriptions of the various storage formats that particular clients use for that information. Clients never communicate directly with the truth database; the sync engine, and the sync engine alone, has access to the truth database. The sync engine uses the truth database to resolve any conflicts between clients, to store newly received information, and to supply the latest information that a client may request.

Note: Each user account has its own truth database, located in ~/Library/
Application Support/SyncServices/Local
. If you're a .Mac user, part of your truth database also resides among the folders in your iDisk's /Library/Application Support/SyncServices folder. Now that you know this, restrain yourself from modifying the files that make up this database.

Pages: 1, 2, 3

Next Pagearrow