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
PORT_Firebase___Algolia.pdf
Search
shogo.yamada
December 11, 2019
0
220
PORT_Firebase___Algolia.pdf
shogo.yamada
December 11, 2019
Tweet
Share
More Decks by shogo.yamada
See All by shogo.yamada
Jetpack ComposeへのリファクタリングのTIPS: CustomViewの便利な使い方 / Refactoring TIPS to Jetpack Compose: Useful usage of CustomView
yshogo
0
580
Android StudioのLiveTemplateの便利な使い方 / Android LiveTemplate Method
yshogo
0
980
ZOZOの新規サービス 「FAANS」の開発 Android編/FAAN App Create on Android
yshogo
0
1.2k
Flutter_meetup_tokyo__10.pdf
yshogo
0
5.7k
PORT Firebase x Flutter
yshogo
0
350
ZOZOTech meetup Frontend #10
yshogo
2
1.6k
flutter-meetup.pdf
yshogo
0
51
Potetochips #61
yshogo
1
490
Firebase ML Kitを使った デモアプリ活用事例 @Google App DOJO
yshogo
1
170
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
95
5.1k
Atom: Resistance is Futile
akmur
261
25k
Pencils Down: Stop Designing & Start Developing
hursman
119
11k
Docker and Python
trallard
40
3k
Documentation Writing (for coders)
carmenintech
65
4.3k
Optimising Largest Contentful Paint
csswizardry
31
2.8k
Six Lessons from altMBA
skipperchong
26
3.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
No one is an island. Learnings from fostering a developers community.
thoeni
19
2.9k
Fireside Chat
paigeccino
32
3k
Building Adaptive Systems
keathley
38
2.1k
Facilitating Awesome Meetings
lara
49
6k
Transcript
Firebase × Flutter × Alglia PORT Firebase × Alglia Shogo
yamada
ࣗݾհ Nama: Shogo Yamada Job: AndroidΤϯδχΞ Twitter: @yshogo87 Facebook: ࢁాঘޗ
࣍ ɾAlgoliaͷ༻໘ ɾAlgoliaͷ͍ํ ɾAlgoliaΛFlutter͔Β͏ ɾAlgolia͔ΒσʔλΛऔಘ͢ΔϝϦο τ/σϝϦοτ
Algoliaͷ༻໘
Algoliaͷ༻໘
Algoliaͷ༻໘ UserNameͰݕࡧʁ UserIDͰݕࡧʁ ը૾ͷΧςΰϦͰݕࡧʁ
Algoliaͷ༻໘ where userName like hogehoge OR userId like hogehoge OR
categoryName like hogehoge
None
ͦ͜ͰAlgolia
Algoliaͷ༻໘ ɾuser_id ɾuser_name ɾintroduction ͳͲෳͷଐੑͷจࣈྻʹରͯ͠ݕࡧΛ ͛Δ͜ͱ͕Ͱ͖Δ
Algoliaͷ༻໘
Algolia͍ํ
Algoliaͷ͍ํ ɾAlgoliaʹαΠϯΞοϓ ɾαΠϯΞοϓޙʹindexΛ࡞͢Δ
Algoliaͷ͍ํ ɾCloud FunctionsͷηοτΞοϓΛߦ͏ npm install algoliasearch
Algoliaͷ͍ํ ɾFirestoreͷτϦΨʔΛར༻ͯ͠Algoliaʹ σʔλΛ͛Δ
Algoliaͷ͍ํ
Algoliaͷ͍ํ ɾΫϥΠΞϯτଆ͔ΒAlgolia SDKΛͬͯ Algoliaʹऔಘ͠ʹ͍͘
Algoliaͷ͍ํ Firestoreʹอଘ τϦΨʔ SDKͰσʔλΛ͛Δ ΫΤϦ
Flutter͔ΒAlgoliaΛ͏
Flutter͔ΒAlgoliaΛ͏
Flutter͔ΒAlgoliaΛ͏
Algolia͔ΒσʔλΛऔಘ͢Δ ϝϦοτ/σϝϦοτ
͔͜͜Βࣗݸਓͷҙݟͳ ͷͰશͯͷࣄʹͯ·Δ ͱݶΒͳ͍Ͱ͢
Algolia͔ΒσʔλΛऔಘ͢Δϝ Ϧοτ/σϝϦοτ ϝϦοτ ɾFirestoreʹͳ͍ΫΤϦ͕͑ΔΑ͏ʹͳ Δ (likeɺfilterɺෳ߹ΫΤϦɺetc….) ɾϥϯΩϯάઃܭָ͕
Algolia͔ΒσʔλΛऔಘ͢Δϝ Ϧοτ/σϝϦοτ ෳ߹ΫΤϦ
Algolia͔ΒσʔλΛऔಘ͢Δϝ Ϧοτ/σϝϦοτ ϥϯΩϯά
Algolia͔ΒσʔλΛऔಘ͢Δϝ Ϧοτ/σϝϦοτ σϝϦοτ ɾFirestoreͷϩʔΧϧΩϟογϡػೳ͕͑ ͳ͍
Algolia͔ΒσʔλΛऔಘ͢Δϝ Ϧοτ/σϝϦοτ σϝϦοτ ɾFirestoreͷϩʔΧϧΩϟογϡػೳ͕͑ ͳ͍ ͜Ε݁ߏΫϦςΟΧϧ
FirestoreΛԽ ͯ͠औಘ͢Δ͔ Algolia͔ΒΫΤϦ͢Δ͔
ྫΛ͋͛ͯઆ໌͠·͢ɻ
Firestoreͷ߹
TwitterͷλΠϜϥΠϯͷΑ͏ͳػೳΛ࣮͢Δͱ͖ Firestoreͷ߹ ϢʔβʔA(userID: id1)͕πΠʔτ͢Δͱ user/id1/posts/{postsId}/[data]
TwitterͷλΠϜϥΠϯͷΑ͏ͳػೳΛ࣮͢Δͱ͖ Firestoreͷ߹ ϢʔβʔAΛϑΥϩʔ͍ͯ͠ΔϢʔβʔશһͷλΠ ϜϥΠϯʹίϐʔ͢Δɻ user/{followerId1}/timeline/{postsId}/[data] user/{followerId2}/timeline/{postsId}/[data] user/{followerId3}/timeline/{postsId}/[data] ɿ ϢʔβʔA(userID: id1)͕πΠʔτ͢Δͱ
user/id1/posts/{postsId}/[data]
TwitterͷλΠϜϥΠϯͷΑ͏ͳػೳΛ࣮͢Δͱ͖ Firestoreͷ߹ ͋ͱϑΥϩʔ͍ͯ͠ΔϢʔβʔίϐʔ͞Εͨ σʔλΛࢀর͢Δ user/{followerId1}/timeline/{postsId}/[data]
TwitterͷλΠϜϥΠϯͷΑ͏ͳػೳΛ࣮͢Δͱ͖ Firestoreͷ߹ ϝϦοτ ɾಡΈऔΓ͕؆୯(ίϐʔ͞ΕͨσʔλΛࢀর͢ Δ͚ͩ ɾFirestoreͷϩʔΧϧΩϟογϡ͕͑Δ σϝϦοτ ɾσʔλΛԽ͍ͯ͘͜͠ͱͷཧίετ ͔͔Δ
Algoliaͷ߹
TwitterͷλΠϜϥΠϯͷΑ͏ͳػೳΛ࣮͢Δͱ͖ Algoliaͷ߹ ϢʔβʔA(userID: id1)͕πΠʔτ͢Δͱ user/id1/posts/{postsId}/[data]
TwitterͷλΠϜϥΠϯͷΑ͏ͳػೳΛ࣮͢Δͱ͖ Algoliaͷ߹ ϢʔβʔA(userID: id1)͕πΠʔτ͢Δͱ user/id1/posts/{postsId}/[data] τϦΨʔͱͯ͠Algoliaʹσʔλ͛Δɻ
TwitterͷλΠϜϥΠϯͷΑ͏ͳػೳΛ࣮͢Δͱ͖ Algoliaͷ߹ AlgoliaʹΫΤϦ͢Δ
TwitterͷλΠϜϥΠϯͷΑ͏ͳػೳΛ࣮͢Δͱ͖ Algoliaͷ߹ ϝϦοτ ɾσʔλΛԽ͍ͯ͘͠ඞཁ͕ͳ͍ͷͰཧ ͕ϥΫ ɾFirestoreʹൺͯͬͪ͜ͷ΄͏͕ӡ༻අ͕҆ ͘ͳΔ߹͋Δ σϝϦοτ ɾFirestoreͷϩʔΧϧΩϟογϡ͕͑ͳ͍
TwitterͷλΠϜϥΠϯͷΑ͏ͳػೳΛ࣮͢Δͱ͖ ݁ՌͲͬͪΛ͏͖͔ʮcase by caseʯ ݁ ɾσʔλͷࢀর͕ϥΫʹͳΔͷ -> Firestore ɾσʔλͷߋ৽͕ϥΫʹͳΔͷ ->
Algolia
ࢀরΛͱΔ͔ ߋ৽ΛͱΔ͔
ͪͳΈʹɺɺɺ ͕ࣗࠓ࡞ͬͯΔSNSαʔϏεFirestoreͰλΠϜ ϥΠΛ࡞͍ͬͯ·͢ɻ ཧ༝ ɾFirestoreͷϩʔΧϧΩϟογϡΛ͍͔ͨͬͨ ɾ༻্Ұఆͷ࣌ؒͰλΠϜϥΠϯͷσʔλ͕ফ͑ ΔͷͰߋ৽ճݶఆ͞Ε͍ͯΔ
Ͱ͕͢ɺɺɺ ݕࡧܥ͘͢͝ศརͳͷͰɺFirestoreͱAlgoliaͷ Έ߹Θͤඞਢͱ͍͍͍͔ͬͯͱࢥ͍·͢ɻ ❤
Ҏ্Ͱ͢ɻ ࠙ձͰ͓͠͠·͠ΐ ͏ʂʂ