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
Modeling DB @ Cloud Firestore
Search
Yatima-Kagurazaka
December 16, 2017
Technology
790
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Modeling DB @ Cloud Firestore
push ID: auto ID in Realtime Database
Yatima-Kagurazaka
December 16, 2017
More Decks by Yatima-Kagurazaka
See All by Yatima-Kagurazaka
ChromeOS, Firebase - Google I\O ‘18
yatima
0
540
スマートなcronを考案した / lazy cron
yatima
1
5.8k
Firebaseざっくり / GDG Tokyo New Year Seminar 2018
yatima
0
940
Firestoreで負荷試験 (Loadroid by Rocro) / Firebase.yebisu #1
yatima
1
810
大半のウェブサービス/アプリは,Firebaseなら簡単で安いですよ
yatima
2
3.4k
Realtime Databaseのベストプラクティスっぽいやつ
yatima
0
710
Other Decks in Technology
See All in Technology
作って終わりにしない タイミーのセマンティックレイヤー育成の現在地
chanyou0311
3
2.1k
社内 AI エージェント Synapse と セマンティックレイヤーの育て方
hiroakis
2
1.6k
やさしいA2A入門
minorun365
PRO
10
1.6k
実装は速くなった、レビューはどうする? ― 自身のレビューをAIで再現させるサーヴァントエンジニアリングのすゝめ / Implementation got faster. So what about reviews? — An invitation to Servant Engineering: Recreating your own code reviews with AI
nrslib
8
4.5k
2026.06.13_AI時代に事業会社が「SIer出身エンジニア」を求める理由 / Why Businesses Seek Engineers with a System Integrator Background in the AI Era
jumtech
0
1k
AI Engineering Summit Tokyo 2026 AIの前に、やることがある 〜医療データ企業の4フェーズ〜
dtaniwaki
0
2.5k
[モダンアプリ勉強会]今更聞けないGit/GitHub入門
tsukuboshi
0
360
protovalidate-es を導入してみた
bengo4com
0
160
新規事業を牽引する技術選定 〜フルスタックTypeScript開発の実践事例〜
nullnull
3
380
2026TECHFRESH畢業分享會 - 葬送的通靈師:化系統與用戶雜訊成行動訊號
line_developers_tw
PRO
0
650
MIERUNE JCT 発表資料「宇宙から伊能忠敬ごっこ」
syuchimu
0
200
Databricks における 生成AIガバナンスの実践
taka_aki
1
380
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
730
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
610
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
190
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
850
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
160
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
How to build a perfect <img>
jonoalderson
1
5.6k
Exploring anti-patterns in Rails
aemeredith
3
400
A designer walks into a library…
pauljervisheath
211
24k
Transcript
Modeling DB @ Cloud Firestore Yatima Kagurazaka ://yati.ma
yati.ma/qi Yatima Kagurazaka Minkore CTO MENSAn Physician I like tech,
design, music, etc My PC: Pixelbook(+ VSCode on Kali Linux)
yati.ma/qi Agenda • What is Cloud Firestore • Structure •
Yatima Model
What is Cloud Firestore
So easy but Equal to prod. use and Inexpensive
yati.ma/qi So easy Realtime Offline mode Direct connect to clients
(like Realtime Database)
yati.ma/qi Equal to prod. use Almost no downtime Super scalability
Multi region Strong Consistency Some query support
yati.ma/qi Almost no downtime
“ yati.ma/qi Super scalability you'll get the same performance fetching
1 result from a set of 100, or 100,000,000.
Structure
Collection, Doc, Field
Collection, Doc, Field
A doc is minimum unit at communication
yati.ma/qi A doc is minimum unit Read Write Rule Update
limit: 1/sec Subcollection depth: ≦ 100
All queries are shallow
Query is available only in a collection, so far
For making full use, change a way of thinking
Yatima Model
UniFeed: Supereasy timeline system
None
yati.ma/qi UniFeed: Usage Just query at viewer self ID!
yati.ma/qi UniFeed: Limit Indexes in a document: ≦ 20,000 But
we can batch() (≦ 500)
yati.ma/qi Multi UniFeed Follower: ≦ 10,000,000 (20,000 * 500) ...Actually,
not everyone follow one Probably up to approx. 1M follower in rough estimate
yati.ma/qi Level 2 multi UniFeed Add batch() at Cloud Functions,
more scalable Follower: ≦ 5,000,000,000 (20,000 * 500 * 500) and you can go any level! your bank balance vs Google’s capacity
Twixxer should use it immediately :-P
But wait, how about doc size?
yati.ma/qi UniFeed: Doc size w/ auth.uid: < approx. 600kb (20,000
* 30 chars) w/ pushid: < approx. 300kb (20,000 * 15 chars) ...Actually, not everyone bla bla so at most 30kb, usually 300 or less (realistic!)
Firebase as a Cache (Componentized DB, Virtual DB)
yati.ma/qi General: Write
yati.ma/qi General: Read
yati.ma/qi FaaC: Write Virtual DB
yati.ma/qi FaaC: Read
yati.ma/qi FaaC: Pros Componentized DB Flux-like data flow Explicit communications
Flexibility of DB Faster view
yati.ma/qi Flux architecture
yati.ma/qi General: Data flow
yati.ma/qi FaaC: Flux-like data flow Virtual DB
yati.ma/qi General: Implicit comm. Who are you?
yati.ma/qi FaaC: Explicit comm. I know! Same component
yati.ma/qi FaaC: Cons Need to edit DB/rule occasionally (Build tool
overcome it) Fetch per component
yati.ma/qi FaaC: Background Lower cost to edit DB Component-Based Architecture
Denormalize Trend of static contents CDN
A doc is minimum unit! English is difficult for me!
Fin. ヾ(╹◡╹*)ノ゛ Throw your masakari axe at me! ://yati.ma