Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
AppSync를 활용한 리얼타임 서버리스 아키텍쳐
Search
Taewoo Kim
February 13, 2020
Programming
4.8k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AppSync를 활용한 리얼타임 서버리스 아키텍쳐
제21차 AWSKRUG 서버리스 소모임에서 발표한 내용입니다.
Taewoo Kim
February 13, 2020
More Decks by Taewoo Kim
See All by Taewoo Kim
AWS Lambda 내부동작 파헤치기
twkiiim
1
3k
Amazon VPC Deep Dive: ENI 를 알면 VPC 가 보인다
twkiiim
2
5.9k
온라인 주문 서비스를 서버리스 아키텍쳐로 구축하기
twkiiim
0
460
Amplify Meetup #01
twkiiim
1
6.7k
Amazon EventBridge vs Amazon SNS
twkiiim
0
2.6k
活用パターンで学ぶGraphQL
twkiiim
0
1.6k
AWS 기반 서버리스 아키텍쳐 톺아보기
twkiiim
0
2.3k
AWS 기반 서버리스 아키텍쳐 톺아보기
twkiiim
1
3.5k
[LINE API × Tech API Vol. 2 Powered by AWS] サーバーレスでの分散トランザクション
twkiiim
0
2.6k
Other Decks in Programming
See All in Programming
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
170
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
860
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2.5k
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
190
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
Simple Storage Service(S3) is not simple
iwatsukayura
0
300
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
260
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
1k
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
190
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
300
Railsバージョンを4倍にした話
optim
0
470
Featured
See All Featured
The Language of Interfaces
destraynor
162
27k
Product Roadmaps are Hard
iamctodd
55
13k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
Amusing Abliteration
ianozsvald
1
350
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Typedesign – Prime Four
hannesfritz
42
3.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
500
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
410
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Transcript
ӣక AppSync ܳ ഝਊೠ ܻఋ ࢲߡܻझ ইఃఫ
ߊ ࣗѐ • Solutions Architect, Classmethod (ੌࠄ) • Front-end, Back-end,
Android, iOS, Machine Learning, Computer Vision, etc • ୭Ӕ 1֙р AWS ࠙ঠীࢲ ޙࢿਸ ऺӝਤ೧ Ҋҵ࠙ై • Serverless on AWS, ؊ աইоࢲ Builder on AWS ܳ ೱೞݴ ழܻযܳ ऺח • য়ט ੑפ!!!! AWSKRUG ٜ࠙җ ݆݆ ҮܨೞҊ रणפ!!!!ƃƃ https://dev.classmethod.jp/author/kim-taewoo/ ೠҴয & ੌࠄয ӝࣿ࠶۽Ӓ
ࢲߡܻझ ইఃఫ ౠী ೧ рױ غযࠇद
ࢲߡܻझ ইఃఫ ౠ • ҙܻೡ ࢲߡо হ (NoOps) • ਃೡ
ٸ݃ ਃೠ ࠗ࠙݅ ਃೠ ݅ఀ ࢎਊೡ ࣻ • ஹೊ ܻࣗझח Lambda ( Fargate) • Lambda ҃ ਵ۽ connection ਸ ਬೡ ࣻ হ
Ӓۢ ࢲߡܻझ ইఃఫ۽ח ܻఋ ӝמ ޅ ݅٘աਃ?
ٜ݅ ࣻ ભ!
How? API Gateway ীࢲ ਢࣗ ਗ API Gateway websocket
How? PubSub ழ֏࣌ ӝ߈ ࣛܖ࣌ ইפ݅ PubSub ࣛܖ࣌ب (ੌױ) оמ
It’s possible, but … • ۿূ٘৬ ߔূ٘ р ాनਸ ਤೠ
Data structure ܳ ೧ঠೞҊ • োೞ݅ ؘఠܳ Ҋ ߉ਸ ٸ Validation ب ਃೞҊ • োೞ݅ ߔূ٘৬ ۿূ٘ নஏীࢲ ѐߊ ܖযઉঠೞҊ • ౠ ߔূ٘ ஏ ֢۱ (࢚) ݆ ٜযцפ High Availability .. Reliability .. Scalability ..
AppSync ܳ ࢎਊೞݶ ݽٚѪ рױ೧פ!!
AWS AppSync • Strong typing ਵ۽ ੋ೧ Validation ٘ (Ѣ)
ࢤۚ оמ (GraphQL ౠ) • ܻఋ ాनਸ ਤ೧ࢲ ߔূ٘ীࢲ ೧ঠೡ Ѫ Subscription ਸ झః݃ী ࢶ೧ فח Ѫ ߆ী হ • ۿূ٘ ஏীࢲח AppSync SDK ա Amplify ܳ ࢎਊೞݶ рױ Subscription оמ
ܻఋ ؘఠ ాनਸ ਤೠ AppSync ইఃఫ
AppSync ܻఋ ইఃఫ Micro services Subscription Data Streaming Mutation Trigger
݃۽ ࢲ࠺झ Stream ਵ۽ࠗఠ Lambda ܻѢ Subscription Micro services Subscription
Data Streaming Mutation Trigger AppSync ܻఋ ইఃఫ ࠗ࠙ য়ט ߊ ೨ब
ࢲߡܻझ झܻ߁ ইఃఫ
DynamoDB Streams → Lambda
DynamoDB Streams → Lambda • ഋੋ ࢲߡܻझ ؘఠ झܻ߁ ಁఢ
ೞա • Eventual Consistency Event-driven processing ١ਸ ܻೞӝী • ScalableɾReliableɾCost Effective • ߽۳بо ݒ ֫ সী ೧ࢲח पदрࢿਸ ࠁೞ ঋਵ۽ Kinesis DS о જ
RDS → DMS → Kinesis → Lambda
RDS → DMS → Kinesis → Lambda • RDS ܳ
ࢎਊೠ ҃ীب झܻ߁ ܻо оמೣ • Kinesis Data Streams ח ࢥ٘ܳ ஶ܀ ೡ ࣻ যঠ ೣ • Kinesis Data Streams ীࢲ Ҷ Lambda ۽ ো҅ೡ ਃח হ • Ӓ۞ա ࠄ ߊ ݾ (AppSync ো҅) ਸ ਤೠ ਊب۽ח Lambda ۽ ࠙ • DB (MySQL, PostgreSQL ١) ਵ۽ ࠗఠ Lambda ܳ प೯दఃח ߑߨب ઓ
ӝఋ ߮ ࣗझ
• SQS ীࢲ Lambda ۽ ো҅غח ಁఢ • Kinesis ীࢲ
Lambda ۽ ো҅غח ಁఢ • API Gateway ীࢲ Lambda ۽ ো҅غח ಁఢ • CloudWatch Alarms ীࢲ Lambda ۽ ো҅غח ಁఢ • CloudWatch Events ীࢲ Lambda ۽ ো҅غח ಁఢ • Ӓ ৻ীب ޖࣻ ݆ ӝఋ ߮ ࣗझ
Lambda ۽ ؘఠܳ ߉ই৳ਵݶ рױೞભ!
Lambda → AppSync
ؘݽ ۽ં ইఃఫ
ؘݽ ইఃఫ Microservice DynamoDB Subscription द۽ ࢎਊೡ AppSyncਊ DB Mutation
DynamoDB Streams
Microservice • API Gateway → Lambda → DynamoDB ҳࢿ •
о ݆ ॳח ࢲߡܻझ ইఃఫ API ߔূ٘ ಁఢ • рױೠ ੑ۱ ಬਸ ܻೞח ࢲ࠺झܳ ۽ ٜয ؘݽ٘ ࢿ
AWS AppSync • AppSync ҳ୷दীח Serverless Framework ܳ ୶ୌ •
Subscription ܳ झః݃ী ୶оೞח Ѫ݅ਵ۽ ۄ ஏীࢲ Subscription оמ ( ߔূ٘ সߊࢤ X ) • ਃೠ ӝמ Mutation җ Subscription ࡺ݅, Query ܳ झః݃ী ١۾ೞ ঋਵݶ GraphQL झః݃ ী۞о غ۽ рױೠ ௪ܻ ೞաܳ ୶о೧ঠೣ (getOrder ࢿ) • Mutation ೞӝ ਤ೧ࢲ DynamoDB ܳ ؘఠ ࣗझ۽ࢲ ࢤࢿೞҊ, TTL (Time-To-Live) ܳ ࢸೠ. (expiresAt ܳ AWSTimestamp ఋੑਵ۽ ࢶೠ)
DynamoDB Streams → Lambda • DynamoDB Streams ח ୭ 24
दр ؘఠ ࠁઓ, ؘఠ ߸҃ ࣽߣ ࠁૐоמೠ ࢲ࠺झ • Ӓ۞ա ܻఋ ࢲ࠺झীࢲח ୭ 24दр ؘఠ ࠁઓ ߹ о হӟ פ. • ߽۳بܳ ֫۰ݶ ߓ ࢎૉܳ ઑೞݶ ؽ
Lambda → AppSync • पࢲ࠺झਊਵ۽ ܾܻૉػ AppSync Client SDK ח
javascript ߡ ࡺ (Amplify ܳ ӂ) • AppSync Client SDK ܳ Lambda ࢚ীࢲ زदఃӝ ਤ೧ࢲח ݻо • ismorphic-fetch ܳ ನ ೧ঠೣ • disableOffline ܳ true ۽ ߸҃೧ঠೣ
DEMO TIMEʂ
None
٘ܳ ೠߣ ಝࠅөਃ https://github.com/twkiiim/serverless-tutorials/tree/master/realtime-stream-with-appsync
AppSync Subscription ী ೞৈ
AppSync WebSockets MQTT over WebSockets WebSockets (NEW) Payload Size 128Kb
240Kb CloudWatch Metrics X O Selection Set Filtering X O Enhanced Connection Rates X O Enhanced Broadcast Rates X O https://aws.amazon.com/jp/blogs/mobile/appsync-realtime/
re:Invent 2019 Builders Fair ীࢲ ࣗѐػ Smart Chair
42
AppSync ী ೧ ؊ ঌҊ रݶ?
AppSync ҙ۲ ࠶۽Ӓ • AWS ੑޙ ࠶۽Ӓ – AppSync ಞ
(ೠҴয) https://dev.classmethod.jp/cloud/aws/aws-appsync-re-introduction-2019-korean-ver/
AppSync ҙ۲ ࠶۽Ӓ • [AppSync ѐ֛ܻ] AWS AppSync ߂ Resolver
Mapping Template ী ೧ ѐ֛ਸ ܻ೧ࠇद! https://dev.classmethod.jp/cloud/appsync-resolver-vtl-tutorial-ko/
AppSync ҙ۲ ࠶۽Ӓ • [AWS AppSync] ΤοδσόΠεͷσʔλΛ AWS IoTܦ༝Ͱऔಘͯ͠GraphQLΛߋ৽ͯ͠Έ·ͨ͠ɻ https://dev.classmethod.jp/cloud/aws-appsync-with-awsiot/
AppSync ҙ۲ ࠶۽Ӓ • [AWS AppSync] ΤοδσόΠεͷσʔλΛ AWS IoTܦ༝Ͱऔಘͯ͠GraphQLΛߋ৽ͯ͠Έ·ͨ͠ɻ https://dev.classmethod.jp/cloud/aws-appsync-with-awsiot/
AppSync ۽ ۠Ѫب غ ঋਸө?
State Management by AppSync • ࢲߡܻझ ইఃఫ ಁఢীࢲח Rich Client
ܳ ೱ • Ӓ۞ա ۿূ٘ ٘ ࠂبо աѱ ૐоೞחѪ જ ঋ • ۿূ٘ ٘ ࠂب ࢚ࠗ࠙ী ӝৈೞח State Management • State Management ܳ بੑೞӝ ਤೠ ٘ ࠂبܳ AppSync Subscription ী ઓ ೧ࢲ ೧Ѿೡ ࣻب ঋਸө? • ֎ਕ ࣘب/উࢿ ١ী ઓࢿ ࢤӣ. • Ӓ۞ա 5G दীח ޙઁח হ ঋਸө?
State Management by AppSync • ࢲߡܻझ ইఃఫ ಁఢীࢲח Rich Client
ܳ ೱ • Ӓ۞ա ۿূ٘ ٘ ࠂبо աѱ ૐоೞחѪ જ ঋ • ۿূ٘ ٘ ࠂب ࢚ࠗ࠙ী ӝৈೞח State Management • State Management ܳ بੑೞӝ ਤೠ ٘ ࠂبܳ AppSync Subscription ী ઓ ೧ࢲ ೧Ѿೡ ࣻب ঋਸө? • ֎ਕ ࣘب/উࢿ ١ী ઓࢿ ࢤӣ. • Ӓ۞ա 5G दীח ޙઁח হ ঋਸө? Let’s discuss together!
хࢎפ