We have a software application with

1) Web-based component 2) Mobile-based component

Our 1) Web-based component uses

a) MongoDB as the Database


Our 2) Mobile-based component uses

a) Java

b) SQL Lite

However, both the databases have the same tables, but we have Not created any sort of bridge table between the collections in MongoDB and the tables in the SQL Lite.

The MongoDB Database and the SQL Lite will have the following collections/tables

-Daily Schedule ( corresponds to entire Day ) (MongoDB will have a unique ObjectId for daily schedule)

-Daily Schedule ( corresponds to entire Day ) ( SQLLite will use TEXT as ISO8601 strings ("YYYY-MM-DD HH:MM:SS.SSS") )

-Task ( many tasks to One Daily Schedule ) (MongoDB will have a unique ObjectId for every Task )

-Task ( many tasks to One Daily Schedule ) ( GUID type has affinity NONE, SQL Liste will store it store it as BLOB fields.)

In any sort of Mobile/Web combo application, how would they synchronize the data between the 2 databases? I'm looking for typical solutions that the software industry uses.

Some C# programmers on Stackoverflow[dot]com mentioned that it might be good idea to specify the ObjectId as a String or as a BLOB type.

It just gave me an thought, would it be a a good idea Mobile-based component which uses SQL Lite to have some bridge table that contains an ObjectId as String or a Blob type so that they can synchronize the data between the Mobile-based SQL Lite database, and the Web-based MongoDB Database?

Would the aforementioned approach have any disadvantages? If yes, please tell me the disadvantages.

  • Well, an ObjectId is a fixed length string for all practical purposes, except for the internal representation and its use in queries. Aside from that: Without knowing a lot more about your use cases and application domain, this is very hard to ask. – Markus W Mahlberg Apr 6 '16 at 11:25
  • @markus-w-mahlberg I've updated my question which also describes part of our Data Model. Could you please review? – CS Lewis Apr 6 '16 at 11:43
  • Tbh, I'd use an xml or json/bson serialization on the client side. On connect you can do upserts in the MongoDB. – Markus W Mahlberg Apr 6 '16 at 12:07
  • @markus-w-mahlberg When you say client-side, do you mean the mobile-based components? Also, if my mobile side is using SQLite (RDBMS) then how am I going to do Bson serilization? – CS Lewis Apr 6 '16 at 12:11
  • The idea was not to use SQL at all on the mobile. Flat files. – Markus W Mahlberg Apr 6 '16 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.