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
Firebase Database Rules How To Deal With - Olek...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
GDG Ternopil
January 21, 2017
Programming
83
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Firebase Database Rules How To Deal With - Oleksandr Pidlisnyi
Firebase Database Rules How To Deal With - Oleksandr Pidlisnyi
GDG Ternopil
January 21, 2017
More Decks by GDG Ternopil
See All by GDG Ternopil
Semi supervised learning with Autoencoders by Ілля Горев
gdgternopil
2
94
Застосування ML в реальних проектах - Андрій Дерень
gdgternopil
2
130
Android Architecture Components by Ihor Dzikovskyy
gdgternopil
0
180
First look at Room Persistence by Oleksiy Sazhko
gdgternopil
0
130
Mobile Applications Architecture by Constantine Mars
gdgternopil
1
110
Tuning your SQLite with SQLDelight & SQLBrite - Mkhytar Mkhoian
gdgternopil
0
290
Speeding up development with AutoValue - Andrii Rakhimov
gdgternopil
1
110
The Mistery of Gradle Plugins - Dmytro Zaitsev
gdgternopil
1
95
Xamarin Build native Android & iOS apps with C# - Vitalii Smal
gdgternopil
1
130
Other Decks in Programming
See All in Programming
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
250
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
640
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
150
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
480
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
150
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
230
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
560
AutonomyとControlのあいだ:Graflowで記述するAIエージェント協調
myui
0
110
OSもどきOS
arkw
0
470
dRuby over BLE
makicamel
2
330
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
130
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Marketing to machines
jonoalderson
1
5.4k
New Earth Scene 8
popppiees
3
2.3k
The Invisible Side of Design
smashingmag
302
52k
Making Projects Easy
brettharned
120
6.7k
Building AI with AI
inesmontani
PRO
1
1.1k
4 Signs Your Business is Dying
shpigford
187
22k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
160
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
600
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Transcript
Firebase Database Rules How To Deal With Oleksandr Pidlisnyi Senior
Software Engineer @ Perfectial LLC GDG Lviv
Firebase Realtime Database
WHAT IF I TELL YOU IT IS NOT DATABASE
None
Database? SQL NoSQL JSON
Realtime
None
Offline
Accessible from Client Devices Android iOS Web SDK for Node.js,
C++, JAVA, Unity
Rules .read .write .validate .indexOn
now root newData data auth $ variables Predefined variables
provider uid token auth
.validate { "rules": { "foo": { ".validate": "newData.isString() && newData.val().length
< 100" } } }
.indexOn – orderByChild { "lambeosaurus": { "height": 2.1, "length": 12.5,
"weight": 5000 }, "stegosaurus": { "height": 4, "length": 9, "weight": 2500 } }
.indexOn – orderByChild { "rules": { "dinosaurs": { ".indexOn": ["height",
"length"] } } }
.indexOn – orderByValue { "scores": { "bruhathkayosaurus": 55, "lambeosaurus": 21,
"linhenykus": 80, "pterodactyl": 93, "stegosaurus": 5, "triceratops": 22 } }
.indexOn – orderByValue { "rules": { "scores": { ".indexOn": ".value"
} } }
.read && .write { "rules": { "foo": { ".read": true,
".write": false } } }
.read && .write { "rules": { "users": { "$uid": {
".write": "$uid === auth.uid" } } } }
Magic { "users": { "John Doe": { "rules": { "blog":
true } }, "John Snow": { "rules": { "blog": false } } }
Magic "blog": { "1": { "title": "Blog Post 1" },
"2": { "title": "Blog Post 2" } } }
Magic "blog": { ".read": true, ".write": "root.child('users').child(auth.uid).child('rules').child('blog').val() === true" }
Magic "$collection": { ".read": true, ".write": "root.child('users').child(auth.uid).child('rules').child($collection).val() === true" }
Magic { "users": { "John Doe": { "rules": { "blog":
{ "read": true, "write": false } } } } }
Magic "$collection": { ".read": "root.child('users').child(auth.uid).child('rules').child($collection).child ('read').val() === true", ".write": "root.child('users').child(auth.uid).child('rules').child($collection).child
('write').val() === true" }
+OleksandrPidlisnyi @opidlisnyi fb.me/opidlisnyi Questions? Thank you!