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
いまあるチームにフィットさせる Serverless そして Platform Enginee...
Search
shiro seike
PRO
September 21, 2024
Programming
2
1.9k
いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering
ServerlessDays Tokyo 2024
https://tokyo.serverlessdays.io
shiro seike
PRO
September 21, 2024
Tweet
Share
More Decks by shiro seike
See All by shiro seike
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
250
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical Serverless Performance Tuning ~A Close Look at its Power~
seike460
PRO
2
320
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
560
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
700
いまあるチームにフィットさせる Serverless / Serverless fits in with the team you have now.
seike460
PRO
2
170
地方こそサーバーレス! チームにフィットさせるサーバーレス / Rural areas are serverless! Serverless to Fit Your Team
seike460
PRO
1
110
AWS X-Rayを利用したサーバーレスのパフォーマンス分析 / Serverless performance analysis using AWS X-Ray
seike460
PRO
2
170
Cloudflare Workers x AWS Lambdaの組み合わせユースケース / Cloudflare Workers x AWS Lambda Combination Use Case
seike460
PRO
2
500
Other Decks in Programming
See All in Programming
subpath importsで始めるモック生活
10tera
0
300
初めてDefinitelyTypedにPRを出した話
syumai
0
400
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
RubyLSPのマルチバイト文字対応
notfounds
0
120
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
EventSourcingの理想と現実
wenas
6
2.3k
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
C++でシェーダを書く
fadis
6
4.1k
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
150
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
The Invisible Side of Design
smashingmag
298
50k
Designing Experiences People Love
moore
138
23k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Facilitating Awesome Meetings
lara
50
6.1k
RailsConf 2023
tenderlove
29
900
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Practical Orchestrator
shlominoach
186
10k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Transcript
©Fusic Co., Ltd.  1 ͍·͋ΔνʔϜʹϑΟοτͤ͞Δ Serverless ͦͯ͠ Platform Engineeringͷઓ
2024.09.22 @seike460 ServerlessDays Tokyo 2024
©Fusic Co., Ltd. 2 ਗ਼Ո ࢙ @seike460 AWS Community Builder
Serverless ίϛϡχςΟ Serverless Meetup Fukuoka Cloudflare Meetup Fukuoka Fukuoka.php Fukuoka.go JAWS-UG Fukuoka JP_Stripes Fukuoka JBUG Fukuoka ࣗݾհ ͡Ίʹ גࣜձࣾFusic ϓϦϯγύϧΤϯδχΞ/ΤόϯδΣϦετ
©Fusic Co., Ltd. 3 CONTENTS ࣍ 1. Serverless Ͱ͋Δ։ൃΛৼΓฦΔ 2.
Serverless ద༻͠ଓ͚ͨՁͱݱ࣮ 3. νʔϜʹϑΟοτͤ͞ΔServerless 4. νʔϜͱServerlessΛܨ͙ͨΊͷPlatform Engineeringͷઓ 5. ·ͱΊ
©Fusic Co., Ltd. 4 Serverless Ͱ͋Δ։ൃΛৼΓฦΔ 1
©Fusic Co., Ltd. 5 ServerlessͱͳΜͳͷ͔ Serverless 言 Cloud Native Computing
Foundation CNCF Serverless Whitepaper v 1 . 0 行 https://github.com/cncf/wg-serverless/tree/master/whitepapers/serverless-overview
©Fusic Co., Ltd. 6 Serverlessͷ֓೦ΛऔΓೖΕΔϝϦοτଟ Serverless Architecture 入 入 入
大 小 Serverless Serverless Architecture 用 行
©Fusic Co., Ltd. 7 ServerlessΒ͠͞ Serverlessͱ֓೦Ͱ͋Γɺ ͜ͷαʔϏεServerlessͰ͋ΔɺServerlessͰͳ͍ͱ͍͏ٞࣗମ ࣮ߦ͏ඞཁ͕ͳ͍ͷ͔͠Εͳ͍ େࣄͳͷServerlessͱ͍͏֓೦ͷཧղΛਂΊ ʮServerlessΒ͠͞ͷਖ਼ମΛ௫Ή͜ͱʯ
©Fusic Co., Ltd. 8 ServerlessΒ͠͞ͷਖ਼ମʁ ServerlessΩϟογϡͰ༗໊ͳmomentoʹΑΔදݱ 1. ϓϩϏδϣϯෆཁɺཧෆཁ 2. ࠷ྉۚͷͳ͍͚ͬͨͩͷࢧ͍
3. 1 ͭͷ API ݺͼग़͠Ͱར༻Մೳ 4. ܭըఀࢭ͕ͳ͍ 5. Πϯελϯε͕ͳ͍ Serverlessͷಛଊ͓͑ͯΓڌΓॴʹͯ͠ྑ͍ͱࢥ͏͕ ݸਓతͳҙࣝͱͯ͠ʮ͑ͩͱߟ͑Δඞཁͳ͍ʯ ServerlessΒ͍͠αʔϏεΞοϓσʔτ͞Ε͍ͯ͘͠ɺ ৽͍֓͠೦ͷՃʹΑΓServerlessΒ͠͞มΘ͍ͬͯ͘
©Fusic Co., Ltd. 9 ServerlessΒ͋͘͠Ζ͏ͱ͢Δ Serverlessͱ͍͏ͷʮ͜Ε͚͕ͩServerlessͰ͋Δʯͱ͍͏ͷͰͳ͍ͱࢥ͍ͬͯ·͢ ࠓճ͜ͷServerlessͷ֓೦ΛऔΓೖΕΑ͏ͱઓ͠ଓ͚ͯఏڙ͖ͯͨ͠Ձͱڞʹ ͦͷதͰݟ͖͑ͯͨ։ൃऀʹΛ͚ͯʮνʔϜʹϑΟοτͤ͞Δʯ͜ͱΛߟ͑ͨ ઓͷΛ͖ͤͯ͞·͢
©Fusic Co., Ltd. 10 Serverless ద༻͠ଓ͚ͨݱ࣮ 2
©Fusic Co., Ltd. 11 ฐࣾͷٕज़ελοΫ PHPɺRubyɺͦͯ͠AWSΛத৺ͱͨ͠डୗ։ൃΛओʹߦ͍ͬͯ·ͨ͠ ࣗࣾϓϩμΫτPHPͰ։ൃ͓ͯ͠Γɺٕज़ελοΫͱͯ͠PHPΓͤͳ͍ͷ ҰํͰPHPAWS LambdaͷެࣜϥϯλΠϜ͕ଘࡏ͠ͳ͍ɺϛεϚον͕͋ͬͨ ͦΜͳதServerlessͷՁΛײͯ͡ɺಋೖΛଓ͚·ͨ͠
©Fusic Co., Ltd. 12 ServerlessͳAPIΛՃՁͱͯ͠Ճ EC 2 Web API Web
API API Gateway -> Lambda -> S 3 Json EC 2 cron Web 大 200 用
©Fusic Co., Ltd. 13 ServerlessͳAPIΛՃՁͱͯ͠Ճ 一見 Web 自 Serverless API
自 行 小 Python 行 Go
©Fusic Co., Ltd. 14 ݴޠʹΑΒͳ͍ServerlessͳαΠτߏங 0 力 用 Serverless
©Fusic Co., Ltd. 15 ݴޠʹΑΒͳ͍ServerlessͳαΠτߏங AWS Amplify 用 AWS Amplify
GraphQL AWS AppSync 用 AWS Configuration GraphQL Serverless 行 AWS Amplify ( 自 )
©Fusic Co., Ltd. 16 ϥϯλΠϜͱͷϛεϚον ࣮֬ʹServerlessͷԸܙײ͍ͯͨ͡Ұํɺ ಋೖ͢Δ͜ͱͰϝϯςφʔ͕গͳ͍ϓϩδΣΫτΛ૿͍ͯ͠ΔΑ͏ͳײ֮͋Γ·ͨ͠ ٯʹRubyͷνʔϜʹؔͯ͠ɺެࣜϥϯλΠϜ͕͋ΔͨΊ͔ Serverless͕গͣͭ͠ਁಁ͍ͯͨ͠ ࣾͷٕज़ελοΫͰ͋ΔPHPͱAWS
LambdaͷϥϯλΠϜͱͷϛεϚονͱ Serverlessͱ͍͏࣮ߦڥʹର͢Δೝෛՙ͕૾Ҏ্ʹେ͖͍ͷΛ࣮ײ࢝͠Ί͍ͯͨ
©Fusic Co., Ltd. 17 ServerlessΛద༻͢Δ͜ͱѱͳͷ͔
©Fusic Co., Ltd. 18 ඪΛݟ͢ 目 Serverless 入 用 Serverless
©Fusic Co., Ltd. 19 νʔϜʹϑΟοτͤ͞ΔServerless 3
©Fusic Co., Ltd. 20 PHPΛAWS Lambda্Ͱ͏͜ͱΛݕ౼ PHPΛಋೖ͢Δ͜ͱΛ2018͋ͨΓ͔Βݕ౼Λ࢝Ί͍ͯͨ ΧελϜϥϯλΠϜ͕ൃද͞ΕͨཌͷPHP Conference 2019ͷࢿྉʹͯ
ʮAWS LambdaΛPHPʹͯ͏ͨΊʹʯͱ͍͏ͱ͜ΖΛௐ͍ͯͨ
©Fusic Co., Ltd. 21 Laravel + Bref on AWS Lambda
ฐࣾͷจԽͱ͍͍ͯࠜͯ͠ΔPHP WebFrameworkͷLaravel AWSͱͷ૬ੑ͕ඇৗʹྑ͘ɺ .envʹAWSͷύϥϝʔλʔΛઃఆ͢Δ͚ͩͰAWSΛ্खʹѻ͏ࣄ͕Մೳ PHPͷOSSϓϩδΣΫτͰ͋ΔBref AWS Lambda্ͰPHPΞϓϦέʔγϣϯΛ؆୯ʹσϓϩΠͱཧΛՄೳʹ͢Δπʔϧ ͜ΕΒΛΈ߹ΘͤɺνʔϜͷٕज़ελοΫʹϑΟοτͤ͞Δ͜ͱ͕ॏཁͩͱߟ͑·ͨ͠
©Fusic Co., Ltd. 22 PHPΛAWS Lambda্ͰϓϩμΫγϣϯར༻Λ࣮ݱ AWS Dev Day 2022ʹͯϑϧServerlessʹͯఏڙ͍ͯ͠ΔαΠτͷΛ͠·ͨ͠
PHP+Laravelͱ͍͏ٕज़ελοΫʹϑΟοτͤ͞Δ͜ͱͰνʔϜͰಋೖͰ͖ͨࣄྫ https://speakerdeck.com/seike460/serverless-high-load-site-realized-with-amazon-s3-select
©Fusic Co., Ltd. 23 ͦͷޙผͷνʔϜͰಋೖ͢Δ͜ͱͰ͖ͨ AWS Lambda x PHPʹͯएखͷϝϯόʔ͕ߏங Laravelͷࣝ͋ͬͨҝɺීஈͷߏஙͷΑ͏ʹ
ࣗҎ֎ͷϝϯόʔʹߏஙͤ͞Δ͜ͱ͕Ͱ͖ͨ ϕʔε͑͞ߏஙग़དྷΕνʔϜͰͷಋೖͱӡ༻Մೳ
©Fusic Co., Ltd. 24 ҰํͰ
©Fusic Co., Ltd. 25 LambdaͷϞϊϦε Amazon Web Services ϒϩάͷʮOperating Lambda:
ΠϕϯτۦಈܕΞʔΩςΫνϟʹ͓͚ΔΞϯνύλʔϯ – Part 3ʯ ҎԼͷΑ͏ʹ৮ΕΒΕ͍ͯ·͢ɻ -LambdaͷϞϊϦε -ύοέʔδαΠζ -࠷খݖݶΛద༻͢Δͷ͕͍͠ -ΞοϓάϨʔυ͕ࠔ -อक͕ࠔ -ҎԼ֘͠ͳ͍ -ίʔυͷ࠶ར༻͕͍͠ɿLaravelಘҙ -ςετ͕͍͠ɿLaravelಘҙ ࢀߟURL:https://aws.amazon.com/jp/blogs/news/compute-operating-lambda-anti-patterns-in-event-driven-architectures-part-3/ Operating Lambda: ΠϕϯτۦಈܕΞʔΩςΫνϟʹ͓͚ΔΞϯνύλʔϯ – Part 3
©Fusic Co., Ltd. 26 The Lambda monolith ࢀߟURL : https://docs.aws.amazon.com/lambda/latest/operatorguide/monolith.html
ʮThe Lambda monolithʯ
©Fusic Co., Ltd. 27 ServerlessͷՁΛνʔϜͰڗडग़དྷΔ ʮAWS Lambdaͱͯ͠ϕετͰͳ͍ ɹͰߏஙɺӡ༻·ͰؚΊͨΞϓϦέʔγϣϯͱͯ͠ ɹνʔϜͱͯ͠ϕετͩͬͨʯͱߟ͑·ͨ͠ νʔϜͷจԽͱͯ͠ServerlessΛड͚ೖΕΔ͜ͱ͕ग़དྷͨ
©Fusic Co., Ltd. 28 ಛੑΛཧղ͠ɺݒ೦ʹର͢ΔέΞߦ͍༕͍Λແ͘͢ ύοέʔδαΠζʹΑΔύϑΥʔϚϯεྼԽ -> దٓνϡʔχϯάɺܭଌʹΑΓͳ͍͜ͱΛ֬ೝ ࠷খݖݶͷద༻ ->
ಉ͡ϓϩάϥϜΛΤϯυϙΠϯτΛ͚ͯఏڙ͢Δ͜ͱͰରԠ functions: web: handler: public/index.php runtime: php- 82 -fpm timeout: 28 events: - httpApi: '*' admin-web: handler: public/index.php runtime: php- 82 -fpm timeout: 28 role: api-admin-role events: - httpApi: method: '*' path: /admin
©Fusic Co., Ltd. 29 Monolith First Serverless Development ࢀߟURL :
https://speakerdeck.com/_kensh/monolith-first-serverless-development?slide=55 @_kensh ʮMonolith First Serverless Developmentʯ
©Fusic Co., Ltd. 30 খنͳ։ൃͳΒLambdalithબࢶͱ͍͏هࣄ ࢀߟURL : https://rehanvdm.com/blog/should-you-use-a-lambda-monolith-lambdalith-for-the-api ʮShould you
use a Lambda Monolith, aka Lambdalith, for your API?ʯ
©Fusic Co., Ltd. 31 ServerlessͷՁΛఏڙ͢ΔνʔϜʹϑΟοτͨ͠ߏ
©Fusic Co., Ltd. 32 νʔϜͱServerlessΛܨ͙ͨΊͷ Platform Engineeringͷઓ 4
©Fusic Co., Ltd. 33 Platform Engineeringͱ ・ 用 目
©Fusic Co., Ltd. 34 CNCF Platforms White Paper Serverless CNCF
White Paper
©Fusic Co., Ltd. 35 Platform Engineering Platform Engineering Platform Engineering
Meetup Serverless Meetup Osaka 自
©Fusic Co., Ltd. 36 Platform Engineering On Serverless URL :https://speakerdeck.com/_kensh/platform-engineering-on-serverless
@_kensh
©Fusic Co., Ltd. 37 νʔϜτϙϩδʔ : ・ , ・ .
ʮϓϥοτϑΥʔϜ։ൃνʔϜͷʮअຐʹͳΒͳ͍ʯΑ͏ʹ͢Δɻ ɹ։ൃνʔϜ͕։ൃ͢Δ্Ͱͷલఏ݅ΛͳΔ͘গͳ͘͢Δͷͩɻʯ ɹɹɹɹɹɹɹɹɹ→ೝෛՙͷݮ - ετϦʔϜΞϥΠϯυνʔϜ - ಛఆͷػೳʹϑΥʔΧεͨ͠νʔϜ -ϓϥοτϑΥʔϜνʔϜ -ڞ௨ͷαʔϏεπʔϧΛఏڙ͢ΔνʔϜ
©Fusic Co., Ltd. 38 ίϯΣΠͷ๏ଇɺٯίϯΣΠͷ๏ଇ ίϯΣΠͷ๏ଇ ৫͕ઃܭ͢ΔγεςϜɺͦͷ৫ͷίϛϡχέʔγϣϯߏ͕ө͞ΕͨͷʹͳΔ ٯίϯΣΠͷ๏ଇ ·͍͠γεςϜΞʔΩςΫνϟΛ࣮ݱ͢ΔͨΊʹɺ৫ߏΛͦΕʹ߹Θͤͯઃܭ͢Δ ΫϥυωΠςΟϒͳΞʔΩςΫνϟʹ߹Θͤͨ৫ߏʹมߋग़དྷΕΑ͍͕
ݱ࣮తʹࣗͷࡋྔͷൣғͰ৫ߏมߋ͍͕͔͔࣌ؒ͠͠Δ ίϯΣΠͷ๏ଇʹج͖ͮɺ৫ͷٕज़ελοΫ߹Θͤͨ ServerlessͳγεςϜΞʔΩςΫνϟΛఏڙ͢ΔPlatform EngineeringΛߟ͑Δ
©Fusic Co., Ltd. 39 AWSʹ͓͚ΔServerless Architectureͷදతͳߏ Serverless Architectureͷࣗવͳߏ ແཧʹͯΊΔ͜ͱೝෛՙʹܨ͕ΓServerlessͷਁಁʹܨ͕Βͳ͍
©Fusic Co., Ltd. 40 ฐࣾͷಘҙͳٕज़ελοΫΛΈ߹Θͤͨߏ ྨࣅͷฐ͕ࣾಘҙͳߏΛ࠶ߟ͢Δ ৫ߏɺνʔϜؒͷίϛϡχέʔγϣϯ͕ө͞Εͨೝෛՙ͕͍ߏ
©Fusic Co., Ltd. 41 Platform Engineering ͷEssenceͷద༻ ৫ߏɺίϛϡχέʔγϣϯ͕ө͞Εͨߏʹ Serverless ArchitectureଆΛϑΟοτͤ͞ʹ͍͘
ࠓ·Ͱഓͬͨݟͱฐࣾͷٕज़ελοΫΛ ༥߹ͤ͞ΔͨΊʹTiDB ServerlessΛ࠾༻ ΠϯλʔϑΣʔεͱͯ͠ɺ SQL͕͑Δ͜ͱͰࣗવʹ։ൃ͕Մೳ
©Fusic Co., Ltd. 42 ετϦʔϜΞϥΠϯυνʔϜͷ։ൃࣗવͳߏͰ ࠓ·Ͱͷ։ൃʹϑΟοτͤ͞ΔܗͰ։ൃڥΛDockerͰఏڙ Laravel + MySQL +
LocalStackΛར༻ͨࣗ͠વͳ։ൃߏ ҧײͷͳ͍ɺ͍ͭͷ։ൃମݧΛ࠶ݱ
©Fusic Co., Ltd. 43 ࢲୡͳΓͷPlatform Engineeringͷઓ ΞϓϦέʔγϣϯ։ൃऀ͕PlatformΛબͿ →ձࣾͷٕज़ελοΫʹ߹ΘͤͨPlatformΛඋͯࣗ͠વʹར༻ͯ͠Β͏ ࠓ·ͰServerlessͷ։ൃΛݗҾ͍ͯͨ͠ ͕ࣗࣗ։ൃʹҰՃΘΒͣਐḿ
Platform Engineering ͷతͷҰͭ ೝෛՙͷݮΛୡ
©Fusic Co., Ltd. 44 ϩάɺΨʔυϨʔϧɺCI/CDɺObservability URL :https://speakerdeck.com/_kensh/platform-engineering-on-serverless @_kensh ٕज़ελοΫʹ߹ΘͤPlatformΛඋ ߹ΘͤͯυΩϡϝϯςʔγϣϯߦ͏
ϩά CloudWatch Logs CI / CD GitHub Actions ServelessFramework ΨʔυϨʔϧ BiomeɺPHPStanɺPlaywright Dependabot Observability CloudWatchɺSentryɺSlack
©Fusic Co., Ltd. 45 νʔϜͱಉԽ͢ΔΑ͏ʹServerlessΛϑΟοτͤ͞Δ Serverless
©Fusic Co., Ltd. 46 αεςφϏϦςΟΛҙࣝͨ͠νʔϜͷద༻ ServerlessͷՁେ͖͍ ͨͩ͠νʔϜͷจԽΛແࢹͯ͠σϦόϦʔͷํ๏Λؒҧ͑Δͱ ଐਓԽͨ͠ෛͷҨ࢈ͱͳΔՄೳੑ͋Δ αεςφϏϦςΟΛҙࣝͨ͠ʮ͍·͋ΔνʔϜʹϑΟοτͤ͞ΔServerlessʯ
©Fusic Co., Ltd. 47 Thank You We are Hiring! https://recruit.fusic.co.jp/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠