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
RWC 2024 DICOM & ISO/IEC 2022
m_seki
0
200
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
Haze - Real time background blurring
chrisbanes
1
500
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
Jakarta EE meets AI
ivargrimstad
0
230
선언형 UI에서의 상태관리
l2hyunwoo
0
130
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
130
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
260
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Mobile First: as difficult as doing things right
swwweet
222
9k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
440
Music & Morning Musume
bryan
46
6.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
GraphQLとの向き合い方2022年版
quramy
44
13k
The Language of Interfaces
destraynor
154
24k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
What's in a price? How to price your products and services
michaelherold
243
12k
Designing Experiences People Love
moore
138
23k
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