19

I need to sync my Android SQLite DB with my cloud-server DB, and doing it in a bi-directional way in a multiuser environment.

I have found and introduction to the solution here but I would like to read about a better solution/algorithm.

Isuru
  • 30,617
  • 60
  • 187
  • 303
Juanin
  • 602
  • 1
  • 8
  • 16

2 Answers2

6

Can you use Oracle Database as your server-side DB?

If so, you should consider Oracle Database Lite, which includes a full synchronization solution that is compatible with SQLite and Android, and was designed for multi-user environments.

It supports automatic synchronization, advanced conflict resolution, and multiple sync models. It also supports deploying and managing apps from a central management console, and even device management.

You can read more about it here: http://www.oracle.com/technetwork/database/database-lite/overview/index.html

Also, you can click on the download tab to try it out for yourself.

Eric

Eric Jensen
  • 453
  • 4
  • 14
  • Thanks Eric, but I'm using PostgreSQL over Ubuntu. Oracle is too expensive for this project. – Juanin Feb 02 '11 at 21:24
1

I'd recommend to send db file to your server and do merging on the server side. Then send merged db back to the client if needed. Your solution will vary based on conflict resolve algorithm and your database schema. But here is example for the simplest case:

sqlite> attach 'client.db3' as ClientDBtoMerge;           
sqlite> insert into TableName select * from ClientDBtoMerge.TableName;
sqlite> detach database ClientDBtoMerge; 

Hope you are be able to modify example for bi-directional merge.

cement
  • 2,905
  • 1
  • 23
  • 20
  • Could be a solution for backup in a monouser environment. But for multiuser cann't. Thanks anyway. – Juanin Oct 27 '10 at 09:39
  • 1
    Why not? You can have master database on a server and merge it on request-by-request basis or all together. Or you need real-time sync between databases? In the case you are talking about replication which is impossible because you need 100% online time of all your client phones. – cement Oct 27 '10 at 09:50