Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
[GCPUG India] Firebase - Build Extraordinary Apps
Search
Kazunori Sato
July 04, 2015
Programming
330
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
[GCPUG India] Firebase - Build Extraordinary Apps
Kazunori Sato
July 04, 2015
More Decks by Kazunori Sato
See All by Kazunori Sato
Tensor Processing Unit (TPU) Overview (July 6, 2018)
kazunori279
0
360
FPGAによる大規模データ処理の高速化
kazunori279
0
180
Googleがめざす、誰もが使える機械学習
kazunori279
4
5.1k
Machine Intelligence at Google Scale
kazunori279
3
1.5k
Machine Intelligence at Google Scale: Vision/Speech API, TensorFlow and Cloud Machine Learning
kazunori279
3
5.7k
Distributed TensorFlow
kazunori279
3
2.6k
What is Google BigQuery?
kazunori279
0
150
Cloud Vision API and TensorFlow
kazunori279
7
9.6k
Having fun with Google Cloud + RasPi
kazunori279
0
1.4k
Other Decks in Programming
See All in Programming
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
370
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
150
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
320
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
700
How I Stole PSI from Android Studio - DroidKaigi2026
worker8
0
120
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
220
cdk deploy JawsSonic #MARATHONしながらAWSリソースをデプロイしてみよう
akihisaikeda
2
120
AHC070解法紹介
eijirou
0
110
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
330
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
180
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
440
Deep dive into the select statement (GopherCon UK)
jespino
0
180
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
GraphQLとの向き合い方2022年版
quramy
50
15k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
690
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
650
Automating Front-end Workflow
addyosmani
1369
210k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
280
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Scaling GitHub
holman
464
140k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
The Curse of the Amulet
leimatthew05
2
14k
Transcript
Firebase: Build Extraordinary Apps
+Kazunori Sato @kazunori_279 Kaz Sato Developer Advocate, Cloud Platform, Google
Inc. Cloud community advocacy Cloud product launch support
Mobile App for Millions of People Authentication. Storing Data. Interactions.
“Make it work in the Cloud”
In the Cloud, you need… Front End. Business Logic. Database.
Multiple Servers, Load Balancers, Replicas, Backups...
For Clients, you need to support… Smart Phones. Tablets. Desktops.
Android, iOS and Browsers
Talking to a Backend Large Scale M-to-N Connections with Realtime
messaging … It’s not easy
= Expensive Engineering Time
Is there a better way?
Firebase is a powerful platform for mobile and web applications.
Firebase User Authentication Realtime Database Static Hosting
Firebase User Authentication Realtime Database Static Hosting
Firebase User Authentication Realtime Database Static Hosting
Location Collaboration Gaming Realtime is…
Location Collaboration Gaming Realtime is…
Location Collaboration Gaming Realtime is…
Unreliable networks Multi Platform Realtime is hard! Complex Transport Stateful
2-way connection How to implement it?
Unreliable networks Multi Platform Realtime is hard! Complex Transport 4G/WiFi
switching. Subways. Tunnels. Basements.
Unreliable networks Multi Platform Realtime is hard! Complex Transport Different
Capabilities, Behaviors and Languages
Firebase in the Real World
CBS 50,000 Concurrent Users 27,000,000 chat messages
$40,000 Kickstarter 100,000 Users
200,000+ Developers
How to Develop?
Demo: mmoasteroids
Firebase Dashboard Database. Security. Analytics. Debugging. Deployment.
Setup // Firebase connection Stuff var firebaseRef = new Firebase("https://mmoasteroids.firebaseio.com");
var firebaseRefGame = firebaseRef.child('game');
Start up the user’s ship // Add player's ship to
Firebase var myship = firebaseRefGame.child('players').push(); // Schedule player removal on disconnect at the backend myship.onDisconnect().remove();
// Write new ship location to Firebase on any update
myship.set({ ship: { acc: this.acc, vel: this.vel, x: this.x, y: this.y, rot: this.rot, accb: KEY_STATUS.up }, user: currentUser }); Write our ship to firebase on updates
// Sync new enemy ships from Firebase to local game
state firebaseRefGame.child('players').on('child_added', function (snapshot) { if (snapshot.key() !== myship.key()) { var enemy = new EnemyShip(); enemy.acc = snapshot.val().ship.acc; enemy.vel = snapshot.val().ship.vel; enemy.x = snapshot.val().ship.x; enemy.y = snapshot.val().ship.y; enemy.rot = snapshot.val().ship.rot; enemy.accb = snapshot.val().ship.accb; enemy.user = snapshot.val().user; enemy.visible = true; enemy.fref = firebaseRefGame.child('players').child(snapshot.key()); }}); We read enemy ships too...
firebaseRefGame.child('players').on('child_removed', function (snapshot) { if (snapshot.key() !== myship.key()) { var
enemy = Game.sprites[snapshot.key()]; enemy.visible = false; delete Game.sprites[snapshot.key()]; Game.explosionAt(snapshot.val().ship.x, snapshot.val().ship.y); } else { Game.ship.collision(null); } }) We handle enemy ship “removal”
bullet.fref = firebaseRefGame.child('bullets').push({ s: myship.key(), x: bullet.x, y: bullet.y, vel:
bullet.vel }); bullet.fref.onDisconnect().remove(); Bullets
// Sync enemy bullets from Firebase to local game state
firebaseRefGame.child('bullets').on('child_added', function (snapshot) { var bullet = snapshot.val(); if (bullet.s !== myship.key()) { var enemybullet = new EnemyBullet(); enemybullet.x = bullet.x; enemybullet.y = bullet.y; enemybullet.vel = bullet.vel; enemybullet.visible = true; enemybullet.fref = firebaseRefGame.child('bullets').child(snapshot.key()); Game.sprites['bullet:' + snapshot.key()] = enemybullet; }}); Enemy bullets
firebaseRefGame.child('bullets').on('child_removed', function (snapshot) { var bullet = snapshot.val(); if (bullet.s
!== myship.key()) { var enemybullet = Game.sprites['bullet:' + snapshot.key()]; if (enemybullet != null) { enemybullet.visible = false; } delete Game.sprites['bullet:' + snapshot.key()]; } }); Enemy bullet removal
Conclusions
Mobile Is Important!
Traditionally Complex!
None
None
https://firebase.com
Thank you! This work is licensed under a Creative Commons
Attribution 2.0 Generic License.