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
Samuel E. Giddins
March 03, 2015
Technology
0
56
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
Evolution of Rails within RubyGems.org
segiddins
0
0
The Challenges of Building a Sigstore Client from Scratch
segiddins
0
59
Keeping the Gems Sparkling
segiddins
0
42
A Survey of RubyGems CVEs
segiddins
0
42
Handling 225k requests per second to RubyGems.org
segiddins
0
71
State of the RubyGems 2023
segiddins
0
100
Building Broken Gems
segiddins
0
74
Switching Disciplines as a Tech Lead
segiddins
0
41
Source Code to Executable
segiddins
0
81
Other Decks in Technology
See All in Technology
スタートアップに選択肢を 〜生成AIを活用したセカンダリー事業への挑戦〜
nstock
0
170
AWS認定を取る中で感じたこと
siromi
1
190
How Do I Contact HP Printer Support? [Full 2025 Guide for U.S. Businesses]
harrry1211
0
120
Backlog ユーザー棚卸しRTA、多分これが一番早いと思います
__allllllllez__
1
150
United airlines®️ USA Contact Numbers: Complete 2025 Support Guide
unitedflyhelp
0
310
united airlines ™®️ USA Contact Numbers: Complete 2025 Support Guide
flyunitedhelp
1
300
マネジメントって難しい、けどおもしろい / Management is tough, but fun! #em_findy
ar_tama
7
1.1k
MobileActOsaka_250704.pdf
akaitadaaki
0
120
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
0
110
KubeCon + CloudNativeCon Japan 2025 Recap by CA
ponkio_o
PRO
0
300
「良さそう」と「とても良い」の間には 「良さそうだがホンマか」がたくさんある / 2025.07.01 LLM品質Night
smiyawaki0820
1
550
United Airlines Customer Service– Call 1-833-341-3142 Now!
airhelp
0
170
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
524
40k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Building Applications with DynamoDB
mza
95
6.5k
Designing Experiences People Love
moore
142
24k
Designing for humans not robots
tammielis
253
25k
Why Our Code Smells
bkeepers
PRO
336
57k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Become a Pro
speakerdeck
PRO
29
5.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Practical Orchestrator
shlominoach
189
11k
The Pragmatic Product Professional
lauravandoore
35
6.7k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
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