
How FeedSync Synchronizes Data
The FeedSync algorithm specifies the synchronization of data between the two endpoints by using a publication and subscription model. Endpoint A publishes synchronization metadata to which endpoint B can subscribe and vice versa. This model has two features that are significantly different from popular feed-based interaction protocols, such as ATOM.
-
The communication defined between the two endpoints is a peer-to-peer communication. ATOM and RSS have interactions that are client-server based.
-
The FeedSync specification does not describe how endpoints discover each other. In the ATOM and RSS models, servers are easily discoverable and don't need to keep track of clients.
The Resource Model topic describes the synchronizable resources that support exchanging FeedSync metadata. However, to handle the issues raised by peer-to-peer communication, the Live Framework implementation of FeedSync is a client-server model. The process of synchronization is as follows:
-
The FeedSync client subscribes to the feed that the FeedSync server published.
-
If the FeedSync client makes a change, the client updates the feed with changes on its end by using the MERGE operation as specified by the FeedSync specification.
-
The FeedSync client posts the updated feed to the FeedSync server.
-
When the server receives the feed, it performs the MERGE operation to update the feed.
In other words, if an application needs to synchronize information between endpoint A and endpoint B, the peer-to-peer implementation is as follows:
-
Endpoint A performs an HTTP GET from endpoint B
-
Endpoint B performs an HTTP GET from endpoint A.
Instead, in the client-server implementation, the following occurs:
-
Endpoint A (the client) performs an HTTP GET from endpoint B (the server).
-
Endpoint A does an HTTP POST to endpoint B.
The client (endpoint A) has the responsibility to perform the operation in the correct order to synchronize its information with the server, as opposed to making both endpoints responsible for such action. At any given point in time, the server now contains the latest information.
Although there are advantages to a peer-to-peer model, the client-server model can easily be implemented as a hub-and-spoke model such that there is a single server with the master version of data with which multiple clients can synchronize data. With a peer-to-peer model, each endpoint needs information about all of the other endpoints and also needs to establish a trusted relationship with them in order to synchronize data.