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
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
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
740
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
160
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
1.1k
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
220
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.3k
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
200
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
120
Inside Stream API
skrb
1
670
Modding RubyKaigi for Myself
yui_knk
0
910
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
560
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
480
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
Music & Morning Musume
bryan
47
7.2k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
430
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
140
Balancing Empowerment & Direction
lara
6
1.1k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
160
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
200
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!