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, Firestore Find mBaaS
Search
nnao45
April 17, 2019
Technology
1.2k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Firebase, Firestore Find mBaaS
nnao45
April 17, 2019
More Decks by nnao45
See All by nnao45
MPI Performance Evaluation of Raspberry Pi4 Cluster with Android OS
nnao45
2
210
datalake-party-for-aws-20201118
nnao45
0
290
はじめてのNetwork Service Mesh
nnao45
4
2.4k
EKS for EFS
nnao45
4
1.5k
まだ大きくない僕たちに必要なCLoud Nativeを求めて
nnao45
8
1.3k
what happens when k8s journy
nnao45
17
9.2k
Make App, Using with Study Group
nnao45
3
660
Chatops, AWS, And Ansible
nnao45
2
1.1k
Ansible container in the kubernetes
nnao45
5
1.7k
Other Decks in Technology
See All in Technology
Agent Skills設計で柔軟性と硬さのバランスが難しい話
nassy20
0
140
2026TECHFRESH畢業分享會 - Lightning Talk - E起 See See : 電商推薦讀心術? 數據說了算
line_developers_tw
PRO
0
1.3k
アジャイルな経理と Claude Code と経営の未来
kawaguti
PRO
3
160
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
2
680
エラーバジェットのアラートのタイミングを考える.pdf
kairim0
0
170
スタートアップにAmazon EKSは早すぎる? マルチプロダクト戦略を加速する Platform Engineeringの実践 / Is Amazon EKS Too Soon for Startups? Practical Platform Engineering to Accelerate a Multi-Product Strategy
elmodev09
0
380
[チョークトーク資料]AWS DevOps Agent を使いこなす / AWS Dev Ops Agent Chalk Talk AWS Summit Japan 2026
kinunori
3
580
2026 TECHFRESH 畢業分享會 - AI-Native 重塑軟體工程與虛擬講師
line_developers_tw
PRO
0
1.3k
新しいUbuntu/GNOMEが使いたいからXからWaylandへ移行頑張ってるの巻 2026-06-20
nobutomurata
0
150
Bucharest Tech Week 2026 - Reinventing testing practices in the AI era
edeandrea
PRO
1
170
Kiroで書いた 設計書 が AI レビューの 採点基準 になる
ezaki
0
130
マルチアカウント環境での コーディングエージェントを使った障害調査が大変なので AIエージェントにReadOnly権限を付与してみた / ReadOnly AI Agents for Multi-Account AWS Incident Response
yamaguchitk333
2
110
Featured
See All Featured
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
The Cult of Friendly URLs
andyhume
79
6.9k
Design in an AI World
tapps
1
250
30 Presentation Tips
portentint
PRO
1
330
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Done Done
chrislema
186
16k
Building Adaptive Systems
keathley
44
3.1k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
140
So, you think you're a good person
axbom
PRO
2
2.1k
Odyssey Design
rkendrick25
PRO
2
700
Transcript
Firebase Firestore Find obile m S a a B s
ackend ervice
C N D J P 2 @nnao45 CyberAgent Inc. Infra/ServerSide
Engineer ✔ Naoya Yokoyama Tech Advisor Startup Company ✔ Zsh,BGP,Go,Rust,MySQL,K8S,AWS,Ansible ✔ Vtuber,Game,Tennis ✔ サーバレスでエンジニアに愛を・・・! 冪等性を保つべきかどうかの指標が欲しい ぶいちゅーばー友達募集! ポケモン発売まで意識飛ばしたい勢 Rustのwebフレームワーク作成中... @nnao45,
[email protected]
✔ サンフランシスコのセブン最高
Agenda Firebase introduction Learn Firestore Arch mBaaS with CloudNative ✔
✔ ✔
Firebase?
Firebase is… NoSQL? Push Notification? Serverless?
Firebase is… NoSQL? Push Notification? Serverless? ✔ ✔ ✔
DEPLOY MOBILE APP IS HARD WAY Database? Mongo,MySQL,Postgres,Oracle...etc Auth? Basic,Digest,JWT,PubKey...etc
Async Logic? WebRTC,Quic,CustomProto…etc Hosting API? S3 Hosting,EC2,GAE…etc
DEPLOY MOBILE APP IS HARD WAY Database! Auth! Async Logic!
Hosting API! NoSQL Authentication SDK and WebRTC Hosting Front
is mobile backend as a service https://firebase.google.com/?hl=ja
CAN DEPLOY MOBILE APP USING ONLY FIREBASE WITH SERVERLESS ARCH
hoge.firebaseapp.com Hosting NoSQL Authentication Cloudfunction Storage Push Notification Front
CAN DEPLOY MOBILE APP USING ONLY FIREBASE WITH SERVERLESS ARCH
mBaaS Self-Hosted Server NO NEED
FOR EXAMPLE… MOBILE APP SEND MESSAGE Hosting api.hogame.link/api/v1/login Credential OK
Credential Auth Authentication Call Privider host with like app
FOR EXAMPLE… MOBILE APP SEND MESSAGE Hosting api.hogame.link/api/v1/message POST Message
OK Firestore Cloudfunction SAVE Message Format Message SAVE for Analy Object Storage Storage SAVE Image DWH Analytics Tools
FOR EXAMPLE… MOBILE APP SEND MESSAGE Hosting Firebase Apple Push
iOS Push Message Notification Service Push Message Cloud Messaging api.hogame.link If you want to send push...
FOR EXAMPLE… MOBILE APP SEND MESSAGE Hosting api.hogame.link/api/v1/message GET Message
Firestore GET Message Storage GET Image Realtime Via SDK on WebRTC
AND… Self-Hosted API Server I WANT TO USE API SEVER
WITH FIRESTORE
AND… Self-Hosted API Server I WANT TO USE API SEVER
WITH FIRESTORE
Can use serverside firestore sdk for some lang. https://cloud.google.com/firestore/docs/apis
Firebase is mBaaS, I know! And want to study Firestore
Firestore is… NoSQL, Base Document DB Awesome Realtime Communication ✔
✔
Firestore Introduction
Firestore Introduction https://firebase.google.com/docs/firestore/?hl=ja
Database Table Data Collection Document Data MySQL Firestore Firestore Introduction
GET Message Realtime Via SDK on WebRTC Having Feature P/Sub
Firestore Introduction
Demo https://codelabs.developers.google.com/codelabs/ firebase-web/index.html Firestore Introduction
Firestore is NoSQL
Firestore is NoSQL No Schema Support Transaction Support Query Like
SQL ORDER BY WHERE LIMIT
Firestore is NoSQL users/ user_1/ user_2/ user_3/ created: 1555302970 role:
admin status: active created: 1555302960 role: admin status: active created: 1555302931 role: admin status: deactive
Firestore is NoSQL users/ user_1/ user_2/ user_3/ role: admin status:
active role: admin status: active role: admin status: deactive follows: [2,3] follows: [4,10] follows: [42,3] docData .put(“follows”, Arrays.asList(2,3)); created: 1555302970 created: 1555302960 created: 1555302931 Insert into data
Firestore is NoSQL users/ user_1/ role: admin status: active follows:
[2,3] Message.put(“from”, “Jobana”); Messages created: 1555302970 messages/ message_1: from: Giorno msg: Golden Message.put(“msg”, “Experience”); .put(“message_2”, Message); message_2: from: Jobana msg: Experience Insert into subcol
Firestore is NoSQL users/ user_1/ user_2/ role: admin status: active
role: admin status: active follows: [2,3] follows: [4,10] docDataRef .where(“status”, “==”, “active”); created: 1555302970 created: 1555302960 Get match data
Firestore is NoSQL users/ user_1/ role: admin status: active follows:
[2,3] docDataRef .where(“crated”, “>”, “1555302965”); created: 1555302970 Get match data
Firestore is NoSQL users/ user_1/ user_2/ user_3/ role: admin status:
active role: admin status: active role: admin status: deactive follows: [2,3] follows: [4,10] follows: [42,3] docDataRef .where(“role”, “==”, “admin”) created: 1555302970 created: 1555302960 created: 1555302931 .orderBy(“created”, “asc”); Get match sort data
Firestore is NoSQL users/ user_1/ user_2/ role: admin status: active
role: admin status: active follows: [2,3] follows: [4,10] docDataRef .where(“role”, “==”, “admin”) created: 1555302970 created: 1555302960 .orderBy(“created”, “asc”) .startAt(user_2); Get match sort snap
Caution of Firestore
Caution of Firestore 1 WRITE IN 1 DOCMENT PER 1
second https://firebase.google.com/docs/firestore/quotas?hl=ja 500 WRITE IN 1 COLLECTION PER 1 second 1 DOCUMENT MAX SIZE IS 1 MiB
1 DATA UPDATE IN 1 DOCMENT PER 1 second like_counter/
counter: 222 CANNOT USING“COUNT” STATEMENT https://firebase.google.com/docs/firestore/solutions/counters?hl=ja Caution of Firestore
1 DATA UPDATE IN 1 DOCMENT PER 1 second like_counter_1/
counter: 22 → SOLVE: Distributed Sharding like_counter_2/ counter: 34 like_counter_3/ counter: 22 like_counter_4/ counter: 19 97 like_counter: https://firebase.google.com/docs/firestore/solutions/counters?hl=ja Caution of Firestore
Imple Realtime Update SDK for Go? https://firebase.google.com/docs/firestore/query-data/listen?hl=ja https://firebase.google.com/docs/firestore/query-data/listen?hl=ja Caution of
Firestore
https://firebase.google.com/docs/firestore/query-data/listen?hl=ja https://github.com/googleapis/google-cloud-go/releases/tag/v0.21.0 Caution of Firestore Imple Realtime Update SDK for
Go?
https://firebase.google.com/docs/firestore/query-data/listen?hl=ja https://soichisumi.net/2018/12/firestore-realtime-update-go-sdk/ snapIter := client.Collection("users") .Doc("docID") .Snapshots(ctx) defer snapIter.Stop() for{
data, err := snapIter.Next() if err != nil { log.Fatalln(err) } fmt.Println(data) } Caution of Firestore Imple Realtime Update SDK for Go?
BILLING PER Document Bill Read 0.1 Million Doc Write 0.1
Million Doc Delete 0.1 Million Doc $0.06 $0.18 $0.02 https://firebase.google.com/docs/firestore/pricing?hl=ja Caution of Firestore
Collection BILLING PER 1 Document Document Document Document READ 100
documents Caution of Firestore
Collection BILLING PER 1 Document Document Document Document READ 100
documents READ 100 documents Your Bill is Caution of Firestore
Collection BILLING PER 1 Document Document Document Document READ 100
documents SubCollection Document Document Document AND 55 subdocuments Caution of Firestore
Collection BILLING PER 1 Document Document Document Document READ 100
documents SubCollection Document Document Document AND 55 subdocuments READ 155 documents Your Bill is Caution of Firestore
And More... See Offical Document https://firebase.google.com/docs/ firestore/solutions/?hl=ja Google Cloud Next’19
Firestore Session https://youtu.be/ah5tQ7yOh2s Caution of Firestore
mBaaS with CloudNative
PUSH NORTIFICATION IS HARD WAY API Firebase Push Message Cloud
Messaging REQUEST REQUEST REQUEST
PUSH NORTIFICATION IS HARD WAY API Firebase Push Message Cloud
Messaging REQUEST REQUEST HTTP REQUEST IS SLOW RESPOMSE IS SLOW
PUSH NORTIFICATION IS HARD WAY API Firebase Push Message Cloud
Messaging REQUEST REQUEST I'am New User
PUSH NORTIFICATION IS HARD WAY API Firebase Push Message Cloud
Messaging REQUEST REQUEST I'am Influencer
API Firebase Cloud Messaging REQUEST REQUEST PUSH NORTIFICATION IS HARD
WAY ...PREDICTION IS HARD REQUEST Apple Push Notification Service
PUSH NORTIFICATION IS HARD WAY https://tech.mercari.com/entry/2016/11/08/170343
PUSH NORTIFICATION IS HARD WAY https://tech.mercari.com/entry/2016/11/08/170343
PUSH NORTIFICATION IS HARD WAY https://github.com/appleboy/gorush#run-gorush-in-kubernetes
PUSH NORTIFICATION IS HARD WAY https://github.com/appleboy/gorush#run-gorush-in-kubernetes
PUSH NORTIFICATION IS HARD WAY https://github.com/appleboy/gorush#run-gorush-in-kubernetes Pod Pod Pod
PUSH NORTIFICATION IS HARD WAY And My Use Case...
PUSH NORTIFICATION IS HARD WAY Database /a-service /b-service API a-queue-0/
Format Data b-queue-0/ Format Data a-queue-1/ Format Data
PUSH NORTIFICATION IS HARD WAY BATCH BATCH BATCH BATCH Push
Server x-queue-n: datas/ <struct> a-queue-0 a-queue-1 b-queue-0 b-queue-1 statefulset statefulset statefulset statefulset Database
PUSH NORTIFICATION IS HARD WAY IF ALL QUEUE TOO BUSY...
a-queue-0 a-queue-1 a-queue-2 a-queue-3 a-queue-4 DEPLOY DEPLOY DEPLOY statefulset statefulset statefulset statefulset statefulset API KICK JOB REQUEST Database
FIN. PixelMplus(ピクセル・エムプラス) ‥ 8bitビットマップふうフリーフォント http://itouhiro.hatenablog.com/entry/20130602/font 這いよれ!ニャル子さん AAセット1 | AsciiArt*AsciiArt http://aa.en.utf8art.com/node/4146