[NTLK] nSync - major change in sync methods

From: John Anderson (dearjohn_at_everchanging.com)
Date: Sat Nov 02 2002 - 06:25:52 EST


Alright, in preparation for the Dates sync, I've implemented a caching
system for Newton records on the Mac. I've implemented it in the
AddressBook sync because: (a) it improves performance, and (b) I can
get it tested and hopefully solid by the time the iCal syncing is done.

Before, NewtSync would download all changed records, and compare each
record with the AddressBook, adding or modifying records as necessary.
Then it turned around and sync'ed the other way, iterating through each
changed/new AddressBook record and querying the Newton for a matching
record.

The act of querying the Newton soup over and over seems to result in
sporadic problems, and isn't the most efficient way to handle this. So
I'm taking a more sophisticated take on synchronization. The first time
the user sync's, all records are downloaded from the Newton and kept in
a cache. Each cached record references the Newton's unique record ID.
Newton records are sync'ed to the Mac the same as before, but when it
comes to sync'ing changed AddressBook records, each record is compared
against the cache instead of against the Newton itself. If the record
is found in the cache, the Newton is queried for a record matching the
unique ID. (A much simpler and faster query.) If a record is not found
in either the cache or the Newton, it is added.

Try this out and let me know if it works better/worse/indifferent:

http://www.everchanging.com/newton/

If anybody's playing around with plug-in development, you'll want to
glance over the Developer page again; the SyncPlugin superclass now
contains a method to access your cache.

P.S. This means that sync's with multiple Newtons from one Mac user
account aren't supported for now. It shouldn't be terribly hard to add
later.

John Anderson
everchanging

-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
List FAQ/Etiquette/Terms: http://www.newtontalk.net/faq.html
Official Newton FAQ: http://www.chuma.org/newton/faq/



This archive was generated by hypermail 2.1.2 : Mon Dec 02 2002 - 22:01:55 EST