title: How to implement cross device data sync online and offline using google app engine?
body: <p>I want to create an app which will sync data accross multiple device like <strong>Evernote</strong> app does. 
  I have seen <strong>Firebase</strong> and <strong>Couchbase</strong> but because of pricing and hosting problems I dont want to use these two I want to create my own sync.</p>
  
  <p>I want to create it as <strong>Client is Android</strong>, <strong>Google cloud endpoints for creating API's</strong> and <strong>Appengine backend</strong>. .</p>
  
  <p>Online and offline sync</p>
  
  <p><strong>Example of note taking app</strong>(like Evernote)</p>
  
  <p>A simple scenario is assume that user has logged in into multiple devices and created a note in one device it should be synced with all other devices, Device X is offline and it is also created one document but its offline, when Device X come online it has to get the latest state of server and add notes created by it and that should be synced with multiple devices.</p>
  
  <p><strong>Scenario 2</strong></p>
  
  <p>I imagine a scenario where synchronizing the data will become a problem. Assume the application should work when it is not connected to the Internet, and thus cannot communicate with this central server. So:</p>
  
  <p>User A is offline and edits record #100
  User B is offline and edits record #100
  User C is offline and deletes record #100
  User C goes online (presumably, record #100 should get deleted on the server)
  User A and B goes online, but the records they edited no longer exist
  All sorts of scenarios similar to the above can come up.</p>
  
  <p>There are much more complex scenarios like these, is there anyone who has alredy done such things and what all challenges you have faced?</p>
  
  <p>What is the best solution? How to implement this?</p>
  
  <p><strong>In-short</strong>  Need logic like firebase sync or Couchbase sync</p>