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
The way of truly serverless application
Search
miup
November 21, 2017
Programming
4.6k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The way of truly serverless application
Firebase.yebisu #1
miup
November 21, 2017
More Decks by miup
See All by miup
Algolia with Firebase
miup
2
1.5k
Firestore のクエリと全文検索
miup
7
3.6k
Firestore, Cloud Storage を用いた アプリ内での画像の扱い方
miup
5
25k
Firebase Cloud Messaging 入門編
miup
0
5.2k
Other Decks in Programming
See All in Programming
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
350
The Rails Doctrine Decade
koic
2
400
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
7
5k
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
4.2k
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
130
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.4k
スマート反転とウェブアクセシビリティ
camiha
0
220
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
360
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
8.8k
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
690
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
110
App Intentsのビルドプロセスを支える技術
kntkymt
0
460
Featured
See All Featured
The Curse of the Amulet
leimatthew05
3
15k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
350
Speed Design
sergeychernyshev
33
2.1k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
370
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
How to make the Groovebox
asonas
2
2.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
The Language of Interfaces
destraynor
162
27k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
440
Rails Girls Zürich Keynote
gr2m
96
14k
Transcript
The way of truly serverless application Firebase.Yebisu #1
ࣗݾհ ࡾӜ (ID: miup) • ࠓ৽ଔͰೖࣾ (ࠃࣄۀ։ൃ෦ॴଐ) • ݄̑ͷଐ͔Β
Firebase Λ৮Γ࢝Ίͨ • iOS ΞϓϦ̐͘Β͍ॻ͍͍ͯΔ
Truly Serverless?
Truly Serverless • ج൫ͯ͢֎෦ BaaS, SaaS ʹґଘ • ॻ͘ͷΫϥΠΞϯτΞϓϦέʔγϣϯͱͦ ΕΒαʔϏεͱͷ࿈ܞͷΈ
Firebase ͰेͰʁ
Firebase ͷ • DB ͷΫΤϦ͕ѹతʹऑ͍ • FireStore ͰෳࡶͳΫΤϦ·͔͚ͩͳ͍
ΫΤϦ͕ऑ͍ͱʁ • ΫϥΠΞϯταΠυδϣΠϯ͕ඞཁ • ඇಉظ͕ॏͳͬͯͭΒ͍ • όάͷԹচ • ηϧͷߴ͞ܭࢉͱ͔͏·͍͔͘ͳ͍ https://qiita.com/miuP/items/ce3a3888d5411d2f8e70
Solution • Realm • ֎෦ݕࡧΤϯδϯΛ͏
Algolia Search • શจݕࡧΤϯδϯ • ຊޠରԠ • FireStore ͷશจݕࡧͷͱ͜ΖͰνϣϩͬͱ৮ ΕΒΕ͍ͯΔ
https://firebase.google.com/docs/firestore/solutions/search
࿈ܞ • ॻ͖ࠐΈݖݶͷ API Key ΛΫϥΠΞϯτͰ࣋ ͯͳ͍ • όοΫΤϯυΞϓϦέʔγϣϯ͕લఏ
Archtecture #BDLFOE "QQMJDBUJPO 'JSFCBTF &YUFSOBM4FSWJDF .PCJMF"QQ : Read : Write
Firebase ͚ͩͰͳΜͱ͔͍ͨ͠
CloudFunctions • HTTP DB ͷมߋΛϑοΫʹಈ࡞͢Δ Node.js ڥ • ͪΖΜ
TypeScript Ͱॻ͚Δ • ֎෦ API Λୟ͚Δ • Push ௨ૹΕΔ
Architecture 'JSFCBTF &YUFSOBM 4FSWJDF .PCJMF"QQ : Read :
Write $' %#
Write 'JSFCBTF $' %# .PCJMF"QQ &YUFSOBM 4FSWJDF callback
Firebase Cloud Messaging Silent Push
Read 'JSFCBTF &YUFSOBM 4FSWJDF .PCJMF"QQ %# Observe Realtime
Value Get main Data
ίʔυྫ
Algent • [WIP] • Algolia ͷΫϥΠΞϯτͷ wrapper • Decodable ͳܕΛ
Response Ͱࢦఆ • ˑˑˑˑˑ
Write functions.database.ref(‘path/to/user/{userID}').onCreate(async event => { let userID = event.params!.userID let
firUser = await admin.database() .ref(`path/to/user/${userID}`) .once(‘value').then(snap => snap.val()) let userIndex = algolia.initIndex('user') let user = new User(userID, firUser) return userIndex.addObject(user) // send FCM for callback }) ref: https://qiita.com/star__hoshi/items/6ee9d1413a34ca5849eb
Request struct AlgoliaFeedRequest: AlgoliaRequestProtocol { typealias HitType = Algolia.Feed var
indexName: String { return "feed" } var query: AlgentQuery { let query = AlgentQuery() return query } }
Read // search from algolia using Algent // Result<Response<Response<Request.HitType>, Error>
Algent.shared.search(request: AlgoliaFeedRequest()) Firebase.Post.databaseRef .child(feed.objectID) .child(“likes/count") .observe(.value) { [weak self] snapshot in if snapshot.exists() { self?.likeCountString.value = "\(snapshot.value as? Int)" } else { self?.likeCountString.value = "0" } }
Sample • SNS ͬΆ͍ͭ • Feed ͱ User Algolia
͔Βݕࡧ • ͍͍ͶʂߘͳͲͷมಈ͢ΔͷΈΛ RealtimeDB͔ΒObserve • Silent Push ͔Βߋ৽ະ࣮
σϞ https://github.com/miuP/AlgoliaFirebaseSample
·ͱΊ • Truly Serverless • Firebase ͰͰ͖ͳ͍͜ͱແཧͤͣผͷࡦΛ ࿅Δ • ֎෦αʔϏεͱͷ࿈ܞͳ͍
ϞόΠϧΤϯδχΞ͚ͩͰαʔϏε࡞Δͧʙʂ
Q&A