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
Search
Igor Flysta
August 19, 2015
Programming
1
91
Introduction to Firebase
Presentation of Firebase - realtime No-SQL database and hosting solution for mobile app.
Igor Flysta
August 19, 2015
Tweet
Share
Other Decks in Programming
See All in Programming
1年目の私に伝えたい!テストコードを怖がらなくなるためのヒント/Tips for not being afraid of test code
push_gawa
1
660
若手バックエンドエンジニアが Elasticsearch を使ってみた話
hott0mott0
1
100
ABEMA iOS 大規模プロジェクトにおける段階的な技術刷新 / ABEMA iOS Technology Upgrade
akkyie
1
250
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
260
15分で学ぶDuckDBの可愛い使い方 DuckDBの最近の更新
notrogue
3
850
PEPCは何を変えようとしていたのか
ken7253
3
310
TCAを用いたAmebaのリアーキテクチャ
dazy
0
230
kintone開発を効率化するためにチームで試した施策とその結果を大放出!
oguemon
0
350
推しメソッドsource_locationのしくみを探る - はじめてRubyのコードを読んでみた
nobu09
2
360
DevNexus - Create AI Infused Java Apps with LangChain4j
kdubois
0
140
CDK開発におけるコーディング規約の運用
yamanashi_ren01
2
260
「個人開発マネタイズ大全」が教えてくれたこと
bani24884
1
300
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7.1k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
How GitHub (no longer) Works
holman
314
140k
GraphQLの誤解/rethinking-graphql
sonatard
69
10k
For a Future-Friendly Web
brad_frost
176
9.6k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
Mobile First: as difficult as doing things right
swwweet
223
9.5k
The Invisible Side of Design
smashingmag
299
50k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
4 Signs Your Business is Dying
shpigford
183
22k
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!