Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A cloud solution to synchronize app database in Android

I'm developing a custom Contacts app that will store data on the device in a SQLite database. It's very important that this device database may be synchronized with a cloud database, for some reasons:

Users may have more than one device and wish to have their app data up-to-date on all devices; Users may be able to access these data from a web application; As this app will store many pictures, device memory will not be enough to hold all data and an archive option will be available to keep data only on the cloud database. Archive to the cloud will be done automatically for older records. A restore option will be available to download data for records when needed. As you can see, device database will hold contacts for one user and the cloud database will be a similar db but holding data for all users. So, there is a logic in this synchronization. It`s not just a matter o copying the entire SQLite DB file up and down. This must be a row/column level synchronization.

I'm wondering which kind of solution can i use to accomplish this? Is it possible to use Google Cloud or App Engine to implement the server-side? What can I do on the device side? Any ideas?

I really appreciate any answers.

Thanks.

like image 221
Ecil Avatar asked Feb 19 '13 02:02

Ecil


People also ask

How to synchronize data between local database and mobile app?

All UI components are rendered via the local database. Now even in case of subsequent sync failures, it will provide the same user experience to customers. The data synchronization in the mobile applications can be achieved using Sync Service and Sync Adapter.

What is the architecture of data synchronization in mobile applications?

The architecture of data synchronization in mobile applications can be described in the following figure. Sync Service is responsible for syncing data from a remote server to a mobile device and stores the data locally in the SQLite database. All UI components are rendered via the local database.

How to synchronize local database with cloud server?

Choose the local database which provides sync service to automatically store the local database to the cloud server and vice-versa. Couchbase and realm the popular databases which provide Data synchronization between local database and backend server.

What is a synchronized app?

There are other types of apps called Synchronized apps. These apps store all their data on the mobile device and thus can be used offline, but the stored data may be updated on the server when the device is periodically online.


1 Answers

You can use any 'cloud' based webservice you want, you have the full strength of Java and solid http libraries available to you on the phone. It is certainly possible to build an app/webservice on a platform like Amazon EC2 or App Engine and then call that directly from your app, handling the security, storage, and synchronization on your own.

Personally, in my experience, I use Django/Python on EC2 (along with a variety of AWS data services) and it works great.

Separately, I know that there are a variety of startups building out-of-the-box solutions for your scenario - i.e. special SDKs and backend services targeted just for mobile developers. I do not have any experience with these, but here are two of which I'm aware (no endorsement, just links): https://www.parse.com/ https://www.stackmob.com/

like image 199
Mike Repass Avatar answered Sep 28 '22 16:09

Mike Repass