Best way of modeling the synchronization

Hi All,

I am building an iOS app. How would you architect the app and synch for the following Grocery app sample:

  • Suppose there are 100 Groceries.
  • Suppose each grocery has 100 products. That makes 10,000 products at most.Each document size is 0,2 K and that makes = 2 MB JSON data size.

I want to provide an app which can search these products fast so do not depend on the network for that. Would you provide your comments please on my assumptions below?

  • When the app loads first, pull synch all 10,000 products in the background while the user look around. That supposed to take around 5 seconds. To do this, I will use basic authentication over SSL connection the Couchbase Server DB.
  • When the user searches the products, the search will take place from the local Couchbase Lite DB. The images of the products will be fetched online when displaying the product to user.
  • I will ask user to sign up to recognize him using email address, etc… and create a userID for him on the local CouchLite DB and push synch it to Server Couchbase DB.
  • User will save his preferences to local CouchLite DB using the userID and push synch it to Server Couchbase DB.
  • User will make a search based on the preferences directly using the local CouchLite DB for the general documents about grocery and their products using his own personal preferences.

Thx,
CK

Hello @ckayay,

Believe it is best to reference first the [Data Modeling guide][1] over at the Couchbase Mobile Developer portal and then architect what is local on the client side and how the data will flow accordingly.
[1]: http://developer.couchbase.com/mobile/develop/guides/modeling/index.html