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
What's in a Mobile Database?
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Samuel E. Giddins
March 03, 2015
Technology
0
58
What's in a Mobile Database?
Samuel E. Giddins
March 03, 2015
Tweet
Share
More Decks by Samuel E. Giddins
See All by Samuel E. Giddins
Funding Ruby Infrastructure as a Non-Profit
segiddins
0
21
Evolution of Rails within RubyGems.org
segiddins
0
32
The Challenges of Building a Sigstore Client from Scratch
segiddins
0
100
Keeping the Gems Sparkling
segiddins
0
75
A Survey of RubyGems CVEs
segiddins
0
66
Handling 225k requests per second to RubyGems.org
segiddins
0
100
State of the RubyGems 2023
segiddins
0
120
Building Broken Gems
segiddins
0
95
Switching Disciplines as a Tech Lead
segiddins
0
48
Other Decks in Technology
See All in Technology
[CV勉強会@関東 World Model 読み会] Orbis: Overcoming Challenges of Long-Horizon Prediction in Driving World Models (Mousakhan+, NeurIPS 2025)
abemii
0
140
配列に見る bash と zsh の違い
kazzpapa3
3
160
Webhook best practices for rock solid and resilient deployments
glaforge
1
290
Agent Skils
dip_tech
PRO
0
100
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
20260204_Midosuji_Tech
takuyay0ne
1
160
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
660
Frontier Agents (Kiro autonomous agent / AWS Security Agent / AWS DevOps Agent) の紹介
msysh
3
180
Amazon S3 Vectorsを使って資格勉強用AIエージェントを構築してみた
usanchuu
3
450
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
160
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.5k
Bill One 開発エンジニア 紹介資料
sansan33
PRO
5
17k
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
450
Thoughts on Productivity
jonyablonski
74
5k
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
100
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
Speed Design
sergeychernyshev
33
1.5k
30 Presentation Tips
portentint
PRO
1
220
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
110
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Building the Perfect Custom Keyboard
takai
2
690
Automating Front-end Workflow
addyosmani
1371
200k
Transcript
WHAT’S IN A MOBILE DATABASE?
SAMUEL GIDDINS REALM.IO
Show of hands: WHO’S USED A DATABASE?
LET’S NAME SOME
MOST OF THOSE ARE SERVER DATABASES
None
SQLITE THE STATUS QUO
▸ Single-threaded ▸ Dynamically-typed ▸ Weakly-typed ▸ Designed in 2000
WHAT ARE OUR CONSTRAINTS?
▸ Running on a device ▸ Can’t update database code
on a whim ▸ Little RAM ▸ Relatively few CPU cores ▸ Multiple processes ▸ Long-running use of data
WHAT DO WE WANT TO OPTIMIZE FOR?
▸ Querying ▸ Reading values ▸ Maintainable API ▸ Safe
Migrations ▸ Static + Dynamic Schemas
THE GOALS
▸ Cross-platform ▸ Memory-mapped ▸ Thread-safe ▸ Object-oriented ▸ Blazing
fast ▸ Sane interface
CROSS PLATFORM
People build services that need to run on multiple platforms.
Their database should reflect this.
MEMORY MAPPING
void *mmap( void *addr, size_t length, int prot, int flags,
int fd, off_t offset ); This function is magical.
Blur the line between in-memory and on-disk to get the
best of both worlds. Take advantage of optimizations in the kernel and let it do the hard work for you.
THREAD SAFETY
THREAD SAFETY PERHAPS THE MOST LOADED WORD IN CS
WELL-DEFINED THREADING MODEL ▸ What can be passed between threads?
▸ How easily can I isolate things that can’t be?
Built with speed & safety in mind: ▸ No reader
lock ▸ Allow concurrent reading & writing ▸ Let the user know when they violate the threading contract
OBJECT-ORIENTED API
▸ First-class model objects ▸ Support for persisted + in
memory objects ▸ No invisible web of classes
BLAZING FAST
WHY SHOULD OBJECTS AND THE DATABASE EVER GROW APART?
WHY SHOULD OBJECTS AND THE DATABASE EVER GROW APART? OR
WHERE ORMS WENT WRONG
▸ Lazily create objects in memory ▸ Access & set
values directly in the DB ▸ Optimized query engine
SANE API
▸ What do I need a reference to? ▸ Platform
coherence ▸ Isolate DB interaction ▸ Make it impossible to mess up
LET’S RECAP
▸ Cross-platform ▸ Memory-mapped ▸ Thread-safe ▸ Object-oriented ▸ Blazing
fast ▸ Sane interface
SOUNDS A LOT LIKE THE DREAM, RIGHT?
Make persistence just another aspect of your data, instead of
a whole convoluted system.
⾠ This might not be the approach for everyone. Take
a look at the goals, and see if they align with your own.
My company, Realm, is working towards building a database that
hits these bullet points. I’m not here to sell you on Realm. But building something that mirrors those goals is why we exist.
EXAMPLES?
Available now on Speaker Deck. https://speakerdeck.com/segiddins/whats-in-a-mobile-database
db.objects(Question).map { $0.ask }
SAMUEL GIDDINS REALM.IO @SEGIDDINS