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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Samuel E. Giddins
March 03, 2015
Technology
58
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
What's in a Mobile Database?
Samuel E. Giddins
March 03, 2015
More Decks by Samuel E. Giddins
See All by Samuel E. Giddins
Funding Ruby Infrastructure as a Non-Profit
segiddins
0
46
Evolution of Rails within RubyGems.org
segiddins
0
46
The Challenges of Building a Sigstore Client from Scratch
segiddins
0
150
Keeping the Gems Sparkling
segiddins
0
99
A Survey of RubyGems CVEs
segiddins
0
93
Handling 225k requests per second to RubyGems.org
segiddins
0
120
State of the RubyGems 2023
segiddins
0
140
Building Broken Gems
segiddins
0
110
Switching Disciplines as a Tech Lead
segiddins
0
64
Other Decks in Technology
See All in Technology
10年間のブログ発信を振り返って見えたWebアプリケーションエンジニアとしての軌跡
stefafafan
0
190
秘密度ラベル初心者が第1歩でつまづかないための「設計・運用」ポイント
seafay
PRO
1
510
WebGIS AI Agentの紹介
_shimizu
0
590
攻撃者がいなくてもAIエージェントはインシデントを起こす
nomizone
0
140
サイバーエージェントにおけるAI推進戦略と変革への取り組み
shotatsuge
0
610
FPGAの開発コンペでZephyrを使ってみた
iotengineer22
0
220
自作お家AIエージェントスタックチャンFWで困っている所紹介
74th
0
130
AWS Summit 2026で見えたSIerにとっての Amazon Quickの位置づけ
maf_0521
0
110
IaC コードを資産へ:AWS CDK 社内ライブラリと横断展開 / aws-summit-japan-2026
gotok365
10
1.6k
初めてのDatabricks勉強会
taka_aki
2
190
Amazon Redshift zero-ETL 統合を活用した軽量なマルチプロダクトデータ可視化基盤 / Lightweight Multi-Product Data Visualization with Amazon Redshift Zero-ETL
kaminashi
0
110
2026 AI Memory Architecture
nagatsu
0
570
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
170
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
240
Discover your Explorer Soul
emna__ayadi
2
1.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
450
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
400
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
170
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
440
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
450
Scaling GitHub
holman
464
140k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
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