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
640
Android StudioのLiveTemplateの便利な使い方 / Android LiveTemplate Method
yshogo
0
1k
ZOZOの新規サービス 「FAANS」の開発 Android編/FAAN App Create on Android
yshogo
0
1.3k
Flutter_meetup_tokyo__10.pdf
yshogo
0
5.7k
PORT Firebase x Flutter
yshogo
0
370
ZOZOTech meetup Frontend #10
yshogo
2
1.6k
flutter-meetup.pdf
yshogo
0
51
Potetochips #61
yshogo
1
500
Firebase ML Kitを使った デモアプリ活用事例 @Google App DOJO
yshogo
1
170
Featured
See All Featured
Optimizing for Happiness
mojombo
376
70k
Speed Design
sergeychernyshev
25
620
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Scaling GitHub
holman
458
140k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
A Philosophy of Restraint
colly
203
16k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Building Your Own Lightsaber
phodgson
103
6.1k
Git: the NoSQL Database
bkeepers
PRO
427
64k
What's new in Ruby 2.0
geeforr
343
31k
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ͷ Έ߹Θͤඞਢͱ͍͍͍͔ͬͯͱࢥ͍·͢ɻ ❤
Ҏ্Ͱ͢ɻ ࠙ձͰ͓͠͠·͠ΐ ͏ʂʂ