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
310
TSX First な Zero-Runtime SSG potato4d/dodai とその仕組み / owned static site generator #kyotojs
potato4d
1
2k
Vue.js with TSX - From Vue 2.x to Vue 3 #v_tokyo11
potato4d
9
4.7k
終わりゆく 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
役立つログに取り組もう
irof
28
9.6k
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
Better Code Design in PHP
afilina
PRO
0
130
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
140
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
CSC509 Lecture 11
javiergs
PRO
0
180
Featured
See All Featured
RailsConf 2023
tenderlove
29
900
How GitHub (no longer) Works
holman
310
140k
A better future with KSS
kneath
238
17k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Code Review Best Practice
trishagee
64
17k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Documentation Writing (for coders)
carmenintech
65
4.4k
Gamification - CAS2011
davidbonilla
80
5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
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