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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
GDG Ternopil
January 21, 2017
Programming
0
76
Firebase Database Rules How To Deal With - Oleksandr Pidlisnyi
Firebase Database Rules How To Deal With - Oleksandr Pidlisnyi
GDG Ternopil
January 21, 2017
Tweet
Share
More Decks by GDG Ternopil
See All by GDG Ternopil
Semi supervised learning with Autoencoders by Ілля Горев
gdgternopil
2
89
Застосування ML в реальних проектах - Андрій Дерень
gdgternopil
2
120
Android Architecture Components by Ihor Dzikovskyy
gdgternopil
0
170
First look at Room Persistence by Oleksiy Sazhko
gdgternopil
0
120
Mobile Applications Architecture by Constantine Mars
gdgternopil
1
100
Tuning your SQLite with SQLDelight & SQLBrite - Mkhytar Mkhoian
gdgternopil
0
290
Speeding up development with AutoValue - Andrii Rakhimov
gdgternopil
1
100
The Mistery of Gradle Plugins - Dmytro Zaitsev
gdgternopil
1
88
Xamarin Build native Android & iOS apps with C# - Vitalii Smal
gdgternopil
1
120
Other Decks in Programming
See All in Programming
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
340
CSC307 Lecture 14
javiergs
PRO
0
480
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
120
AI 開発合宿を通して得た学び
niftycorp
PRO
0
140
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
150
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
160
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
260
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
690
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
470
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
190
OTP を自動で入力する裏技
megabitsenmzq
0
120
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
120
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
480
YesSQL, Process and Tooling at Scale
rocio
174
15k
Bash Introduction
62gerente
615
210k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
140
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The SEO identity crisis: Don't let AI make you average
varn
0
420
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
240
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
180
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
440
Site-Speed That Sticks
csswizardry
13
1.1k
Un-Boring Meetings
codingconduct
0
230
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!