This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: How Bf Synchronization works
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
When I decided to support synchronization in BottomFeeder, I decided to do something really simple. The gist of the process is to transfer a synchronize definition from system 1 to system 2. There are two ways to do that:
Export a file, and then import it into the other system
Have the system here request a synch from a remote system (via HTTP)
In either case, a synchronize document is transferred, decoded, and applied. The document is simple, and it's not XML. Why? Well, an XML document would end up being bloated. The data being transferred is very simple - it's a dictionary:
Key = Feed URL
Value = OrderedCollection (guids)
The guids are the guids of the items that have been read - there's no need to transfer information about the unread items (either they are new in both places, or you have already read it in the requesting place- either way, no need to send that information). So how to format that? A simple text format - looks like this:
So I decode that back into a dictionary, and grab all the local feeds. Then I match feed urls, and mark all local items with matching guids as read. That's it. It's simple, it's pretty fast, and it didn't require a lot of work. If a "standard" approach to this problem ever arises, I'll probably support it. For now, this works just fine between different instances of BottomFeeder