I'm considering using CouchBase Lite instead of CoreData for my OS X and iOS apps. However, I need to be sure whether I can sync the data between OS X and iOS apps via iCloud in case Couch Base Lite is used.
CoreData syncing is possible via iCloud. I hope it could be done for CouchBase Lite.
I don't know how CouchBase Lite writes data out, but your options with iCloud are Core Data, flat files, or NSUbiquitousKeyValueStore. If CouchBase Lite uses flat files, it should work, as long as you explicitly set every one of its files to be synced by iCloud and you can resolve any conflicting changes that might come up in those files. File sync over iCloud will sync files and notify you of conflicts, but resolving them is up to you.
Whether that makes it easy or difficult depends on the details of CouchBase Lite's data storage.
If you are going to go with CouchBase, you should sync via a CouchBase server. Sync is a strength of CouchBase, and it would be silly not to take advantage of it.
Trying to use CouchBase via iCloud sounds like a bag-of-hurt. It wasn't designed for that purpose.
If you want to stick with iCloud, you can use Apple's Core Data sync, or a third party framework. TICDS and Ensembles are both based on Core Data, and can sync via iCloud. (Disclosure: I have contributed to both projects.)
Couchbase Lite was made for sync compatability with Couchbase Server; however, for folks who want to continue to utilize a relationship between iCloud and the device, and thereby need Core Data, we do have a Core Data adapter that you could use as migration or symbiosis with Couchbase Lite. Some sample work is available here: https://github.com/couchbaselabs/cblite-coredata-sample-ios
The adapter itself you can see here: https://github.com/couchbase/couchbase-lite-ios/tree/1.0-beta3/Source/API/Extras
Jessica
Related
I have following scenario
I have Sqlite file of 4GB of data to support offline.
Can I copy to the app and distribute the app, does it affect
application performance.
I need to read data from the same sqlite file, can I use the native
sqlite commands to read from 4GB of sqlite file or can I run a
server like GCDWebServer to read data from sqlite file. Which
approach gives better performance.
There are many ios applications that access a local Sqlite database. I personally prefer to use FMDB as a library to access Sqlite. Since Sqlite is a C library, you can call the library directly from Swift or Objective-C. You should be able to find many tutorials on building Sqlite applications.
i used iTunes sharing functionality for accessing database from outside the app resources, with GCDWebServer to support offline tile rendering functionality.
Is it possible to use mongoDB locally in an iOS app? Or do I have to convert the data to SQLlite?
MongoDB Realm is your solution!
check here
For local data storage on iOS device from your app you should consider CoreData as the recommended approach or go for SQLite. There is no mongodb for iOS.
Since you were looking at mongoDB, I would assume that you were looking at a NoSQL alternative and/or specifically a JSON based Document store for your local storage. In that case, as noted above, MongoDB does not have a local storage option for mobile apps.
You may want to look into Couchbase Mobile which includes Couchbase Lite which is NoSQL embedded storage for iOS, Android, Windows. Depending on your needs, you can use Couchbase Lite in standalone mode or you can sync your data to the cloud via Couchbase Sync gateway and persist data in the cloud using Couchbase Server.
Some other considerations to be factored into your choice of mobile database - platforms to be supported, type of data to be stored (structured, semi-structured, unstructured) - the importance of a schema/ data model, how frequently do you expect your data model to evolve - need for data migrations ,data sync capabilities among others
No, Mondodb is a DB storage system designed for backend enviroments. For iOS os recommended use CoreDate. But if you looking for storage NoSql, i recommend use Realm or CouchBase
Realm:
https://realm.io/
CouchBase:
https://developer.couchbase.com/documentation/mobile/current/installation/ios/index.html
This tecnologys can work with any API and you can storage values from any source.
I am working on an app that collects user data including photos. It's mandated that this app should work in offline mode - meaning that the user can complete surveys and take photos without an internet connection and that data should sync back to a remote database. How is this generally handled? Do I create a local database with Core Data and write an additional layer to manage saving/reading from a server? Are there any frameworks that help facilitate that syncing?
I have also been looking into backend services such as Firebase that include iOS SDKs that appear to handle a lot of the heavy lifting of offline support, but it does not appear to support offline syncing of image files through the Firebase Storage SDK.
Can anyone recommend the least painful way to handle this?
Couchbase Mobile / Couchbase Lite is probably the best solution I've come across so far.
It allows offline data storage including binary data, and online syncing with a CouchDB compatible server. It works best with their Couchbase Server / Sync Gateway combination, but if you don't need to use filtered replication or 'channels' (e.g. for syncing data specific to a single user with a shared database), you can use Cloudant which saves you having to set up your own server.
Its also available across most platforms.
Generally for images it is best to use NSFileManager and save your images in either the documents directory or the caches directory depending on the types of images you are storing. Core Data or Firebase are databases that are more qualified for data than images although they do support arbitrary data storage.
You can also try SDWebImage which has a lot of features around loading and storing images.
We are considering using Azure offline data sync for our app which usually has very sporadic connectivity (In most cases users sync their data once a day). Thing is that mobile app needs to hold a lot of data (tens of thousands of products). Currently we have our own sync solution which works fine with sqlite.
My question is, do you have any experience or thoughts about performance of Azure offline data sync? Will it be able to handle really large datasets?
Thanks you
Azure mobile service is the cloud version of popular Microsoft sync framework. This is a light weight json API which tracks changes between local and remote data store. It transfers only changed rows, hence data traffic will be minimum. But when you sync very first time and you have huge data, it might be a problem.
You could overcome this problem by carefully designing your database structure. Azure SDK provides api to sync table by table, which gives you enough flexibility to choose what to sync and not.
The backend database of the IOS application is NOSQL / Mongo DB. We have to store the data offline when the user is not connected to the internet & and sync later when he is online.
i gone through the couchbase ios tutorial .
What is the best way to store data locally & sync with server later.
Kindly provide the architectural inputs for the above.
I have experimented with multiple ways of doing this and CoreData is really unbeatable. All the backend is done by Apple with none of the 'hard stuff' done by you. It's quite easy to implement an SQL database app using the SQLite C API, however, cloud synchronisation is another story altogether. Core Data can be used with iCloud which of course stores the data and syncs only when the device is connected to the internet.