<<

Realm Mobile Platform

Ehsan Rezaie

@ewerx

https://ewerx.ca Local Persistence

● Store user data ● Cache generated/fetched data ● Solutions ○ Documents ○ SQLite ○ CoreData ○ Couchbase ○ Realm Mobile Cloud Storage

● Synchronization (1 user, multiple devices) ● Collaboration/sharing (multiple users) ● Remote data sources (content delivery) ● Multiple apps/platforms ● Solutions ○ Custom backend (database + API) ○ iCloud + CoreData (deprecated) ○ CloudKit ○ Parse ○ Firebase ○ Couchbase Server ○ Realm Mobile Platform How about both?

● Data marshalling (serialization) ● Data transport ● Synchronization Hindsight v1.x

● Priorities ○ Full offline functionality ○ Cloud sync between devices ○ No accounts/login ● Implementation ○ CoreData ○ iCloud + Ensembles ● Forced Obsolescence ○ watchOS 2+ ○ iCloud deprecation ○ Objective-C Hindsight v2.0

● Swift 3 ● watchOS 3 ● Full offline functionality ● Automatic cloud sync ● No explicit login ● Seamless migration for existing users Comparison

Custom Server CloudKit Firebase Realm Mobile Platform

Full control Seamless auth NoSQL → no models Shared models Server side logic Apple runs the servers Google runs the Automatic sync Platform-agnostic servers Seamless auth Separate data model Real-time updates via (CloudKit) Separate data model Apple devices only SDK Real-time updates via Data transport layer No sync features Multi-platform SDK Maintain server Multi-platform No sync features JavaScript API Some offline Real-time update via persistence Maintain server Real-time update via sockets / APNS Some server side logic sockets / APNS New & untested Server logic in Professional Edition ($) Realm Mobile Platform The Package

● Realm Mobile Database ○ iOS/watchOS (Swift or Objective-C) ○ Android (Java) ○ ReactNative (JavaScript) ○ (C#) ● Realm Object Server ○ macOS ○ Linux ● Realm Browser ○ macOS Realm Mobile Database Models Queries Writes Notifications Threads

● One instance - one thread Initialization

● Nothing to do unless changing default settings or applying migrations Realm Object Server Installation Authentication (iCloud) Local/Cloud Database Sync Hindsight v2.0

● Remove CoreData / iCloud / Ensembles ● Rewrite models, queries, writes w/ Realm ● Add CoreData migrator ● Add authentication logic ● Add sync toggle logic ● Setup production server Resources

● https://realm.io/docs/get-started/ ● https://github.com/realm/RealmTasks ● https://github.com/realm-demos ● http://stackoverflow.com/questions/tagged/realm ● https://github.com/RxSwiftCommunity/RxRealm Questions?