Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement cross device data sync online and offline using google app engine? [closed]

I want to create an app which will sync data accross multiple device like Evernote app does. I have seen Firebase and Couchbase but because of pricing and hosting problems I dont want to use these two I want to create my own sync.

I want to create it as Client is Android, Google cloud endpoints for creating API's and Appengine backend. .

Online and offline sync

Example of note taking app(like Evernote)

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.

Scenario 2

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:

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.

There are much more complex scenarios like these, is there anyone who has alredy done such things and what all challenges you have faced?

What is the best solution? How to implement this?

In-short Need logic like firebase sync or Couchbase sync

like image 425
Shivaraj Patil Avatar asked Sep 01 '25 16:09

Shivaraj Patil


1 Answers

I know we shouldn't just give references as answers here, but your question is so broad that I don't see another way.

There is an Android synchronization feature, described in http://developer.android.com/training/sync-adapters/index.html

However, I don't see any relevant pricing and hosting problems with Couchbase. I have been developing a similar app myself, using the free community edition, and it works well. You will need some server database anyway, so of all the database products available, why not use the one that brings the synchronization feature at no price.

(I'm in no way related to the Couchbase manufacturer.)

like image 200
TAM Avatar answered Sep 04 '25 07:09

TAM