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
Introduction to Firebase by Igor Flysta
Search
GDG Ternopil
August 19, 2015
Programming
0
35
Introduction to Firebase by Igor Flysta
Introduction to Firebase by Igor Flysta
GDG Ternopil
August 19, 2015
Tweet
Share
More Decks by GDG Ternopil
See All by GDG Ternopil
Semi supervised learning with Autoencoders by Ілля Горев
gdgternopil
1
73
Застосування ML в реальних проектах - Андрій Дерень
gdgternopil
1
100
Android Architecture Components by Ihor Dzikovskyy
gdgternopil
1
150
First look at Room Persistence by Oleksiy Sazhko
gdgternopil
1
95
Mobile Applications Architecture by Constantine Mars
gdgternopil
2
69
Tuning your SQLite with SQLDelight & SQLBrite - Mkhytar Mkhoian
gdgternopil
0
250
Speeding up development with AutoValue - Andrii Rakhimov
gdgternopil
0
73
The Mistery of Gradle Plugins - Dmytro Zaitsev
gdgternopil
0
58
Xamarin Build native Android & iOS apps with C# - Vitalii Smal
gdgternopil
0
82
Other Decks in Programming
See All in Programming
距離関数を極める! / SESSIONS 2024
gam0022
0
300
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.4k
Jakarta EE meets AI
ivargrimstad
0
800
DevTools extensions で 独自の DevTool を開発する | FlutterKaigi 2024
kokiyoshida
0
130
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
260
カンファレンスの「アレ」Webでなんとかしませんか? / Conference “thing” Why don't you do something about it on the Web?
dero1to
1
120
rails new flags - `rails new` のフラグから Rails を構成するコンポーネントの変遷をザックリ眺める
snaka
0
1.8k
Quine, Polyglot, 良いコード
qnighy
4
650
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
Vapor Revolution
kazupon
2
420
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Practical Orchestrator
shlominoach
186
10k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Designing for humans not robots
tammielis
250
25k
Visualization
eitanlees
145
15k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Navigating Team Friction
lara
183
14k
Become a Pro
speakerdeck
PRO
25
5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Transcript
Introduction to
Realtime Backend for your App
None
The Full Stack Creating an app requires managing complex infrastructure.
But the full stack is never that simple
… and neither is the client side Clients: • Web
• iOS • Android
… the truth is The users don’t care about your
backend
The User Expects • Speed • Offline • Multi-platform •
Simple Autentification
Firebase Backend
And forget the server Firebase apps can run on client-side
code only
REALTIME DATABASE • NoSQL JSON data-store • Cross-platform client-side SDKs
• Offline out-of-the-box • Auto-scaling • RESTful API
None
REALTIME DATA Whenever data is updated in Firebase, it sends
the update down to every listening client
None
Cross-platform
Storing Data Firebase ref = new Firebase(“https://<your-firebase-app>.firebaseio.com/message”); ref.setValue(“All the things”);
Storing Data { “location”: { “city”: “Ternopil”, “country”: “Ukraine” }
}
Sync Data Firebase ref = new Firebase (“https://<your-firebase-app>.firebaseio.com/message”); ref.addValueEventListener(new ValueEventListener()
{ @Override public void onDataChange(DataSnapshop snapshot) { System.out.println(snapshot.getValue()); } @Override public void onCancelled(FirebaseError error) { } });
{ "messages": { "message1": { "text": "Hello, world", "country": "USA"
}, "message2": { "text": "Bonjour monde", "country": "France" }, "message3": { "text": "Hello, world", "country": "England" }, "message4": { "text": "你好世界", "country": "China" }, "message5": { "text": "γειά σου κόσμος", "country": "Greece" }, ... } }
Offline
Intermittent Offline What happens when you go through a tunnel?
Firebase clients store a local cache of your data. When the user goes offline, the app still works as expected with the local cache.
Extended Offline What happens when you go on a flight?
On mobile, Firebase persists data to a local store. The app will continue to work even across app restarts.
One Line Of Code Firebase.getDefaultConfig().setPersistenceEnabled(true);
Autentification • Email & Password • Google • Twitter •
Facebook • Github • Anonymous • Custom
Autentification ref.authWithOAuthToken("google", "<OAuth Token>", new Firebase. AuthResultHandler() { @Override public
void onAuthenticated(AuthData authData) { // the Google user is now authenticated with your Firebase app } @Override public void onAuthenticationError(FirebaseError firebaseError) { // there was an error } });
Security • Declarative rules language • JavaScript-like syntax • Executed
server-side • Authorization • Schema validation
Security By default everyone can write and read { "rules":
{ ".read": true, ".write": true, } }
Security Everyone can read, but no one can write {
"rules": { ".read": true, ".write": false, } }
Security Secure specific parts of your Firebase { "rules": {
".read": true, "message": { ".write": false } } }
Security Special variables to power autentification { "rules": { ".read":
true, "message": { ".write": "auth !== null", ".validate": "newData.isString() && newData.val().length < 100" } } }
User-based Security Use $wildcards as route parameters { "rules": {
".read": false, ".write": false, "users": { "$userid": { ".read": "true", ".write": "auth.uid === $userid" } } } }
Hosting • Free static asset hosting • SSL certificate •
Global CDN • Single command deploys • One-click rollbacks • Custom domains
Hosting Demo
And More ... • Angular, React, Ember, Backbone bindings •
GeoFire (realtime geolocation) • Firepad (realtime text editing) • Open Data Sets • More coming soon...
Let’s Code
Thank You!