Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Alex Leffelman: Migrating to Realm on iOS
Search
Realm
April 07, 2016
Programming
7.8k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Alex Leffelman: Migrating to Realm on iOS
Realm
April 07, 2016
More Decks by Realm
See All by Realm
WWDC 2017 Review
realm
0
2.2k
Xcode shortcuts
realm
0
4.7k
Self Branding with GitHub
realm
0
4.3k
Realm Mobile Platform overview and demo
realm
0
2.1k
Realm advanced topics and demo
realm
0
2k
Realm introduction Seoul meetup 10
realm
0
2.2k
Stuart Hall: How I got 2.3 Million App Downloads
realm
0
2k
James Majors: What the Swiftly Func?
realm
1
4.3k
Simina Pasat: Continuous everything for iOS apps
realm
0
660
Other Decks in Programming
See All in Programming
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4k
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
110
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
240
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.5k
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
150
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.3k
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
110
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
540
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
340
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
750
The NotImplementedError Problem in Ruby
koic
1
710
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
2
1.5k
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.4k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
140
Side Projects
sachag
455
43k
RailsConf 2023
tenderlove
30
1.5k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
940
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
410
Ethics towards AI in product and experience design
skipperchong
2
310
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Transcript
Alex from Remind -
[email protected]
- @LeffelMania - remind.com/about
Try Before You Buy How to Test-Drive Realm Alongside Core
Data
Gearing Up for a Realm Migration
Why Choose?
Remind’s Starting Point - RestKit - AFNetworking 1.x - Complicated
RestKit mapping DSL - Mogenerator-generated model classes - Modular Remind stack on top of RestKit
Our Top Risk: Object Mapping into Realm - From-Scratch implementation
- Inconsistent JSON data - Type coercion
Server-Side Kill-Switch + Monitoring
Parallel Databases - Server is the only source of truth
- Hook into RestKit’s exit point - Map raw JSON into Realm database
Parallel Data Models: anti-DRY - User == RealmUser, Group ==
RealmGroup, etc - Determine migration lifetime early on
Integrating Initial UI Updates - Low-traffic, stable screens - Representative
of general patterns - How to accommodate both model types? - Replication vs. Conditional Logic
Interoperability @interface RLMObject (CoreDataMatching) + (NSString *)coreDataEntityName; - (NSPredicate *)coreDataMatchingPredicate;
- (id)coreDataEntity:(NSManagedObjectContext *)context; @end @interface NSManagedObject (RealmMatching) + (NSString *)realmEntityName; - (NSPredicate *)realmMatchingPredicate; - (id)realmEntity:(RLMRealm *)realm; @end
@implementation RLMObject (CoreDataMatching) - (NSPredicate *)coreDataMatchingPredicate { NSString *primaryKey =
[[self class] primaryKey]; id primaryValue = [self valueForKeyPath:primaryKey]; return [NSPredicate predicateWithFormat:@"%K == %@", primaryKey, primaryValue]; }
@implementation NSManagedObject (RealmMatching) - (__kindof RLMObject)realmEntity:(RLMRealm *)realm { NSString *entityName
= [[self class] realmEntityName]; Class entityClass = NSClassFromString(entityName); NSPredicate *predicate = [self realmMatchingPredicate]; RLMResults *results = [entityClass objectsInRealm:realm withPredicate:predicate]; return [results firstObject]; }
That’s It - Everything you need to migrate gradually.
Finishing the Job - What To Do/Not Do - With
high confidence, dive in - Have a plan - Don’t underestimate
None
Non-Obvious, Non-Trivial Migration Tasks - Network replacement? - Supplementing Realm
features - Unit Tests - Continuous integration - Code Review
Cutting Out Core Data - Press forward with Realm entities?
- Abandon Realm entities and migrate Core Data?
The Wrong Process, AKA, “The Hal” - Update one class’s
@interface to use Realm only. - Recurse every broken reference to that class - Follow the compiler until the build is green again
None
None
A Better Process(?) - 2 Steps Back = 100 Steps
Forward - Remove your Realm entities - Convert your Core Data entities directly
#winning
Recap: - You can roll out a Realm migration slowly
- Be safe out there - Don’t be an idiot like me - It’ll still take longer than you think
That’s it! Thanks, Realm! -
[email protected]
- @LeffelMania - remind.com/careers
- Questions?