Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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.8k
Self Branding with GitHub
realm
0
4.4k
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
670
Other Decks in Programming
See All in Programming
WebAssembly in Android Apps 〜 WASMはJNIの夢を見るか
keiji
1
110
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
350
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
500
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
120
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4.8k
スマート反転とウェブアクセシビリティ
camiha
0
210
FreeBSDでZabbixを動かす
kenkino
0
310
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
730
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
290
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
290
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1k
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.3k
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Google's AI Overviews - The New Search
badams
0
1.6k
Statistics for Hackers
jakevdp
799
230k
A better future with KSS
kneath
240
18k
The Curious Case for Waylosing
cassininazir
1
510
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
700
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
910
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
500
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
280
Building the Perfect Custom Keyboard
takai
2
880
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1k
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?