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
What is Serverless. Why is Serverless.
Search
堀家隆宏
January 24, 2019
Programming
1
59
What is Serverless. Why is Serverless.
堀家隆宏
January 24, 2019
Tweet
Share
More Decks by 堀家隆宏
See All by 堀家隆宏
オープンソースコミュニティで加速するサーバーレスの未来/serverless will be
horike37
4
700
auth0-meetup.pdf
horike37
1
250
What’s happening with Serverless Framework, and it lives with AWS SAM.
horike37
0
80
aws-with-functional-saas
horike37
2
160
serverless-with-oss
horike37
0
110
slsconftokyo
horike37
0
5.3k
slsconfworkshop
horike37
3
2.5k
Test Driven Development For Lambda
horike37
2
290
serverless-kyoto
horike37
1
150
Other Decks in Programming
See All in Programming
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
890
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
610
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
Jakarta EE meets AI
ivargrimstad
0
600
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
160
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
Remix on Hono on Cloudflare Workers
yusukebe
1
280
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
580
RubyLSPのマルチバイト文字対応
notfounds
0
120
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
73
9.1k
Music & Morning Musume
bryan
46
6.2k
Bash Introduction
62gerente
608
210k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
We Have a Design System, Now What?
morganepeng
50
7.2k
Fireside Chat
paigeccino
34
3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Transcript
What is Serverless Why is Serverless
ࣗݾհ ງՈོ • Serverless Operations LLC • Serverless Framework Core
mainainer • Serverless Step Functions, Serverless Atom Dashbord ։ൃऀ • Serverless Champion powerd by Serverless.inc
ServerlessͱԿ͔ ͦͷຊ࣭ʹ͍ͭͯ ղઆ͍͖ͯ͠·͢
• ٛͳҙຯͰ͍͏ͱαʔόʔίϯςφͷཧ͕ෆཁͳαʔϏεΛར༻ͨ͠ ΓɺͦΕΒΛ׆༻ͯ͠ΞϓϦέʔγϣϯΛͭͬͨ͘Γ͢Δߟ͑ํͱੈք؍ • ͜͜Ͱ͍͏ServerlessͱɺAWS LambdaͷΑ͏ͳFunction as a Serviceͱ ϚωʔδυαʔϏεͰߏ͞ΕͨγεςϜΞϓϦέʔγϣϯΛҙຯ͢Δ
ServerlessͱԿ͔ʁ 2014ʹAWS Lambda͕ొ͠ɺΫϥυͷΞʔΩςΫςΟϯάͷ෯͕ େ͖͕ͬͨ͘ɻ·ͨɺAPI GatewayKinesis, AWS IoTͳͲͷొʹΑΓ Ϋϥυͷ֎෦ͱͷσʔλ࿈ܞ͕༰қʹͳͬͨ
• αʔόίϯςφͳͲͷΠϯϑϥετϥΫνϟΛཧ͢Δ࡞ۀ͔Β։์͞Ε Δ • ίετͷ࠷దԽɻଟ͘ͷ߹҆͘ͳΔ • Ϋϥυͷ੍Լʹ͓͍ͯແݶͷεέʔϥϏϦςΟΛੜΉɻجຊతʹࣄલ ͷΩϟύγςΟ༧ෆཁ Serverlessͷ͍ΘΏΔϝϦοτ Ϋϥυʹ͜ΕΒΛΞτιʔε͢Δ͜ͱͰӡ༻ͰָΛ͢Δ
Serverless Overview
• AWS Lambda, Azure Functions, Google Cloud Functionsͱ͍ͬͨΞϓϦέʔ γϣϯίʔυΛ࣮ߦͯ͘͠ΕΔαʔϏε •
ঢ়ଶͷมԽʹΑΓΠϕϯτ͕ൃੜ͢Δ͜ͱͰίʔυ͕࣮ߦ͞ΕΔ • ಉ࣮࣌ߦͷ੍Լʹ͓͍ͯແݶʹεέʔϦϯά͢Δ(εέʔϦϯάͷࣄલ ༧ଌ͕ෆཁ) • ՝͕ۚίʔυͷ࣮ߦ࣌ؒ୯Ґ(ଟ͘ͷέʔεͰ҆͘ͳΔ) • ϛυϧΣΞͷΞοϓσʔτෆཁ(αʔόཧ͔Βͷ։์) Function as a Service
• DynamoDB, API gateway, Auth0, Stripeͱ͍ͬͨػೳͷΈΛఏڙͯ͘͠ΕΔ αʔϏε • ServerlessͷੈքͰ͜ΕΒΛFaaSΛؔͱݺͿ͜ͱͱରൺͯ͠ϛυϧΣ ΞͱݺΜͰΔ
Functional SaaS / BaaS
FaaSʹΑΔίʔυͷ࣮ߦڥͱ Functional SaaSʹΑΔػೳͷఏڙ γϯϓϧʹߟ͑Δͱ͜ͷ2ͭͷཁૉͰ ServerlessΞʔΩςΫνϟΓཱͭ
FaaSͷಛੑ
ΠϕϯτυϦϒϯͰ͋Γ ඇৗறܕͰ͋Δ͜ͱΛ೦಄ʹஔ͍ͨ ϓϩάϥϛϯάϞσϧͱͳΔ
• FaaSͷલஈʹ͋ΔαʔϏε্Ͱͷঢ়ଶͷมԽʹΑΓίʔυ͕࣮ߦ͞ΕΔ • PublisherͱSubscriberͱ͍͏ؔੑ • αʔόʔ্ͷมߋΛϙʔϦϯάͯ͠ݕ͢Δͷͱਅٯͷߟ͑ ΠϕϯτυϦϒϯͱ putObject Event trigger
• Πϕϯτ͕ൃੜͯ͠ίʔυ͕࣮ߦ͞ΕΔͱ͖ͷΈϓϩηε͕ଘࡏ͢Δ • ಥવϓϩηε͕མͪΔͱ͍͏͜ͱͳ͍ͨΊɺͦͷҙຯͰݎकͳγεςϜ ʹͰ͖Δ ඇৗறܕͱ
• Πϕϯτ͕ൃੜͨ࣌͠ͷΈϓϩηεΛىಈͤ͞Εྑ͍ͷͰৗʹϓϩηεΛ ্ཱ͓ͪ͛ͯ͘ඞཁ͕ͳ͍ɻΠϕϯτυϦϒϯ͔ͩΒͦ͜ඇৗறͳϓϩηε ͷΈ͕Γཱͭ • ϓϩηε͕ৗʹଘࡏ͍ͯ͠ΔΘ͚Ͱͳ͍ͨΊɺFunctionͰσʔλͷอ࣋ Λલఏͱ࣮ͨ͠Ͱ͖ͳ͍ɻͭ·ΓࣗવͱεςʔτϨεͳঢ়ଶͱͳΔɻ݁ ՌɺεςʔτΛ࣋ͨͳ͍͜ͱͰεέʔϥϏϦςΟΛ࣮ݱͰ͖Δ • Πϕϯτ͕ൃੜͨ࣌͠ͷΈϓϩηεΛىಈͤ͞Εྑ͍ͷͰɺ࣮ߦ࣌ؒʹͷ
Έ՝ۚ͢Εྑ͍ͱ͍͏࠷దԽ͕Γཱͭ ΠϕϯτυϦϒϯͱඇৗற͕ ͨΒ͢ϝϦοτ ͜ΕΒͷ੍݅ʹΑΓFaaSͷϝϦοτ͕ ࠷େݶ׆͔ͤΔΈʹͳ͍ͬͯΔ
Functional SaaSͷಛੑ
ެࣜͷυΩϡϝϯτΛಡΜͰਖ਼͘͠ ཧղͷ্ͰɺదࡐదॴͰར༻͠ɺͦ ͷ੍݅ԼͰ࠷େݶͷੑೳΛҾ͖ ग़ͯ͠Δ͜ͱ͕େࣄ
Kinesis Stream • େྔͷσʔλετϦʔϜΛϦΞϧλΠϜͰऩूͯ͠ɺॲཧΛͤ͞ΔͨΊͷα ʔϏε • ͨ͘͞ΜͷIoTσόΠεͷόοΫΤϯυͷड͚ޱͱͯ͠ར༻͞ΕΔέʔε͕ଟ ͍ • ड͚औͬͨσʔλBatch
sizeͷ୯ҐͰLambda͕ड͚औΓɺޙଓͷॲཧΛ࣮ ࢪ͢ΔɻKinesisͰγʔέϯεׂ͕ΓৼΒΕΔ͜ͱͰॱংอূ͋Δɻྻ ʹσʔλΛॲཧ͍ͤͨ࣌͞ʹKinesisΛڬΉ
DynamoDB • ϚωʔδυܕͷNo SQLσʔλϕʔεɻେྔͷϫʔΫϩʔυͷσʔλΛӬଓ Խͤ͞Δͷʹ͍͍ͯΔ • Partition KeyʹΑΔશҰகͱIndexʹΑΔ୳ࡧ͕Մೳ • ύϑΥʔϚϯεΛ࠷େʹͯ͠εϧʔϓοτίετΛ࠷খʹ͢ΔͨΊʹϓϥΫ
ςΟεʹԊͬͨςʔϒϧઃܭ͕ඞཁͱͳΔ ɹɾΩʔͷϋογϡͰPartition͕ࢄ -> ۉʹͳΔΑ͏ͳΩʔઃܭ ɹɾεΩʔϚϨεDBɻεΩʔϚ͝ͱʹςʔϒϧΛ͚Δͱ͍͏ൃ͕ ɹɹͦͦͳ͍ɻΩϟύγςΟཧͷͨΊʹςʔϒϧΞϓϦέʔγϣϯ ɹɹͰ1ͭʹ͢Δ͜ͱ͕ཧཧ
API Gateway • ։ൃऀ͕ API Λ࡞ɺɺอकɺࢹɺอޢͰ͖ΔαʔϏε • SPAͰWebΞϓϦέʔγϣϯΛ։ൃ͢Δ߹ͷόοΫΤϯυAPIͱͯ͠Θ ΕΔέʔε͕Α͋͘Δ •
جຊతʹ֎෦͔ΒͷೖྗͷೖΓޱͱͯ͠ɺ1ର1ͷؔੑͰσʔλΛѻ͏ɻ ೖྗνΣοΫͷલॲཧ͚ͩΛ࣮ࢪͯ͠ɺޙSNSDynamoDBʹܨ͙͜ͱ ͰޙଓͷॲཧΛ࣮ࢪͤ͞Δ
ΞʔΫςΫνϟͱͯ͠ͷಛੑ
ΠϕϯτυϦϒϯΞʔΩςΫνϟ Service Function Service Function Function Event Event ΠϕϯτυϦϒϯͳϓϩάϥϛϯάϞσϧͱͳΔ͜ͱʹΑΓ ࣗવͱΠϕϯτ͕चͭͳ͗ʹൖ͍ͯ͘͠ΞʔΩςΫνϟͱͳΔ
Service Service
AWSͷαʔϏεʹஔ͖͑Δͱ ͜Μͳײ͡ API Gateway Lambda SNS DynamoDB
ΠϕϯτυϦϒϯΞʔΩςΫνϟ Publisher Subscriber Event • جຊతʹPublisherͱSubscriberؒͰϝοηʔδΛૹड৴͢Δؔੑ • Publisher͕ࣗૹ৴͢ΔΠϕϯτͷ͜ͱ͔͠Βͳ͍ • Subscriber͕ࣗͲͷΠϕϯτΛड͚औΔ͔͔͠Βͳ͍
• ͜ΕʹΑΓγϯϓϧʹૄͷؔੑΛอͭ
ΠϕϯτυϦϒϯΞʔΩςΫνϟ Կ͕خ͍͠ͷ͔
ΠϕϯτͷSubscriberͱPublisherͷؔੑΛมߋ͢Δ͜ͱͰ γϯϓϧʹػೳՃมߋ͕࣮ݱͰ͖Δ Service Function Service Function Function Event Event ৽ػೳ
Կ͕خ͍͠ͷ͔ ৽ػೳ
Service Function Function Event Function Function Service Service Function Service
جຊతʹґଘؔૄͰ͋ΓͭͭҰํʹू͞ΕΔͨΊɺ σʔλͷྲྀΕͷݟ௨͕͠ඇৗʹྑ͘ͳΔ Կ͕خ͍͠ͷ͔
֤αʔϏεͷ੍݅ԼͰ࣮Λߦ ͏͜ͱͰࣗવͱϚΠΫϩαʔϏεΞ ʔΫςΫνϟͷϝϦοτΛڗडͰ͖ ΔΑ͏ʹͳΔ
·ͱΊ
·ͱΊ • ServerlessΞʔΩςΫνϟ୯७ʹFaaSͱFunctional SaaSͷΈ߹ΘͤͰ ͳΓ͍ͨͬͯΔ • FaaSͱFunctional SaaSͷ੍ࣄ߲Λਖ਼͘͠ཧղͯ͠దࡐదॴͰ͏ɻ੍ ੍ݶͰͳ͍ɻͦͷ੍ʹै͏͜ͱͰ࠷େݶͷੑೳΛൃشͰ͖Δͱ͍͏͜ ͱ
• ServerlessΞʔΩςΫνϟෳࡶͰͳ͍ɻΉ͠Ζมߋʹڧ͘σʔλͷྲྀΕ ͕͔Γ͘͢ͳΔɻϚΠΫϩαʔϏεͷϝϦοτΛਖ਼͘͠ڗडͰ͖Δ
Thank You