Realm Mobile Platform - Amazon Web Services€¦ · Swift 3 watchOS 3 Full offline functionality...

Post on 27-May-2020

6 views 0 download

Transcript of Realm Mobile Platform - Amazon Web Services€¦ · Swift 3 watchOS 3 Full offline functionality...

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 Database

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

● Data marshalling (serialization)● Data transport● Synchronization

How about both?

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

CloudKit

Seamless auth Apple runs the servers

Separate data model Apple devices only No sync features

JavaScript API Real-time update via

sockets / APNS

Custom Server

Full control Server side logic Platform-agnostic

Separate data model Data transport layer Maintain server No sync features

Real-time update via sockets / APNS

Firebase

NoSQL → no models Google runs the

servers Real-time updates via

SDK Multi-platform

Some offline persistence

Some server side logic

Realm Mobile Platform

Shared models Automatic sync Seamless auth

(CloudKit) Real-time updates via

SDK Multi-platform

Maintain server

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)○ Xamarin (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