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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
Docker Desktop不要の時代が来る? WSL標準の「wslc」で Linuxコンテナを動かしてみた.
ueponx
0
270
フルAIで個人開発して学んだあれこれ / yuruai vol.1
isaoshimizu
0
160
事業会社は今こそSWEを高給で雇ってWebシステムを内製しよう
masaokb
0
110
WebGIS AI Agentの紹介
_shimizu
0
600
時期が悪い!それでもRaspberry Piを買って遊んで活用するには / 20260627-osc26do-rpi-jikigawarui
akkiesoft
1
930
背中から、背中へ /paying forward to community
naitosatoshi
0
170
ご挨拶「10周年を迎える共創ラボのこれまでとこれから」
iotcomjpadmin
0
160
AIは、人間らしい仕事の夢を見るか?─ AI時代のtoB/toEプロダクトを再設計する
techtekt
PRO
0
180
AI 不只幫你寫 Code: 當專案從 300 暴增到 1500, 我們如何撐住 DevOps
appleboy
0
290
10年間のブログ発信を振り返って見えたWebアプリケーションエンジニアとしての軌跡
stefafafan
0
190
デジタル・デザイン構想 by Sayaka Ishizuka
y150saya
0
110
Agentic AI 時代のテスト手法: Kiro とはじめるプロパティベーステスト (AWS Summit Japan 2026 | DEV212)
ymhiroki
0
110
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
190
Context Engineering - Making Every Token Count
addyosmani
9
990
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
55k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
180
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
590
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.6k
How to build a perfect <img>
jonoalderson
1
5.7k
Amusing Abliteration
ianozsvald
1
210
Designing for Performance
lara
611
70k
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