Synchronise Realm data between devices - ios

I have been searching around the internet, but without finding a solution.
Is it possible to synchronise the realm data between more devices? Lets take an example, if the user use the application on both iPhone and iPad.
How can i make the data synchronise? I have been looking into CloudKit, but it doesn't seems like it works together with Realm (Correct me if i'm wrong).
Any suggestions? I want the data to be synchronised, and i want a backup of the data - So the user can delete the app, and still get the data down.

Realm now offers two-way synchronization using their own Realm Object Server, as part of the Realm Mobile Platform: https://realm.io/products/realm-mobile-platform/

EDIT: The Realm Mobile Platform is available (in beta as I edit my answer) so this kind of sync is possible. My previous answer was in an older context, with this technology unavailable.
Previous answer: It's not possible. The binary format for the Realm database on the device is not synced on any service like iCloud or Google Drive efficiently.
The long answer can be found in my previous answer here.
So, I think the best way for doing so is through an API.

Another alternative -> You can try this swift framework to sync Realm database with CloudKit ice cream

I think the Document folder is synchronise through iCloud

Related

iCloud Core Data 2018

I have an iOS application written in Swift with Xcode 9 that stores objects locally with Core Data. I would now like to apply iCloud sync to this app such that a single user can access and modify this data across multiple devices, though I am not sure where to begin. I have searched much but it remains unclear to me if "iCloud CoreData" works anymore or if CloudKit is ideal.
What would be the best approach to this today? Could someone perhaps direct me to a modern example/documentation? Any help would be appreciated.

Xcode 8/Swift 3: make API information available offline? [duplicate]

This question already has an answer here:
How to make offline database for my app?
(1 answer)
Closed 6 years ago.
I'm currently working on an application in Xcode 8/Swift 3 which runs through APIs. Essentially, I'm parsing information using SwiftyJSON from my MySQL database which keeps the content current and easily updated.
To keep it so the content is also available offline, I'd like to introduce a facility where the data is downloaded and stored on the phone so it is available in "offline mode".
I know it's a completely open question but can anyone point me in the correct direction of how I could make this JSON information available offline? I've tried searching the net with no success.
I know it's not Swift, but the absolute master of this has recently open sauced his master piece: Dash for iOS.
Reviewing what he's done to get rapid scrolling and searches might give some deep insight into how to best do this as done by someone with (arguably) more experience in this area than anyone other than Apple:
https://github.com/Kapeli/Dash-iOS
I will prefer here 2 option either I will go with 1.SQLite DB or 2. NSURLCache
For SQLite DB you can use FMDB wrapper-https://github.com/ccgus/fmdb
For NSURLCache check this link Best way to Cache JSON from API in SWIFT?
If you just want to save json then go with NSURLCache for offline mode.
Achieving offline for iOS is having two best paths they are CoreData and SQLITE. As per the definition of CoreData suggests it is a Model layer of the project. It comes with less efforts on developer side. Bit contrast SQLITE having the same way but little efforts on it.
In my project we are using the CoreData for offline maintenance. Really we have few concerns on the Relational data fetching, Although there is a Predicates representing CoreData for the same still it is limited to some part. These type of situations SQLITE is really a life saver. We can easily fetch the records with simple JOIN commands.
Conclusion:
If you have more complex data relations it's really better to go with the SQLITE, Apart from CoreData is best choice.

Core Data iCloud sync or smth else?

I build an iOS app which works with base. User can work with it everywhere, that is cool. When application starts for the first time, obviously, base will be empty. For now, user's base stores data locally with Core Data. But there is a case, when user may have his own base with a lot of data and he do not want to start work from scratch. For this reason I want to create simple Cocoa App for macOS, which will allow user to import some data from, for example - CSV file.
Both Core Data models (iOS app and macOS app) will be the same. I just want to make sync between two platforms.
I think it's possible with cloudKit, but which way is the best? Core Data Sync or smth like supporting MySQL database on server, etc...
Thanks in advance!
Asking which method is "best" is a matter of opinion, but in mine, Apple has made working with iCloud fairly simple. If all you want to do is sync between platforms, I would use cloudKit. There seems to be no reason to spin up your own MYSQL database instance and introduce another level of complexity, when the functionality you're looking for is free and easily accessible.
See this WWDC16 video for some cloudKit tips: https://developer.apple.com/videos/play/wwdc2016/226/

Core data, iCloud, and Cloudkit

I am in the planning stage of a new project that will require to use Core Data. It has these requirements: 1. Be able to access same data across multiple devices. 2. Be able to access same data in offline or online 3. Guarantee data will not be lost.
Couple years ago, I embarked on similar project. But I had to abandon these features.
Does Core Data with iCloud syncing work well enough for current iOS 7 and 8 to warrant another attempt?
If not, I am thinking about using CloudKit and local Core Data storage. But then I will have to write extra code to update both.
Any suggestions?
You could use https://github.com/evermeer/EVCloudKitDao It's a CloudKit library with support for local caching (not Core Data, but files using NSCoding)

Alternatives to iCloud + Core Data to sync data between iOS and OS X

I'm developing an application for iOS/OS X and i want to sync data between them.
for now I use Core Data for persistent data.
I read that iCloud is not enough mature to use with core data.
Is that true ?
so i try to use the new DropBox sync API(to sync the SQLite file), but there's no support for OS X.
Is Parse SDK a good idea? (it will also allow me to add Android support)
If no, have you other solution?
Thank you.
i read that icloud is not enough mature to use with core data.
is that true ?
Yes, I've worked with it quite a bit but I cannot recommend it at present.
so i try to use the new dropBox sync API(to sync the sqlite file), but there's no support for mac.
is parse sdk a good idea (that will allow me to add android support)?
if no, have you other solution ?
Parse has a good reputation. There's an open source project called FTASync that integrates it with Core Data.
Some other options:
TICoreDataSync, which syncs via Dropbox but lets you use Core Data
WasabiSync, a third-party project that syncs Core Data via their own servers.
Simperium, another one like Wasabi, syncing Core Data via their own servers.
At present I don't have enough experience with any of these to endorse them. They're all designed to sync Core Data outside of iCloud but I can't say which works best.

Resources