Facts to build own sync

If you write this yourself these are some of the points to keep in mind

  • Proper authentication between the device and the Sync Server
  • A sync protocol between the device and the server. It will usually go in 3 phases, authentication, data exchange, status exchange (which operations worked and which failed)
  • Pick your payload format. I suggest SyncML based XML mixed with JSON based format to represent the actual data. So SyncML for the protocol, and JSON for the actual data being exchanged
  • Keeping track of data changes on both client and server. You can maintain a changelog of ids that change and pick them up during a sync session. Also, clear the changelog as the objects are successfully synchronized
  • Need to have a way to communicate from the server to the device to start a sync session as data changes on the server. You can use C2DM or write your own persistent tcp based communication. The tcp approach is a lot seamless
  • A way to replicate data changes across multiple devices
  • And last but not the least, a way to detect and handle conflicts
  • To make data exchange, web server needs to provide RESTful web services (json, xml, etc) then mobile can receive data.