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
2018 年は Firebase を使ったけど 2019 年は AWS Amplify を使お...
Search
potato4d(Takuma HANATANI)
January 12, 2019
Programming
24
16k
2018 年は Firebase を使ったけど 2019 年は AWS Amplify を使おうと思う / AWS Amplify 2019 #kyotojs
2019/01/12 に #kyotojs で発表したスライドです
potato4d(Takuma HANATANI)
January 12, 2019
Tweet
Share
More Decks by potato4d(Takuma HANATANI)
See All by potato4d(Takuma HANATANI)
どうせキレイに書けない処理は逆にAIに書いてもらうほうが良い説 / #kyotojs 22
potato4d
3
330
TSX First な Zero-Runtime SSG potato4d/dodai とその仕組み / owned static site generator #kyotojs
potato4d
1
2.1k
Vue.js with TSX - From Vue 2.x to Vue 3 #v_tokyo11
potato4d
9
4.8k
終わりゆく Vue 2.x 時代の状態設計のアンサー - Vue 3 の Provider への期待 / The Last Architecture of the Vue 2.x
potato4d
25
6.8k
Web Worker を使ってブラウザ上でポケモンの画像を解析したい! / Pokemon recognition from screenshots in browser using web worker
potato4d
0
1.2k
Firebase & Google Cloud によるサーバーレス帳票管理 #FJUG / Serverless Architecture in Candy
potato4d
8
3.6k
NestJS meetup Tokyo Opening Talk / What is NestJS? #nestjs_meetup
potato4d
11
3.9k
私たちはなぜ SPA で開発するのか / Why you choose SPA
potato4d
39
26k
Amplify Console 誕生以来本番運用しつづけてわかったこと #awswakaran_tokyo
potato4d
6
3.4k
Other Decks in Programming
See All in Programming
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
100
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
330
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
330
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
140
testcontainers のススメ
sgash708
1
120
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
770
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
Beyond ORM
77web
5
700
命名をリントする
chiroruxx
1
410
선언형 UI에서의 상태관리
l2hyunwoo
0
160
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Optimizing for Happiness
mojombo
376
70k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Typedesign – Prime Four
hannesfritz
40
2.4k
Building an army of robots
kneath
302
44k
Transcript
2018 Firebase Λ͚ͬͨͲ 2019 AWS Amplify Λ͓͏ͱࢥ͏ 2019.01.12
#kyotojs HANATANI Takuma(@potato4d)
HANATANI Takuma (@potato4d) • p. at Elevenback / engineer at
LINE corp. • Maintainer at • Vue.js JP Docs (Core maintainer) / Nuxt.js JP Docs (maintainer) • Web Application Developer • — Vue.js, Nuxt.js, Node.js(with TypeScript), Serverless • — User Interface, Micro Interaction, Product Development
ࠓ͍ͨ͜͠ͱ
Firebase ศར
Firebase ؆୯
Firebase ָ .
Firebase ࠷ߴ
ेମݧ͔ͨ͠Βࠓ AWS Amplify Ͱ࠷ߴʹͳΖ͏
Agenda 1. جຊ࠷ߴͳ Firebase ͷ࠷ߴ͡Όͳ͍ͱ͜Ζ 2. AWS ͷ Firebase ର߅അͱͳΔ
"AWS Amplify" 3. Ұ൪खܰʹ͑Δ Amplify Console ͚ͩͰಋೖͯ͠ΈΑ͏
جຊ࠷ߴͳ Firebase ͷ ࠷ߴ͡Όͳ͍ͱ͜Ζ
Firebase ͷࠔͬͨ • ෳڥͷαϙʔτ໘͕Ͳ͏ͯ͠ऑ͍ • ϗεςΟϯάຊ൪ڥͱͯ͠ Fastly Ͱศར͚ͩͲ Deploy Preview
͕ͳ͔ͬͨΓͱෆศ • ͦͦෳͷ environment Λཧ͢ΔͨΊʹϓϩδΣΫτ Λ environment ͷ͚ͩ༻ҙ͢Δඞཁ͕͋Δ • RTDB / Firestore Λ dev ڥͰςετϞʔυʹͰ͖ͨΓศར ͳ෦ଟগ͋Δ͕……ɻ
Firebase ͷࠔͬͨ • Dev ͷαϙʔτखް͍ͷͷ Ops पΓ͕Ͳ͏ͯ͠ශऑ • CI /
CD ڥଘࡏ͠ͳ͍(ࣗ CircleCI ʹҕͶ͍ͯΔ) • গ͠લ·Ͱ Firestore ͷόοΫΞοϓػೳ͕ͳ͔ͬͨ • ͦͷଞӡ༻্ͷ͕ੜͨ͡߹ͷରॲࡦ͕ऑ͔ͬͨ • ࠷ۙೝূใు͖ग़ͤΔΑ͏ʹͳ͓ͬͯΓվળͷ༗
Firebase ͷࠔͬͨ
Firebase ͷࠔͬͨ https://medium.com/google-cloud-jp/firestore-backup-67327a74cd54
Firebase ͷࠔͬͨ • Cloud Functions Ͱ͑ͳ͍ʗΓͨ͘ͳ͍ͷͷಀ͛ઌ͕ͳ͍ • ࣮ Cloud Functions
࠷Ұճ ࣮ߦ͞ΕΔ • ೋճ࣮ߦ͞ΕΔՄೳੑ͕͋Δ͜ͱΛߟ͑ͯΔඞཁੑ • (جຊBlazeϓϥϯͩͱࢥ͏͕) Blaze Ҏ֎ͩͱ OutBound ੍ݶ • Node ͔ͭ FaaS or Express ίʔυʹݶఆ • Google Β͘͠ Custom Runtime ͓Ζ͔ 1 ݴޠ
Firebase ͷࠔͬͨ • ͱͱ Mobile App ٭ͳͷͰ Web ͚ऑ͍ •
ΞφϦςΟΫεܥͯ͢ / ML Kit / ςεςΟϯά / ϨϙʔςΟϯ ά / Ad ͳͲ • શମͰ͍͏ͱఔͷػೳ͕ Web ʹͳ͍ • ϝΠϯػೳ͋Δ͕ɺϫϯετοϓͱݴ͑ͳ͍
खૣ͘࡞Δͱ͖ʹ͏ͪΐͬͱॊೈͳ Alternative ͕΄͍͠
AWS ͷ Firebase ର߅അͱͳΔ "AWS Amplify"
AWS Amplify • AWS ϞόΠϧ͚ϓϥοτϑΥʔϜͱɺͦͷͨΊͷ։ൃϑϨʔϜϫʔΫ • ͱͱ aws-sdk(2MB) + Cognito
SDK Έ͍ͨʹཚཱ & ංେԽ͢ Δ AWS ͷ JavaScript SDK Λ౷߹͢ΔͨΊʹ͡·ͬͨ JavaScript ϥΠϒϥϦͱͯ͠ͷϓϩδΣΫτ • ϥΠϒϥϦݱࡏͰ Web / React Native / iOS / Android ʹରԠ͢ ΔϚϧνϓϥοτϑΥʔϜͳ Amplify Framework ͱมԽͨ͠ • ͦͷޙखΛ͛ɺݱࡏͰ AWS ͷϞόΠϧ͚ϓϥοτϑΥʔϜશ ମΛࢦ͢Α͏ʹมԽ͍ͯ͘͠
AWS Amplify • ఏڙ͍ͯ͠Δػೳ܈ʢҰྫʣ • API ࿈ܞ(AppSync GraphQL / REST
API Gateway) • Authentification (Cognito) • Hosting (CloudFront / S3) • File Storage (S3) • Analytics (Pinpoint & Kinesiss) • etc ...
AWS Amplify ͍͍ͩͨ Firebase ͷϑϧ൛ + α
AWS Amplify ͷྑ͞ • JavaScript ϑϨʔϜϫʔΫͱͷγʔϜϨεͳ࿈ܞ • React / Vue
/ Angular ͦΕͧΕͷઐ༻ SDK ͕ଘࡏ • ͦΕͧΕͷจԽʹ߹Θͤͨ API ͷެࣜͰͷఏڙ • SDK Λ৮ͬͯͰ͖Δ͜ͱશ࣮ͯݱՄೳ • αʔυύʔςΟϑϨʔϜϫʔΫଆͷ࿈ܞϥΠϒϥϦශऑͳ ͜ͱׂ͕ͱଟ͍தɺAWSଆ͔ΒدΓఴ͍ͬͯΔͷͰڠྗ
AWS Amplify ͷྑ͞
AWS Amplify ͷྑ͞
AWS Amplify ͷྑ͞
AWS Amplify ͷྑ͞ • DynamoDB On-Demand ͷొʹΑΔ࿈ܞͷ͢͠͞ • ͜Ε·ͰAWS ಠࣗͷࢼࢉ(ಛʹDynamo)͕Ͳ͏ͯ͠ωοΫ
• Φʔτεέʔϧ͋Δ͕ίετ໘ʗظͰΞΫηε͕Ͷͨ࣌ ͷ͜ͱͳͲ • ڈͷय़͜ΕͰۤ࿑ͯ͠ Firebase Ͱྑ͔ͬͨࣄ͋ͬͨ • 2018 ͷ re:invent Ͱ͚ͬͨͩͷ DynamoDB ͕ొ • Firebase ϨϕϧͷϥΠτ͞Ͱ AWS Πϯϑϥͱͷଓ͕༰қʹ
AWS Amplify ͷྑ͞ https://aws.amazon.com/jp/blogs/news/amazon-dynamodb-on-demand-no-capacity-planning-and-pay-per-request-pricing/
AWS Amplify ͷྑ͞ • ޙΖ͕ී௨ͷ AWS ͳͷͰॊೈੑ͕͋Δ • Amplify Framework
͔Βଓ͍ͯ͠Δͷ࠷ऴతʹͲ͜ʹଐ ͢Δ͔͕໌ه͞Ε͍ͯΔ • (ಛʹAPIͳͲ) Amplify ͔ͩΒͱ͍ͬͯಛʹԿ੍͔ݶ͕͋ΔΘ ͚Ͱͳ͍ͷͰ෯Λͨͤͨ͘ͳͬͨ࣌ʹศར • ͦͷ Firebase ΑΓ͕ࣝඞཁͳؾ͕͢Δ
AWS Amplify ͷྑ͞ https://aws-amplify.github.io/docs/js/analytics
AWS Amplify ͷྑ͞ https://aws-amplify.github.io/docs/js/analytics
AWS Amplify ͷྑ͞ • ࠷ۙ CI / CD ͱϗεςΟϯά͕Ͱ͖Δ Amplify
Console ͕Ͱͨ • Amplify Framework Λར༻͍ͯ͠Δ͔Ͳ͏͔ʹؔΘΒͣ͑Δ • Ϗϧυ → σϓϩΠ → ͕͋Εࠩ͠͠ͷجຊ͕Մೳ • Route 53 > CloudFront (w/ ACM) > S3 ͷఆܗ࡞ۀ͕Ϙλϯ1ͭ • ϒϥϯν͝ͱͷෳڥσϓϩΠΛαϙʔτ(ڥม) • ೝূΛ༩͢Δ͜ͱ͕Ͱ͖ɺ2019/01࣌Ͱ Basic ೝূΛαϙʔτ
AWS Amplify ͷྑ͞ https://aws-amplify.github.io/docs/js/analytics
AWS Amplify ͷྑ͞ • Multi Environment ͷରԠ • શମతʹෳڥʹྗ͕ೖ͍ͬͯΔ •
Console ɺ Amplify Framework ϕʔλͰ͋Δ͕ෳ ڥΛҙࣝͨ͠มߋ͕ಋೖ͞Ε͍ͯΔ • ॳճϦϦʔεΑΓઌ͔ͬ͠Γͱߟ͑ͭͭ։ൃ͢ΔͨΊͷ ͕ Firebase ൺͰἧ͍ͬͯΔҹ
ମݧ Amplify Console
Amplify Console ͓͞Β͍ • Amplify αʔϏεͷதͷҰͭͰ͋ΓɺσϓϩΠपΓ • ݱঢ় CI /
CD ࣮ߦͱϗεςΟϯά͕ҰͭʹͳͬͨαʔϏε • Circle CI + Firebase ͋Δ͍ Netlify ͷڧԽ൛ • ϒϥϯνࢦఆͰͷσϓϩΠϓϨϏϡʔ • 1ͰͰ͖Δ TLS ରԠ / CloudFront ʹΑΔΤοδΩϟογϡ • σϓϩΠϓϨϏϡʔ͝ͱͷΞΫηεೝূ༩
खॱ 1. AWS ΞΧϯτͰϩάΠϯ ← ࠓ͙͢։ઃʂʂʂʂʂʂʂ 2. https://aws.amazon.com/jp/amplify/console/ ʹΞΫηε 3.
ΞϝϦΧਓʹͳΔʢຊʹϦʔδϣϯ͕ͳ͍ͷͰʣ 4. దʹαΠτΛ্ཱͪ͛ͯదͳ Git ϒϥϯνʹ push ͢Δ 5. CI / CD ͕উखʹߦΘΕͯϒϥϯν͝ͱʹσϓϩΠ͞ΕΔ 6. ϕʔγοΫೝূͳͲΛؾܰʹ༩Ͱ͖Δ(ϒϥϯν͝ͱՄ)
σϞͯ͠ΈΔ
Α͋͘Δ࣭ • ๚ऀΞϝϦΧਓ͡Όͳ͍Μ͚ͩͲ • ࡞Δਓ͕ΞϝϦΧਓͳΒ CloudFront ͕ࣗಈͰט·͞ΕΔͷ Ͱɺຊਓ͚ʹշదʹίϯςϯπΛఏڙͰ͖Δ • Netlify
ͰΑ͘ͳ͍ʁ • Deploy Preview ʹ҆ՁͰϕʔγοΫೝূ΄͘͠ͳ͍……ʁ • ͦΕҎલʹ Production ͳΒ࠷େݶ҆ఆͯ͠΄͘͠ͳ͍……ʁ
Α͋͘Δ࣭ • Firebase Hosting Fastly ͚ͩͲ • Θ͔Δ •
͜Ε͋Μ·Γ Amplify ຊମͱؔͳ͘ͳ͍ʁ • AWS ͷϞόΠϧ(Web)ΞϓϦέʔγϣϯ͚ͷαʔϏεू߹ମ ͕ͦ͜ Amplify ͳͷͰ…… • Ұ൪͙͢ʹҠߦͰ͖ͦ͏ͳ෦ͱͯ͠ɺ·ͨ Amplify ʹೖͬͯ Β͏ͱ͖ͬͭʹҰ൪ྑ͍ͱࢥ͏
Α͋͘Δ࣭ • ݁ہ Amplify ࣗମීஈͬͯΔͷʁ • ϑϧ Amplify ΞϓϦέʔγϣϯͷ Production-in
·ͩɻ Console ୯ମ͙͢ಋೖͰ͖ΔͷͰ Production ͍ͬͯ·͢ɻ • Hobby Use ͩͱׂͱ͍ͬͯΔͷͰ 2019 ಋೖ͍ͨ͠ • AmplifyɺFirebase ͰΑ͘ͳ͍ʁ • FirebaseͰ͍͍ͳΒFirebaseͰྑ͍ɻΑ͘ͳ͍࣌ͷબࢶͱͯ͠ॏཁ • AWS ͷձࣾʗGCP ͷձࣾ໌֬ʹ͋ΔͷͰɺͦͷҙຯͰ
Α͋͘Δ࣭ • Firebase ΛΘͳ͘ͳΓͦ͏ʁ • ͦΜͳ͜ͱͳ͍ɻґવͱͯܰ͠ྔͳ Web ΞϓϦέʔγϣϯ ͷ։ൃ Firebase
Λ͍͍ͨ͠ɺ DB Firestore ͕༏ल • ҎԼͷγνϡΤʔγϣϯͰ͍͍ͨ • େ͖Ίͷ API Λ։ൃͯ͠ΨοπϦ࡞ΓࠐΈ͍ͨͱ͖ • Firebase Hosting ࣺͯͯ Amplify Console ʹ͍ͨ͠ • Firebase Auth MFA ͕ͳ͍ͷͰηΩϡΞͳೝূ Amplify
ઈର͏ͧ AWS Amplify 2019