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.5k
いまあるチームにフィットさせる 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
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
460
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
610
いまあるチームにフィットさせる Serverless / Serverless fits in with the team you have now.
seike460
PRO
2
140
地方こそサーバーレス! チームにフィットさせるサーバーレス / Rural areas are serverless! Serverless to Fit Your Team
seike460
PRO
1
92
AWS X-Rayを利用したサーバーレスのパフォーマンス分析 / Serverless performance analysis using AWS X-Ray
seike460
PRO
2
140
Cloudflare Workers x AWS Lambdaの組み合わせユースケース / Cloudflare Workers x AWS Lambda Combination Use Case
seike460
PRO
2
430
技術力を高め合う “開けた”企業間コミュニティの形成 / Formation of an "open" inter-company community to enhance technological capabilities
seike460
PRO
1
81
有効な使い方を正しく理解して実装する PHP8.3の最新機能の「ウラ側」 / Understanding and Implementing Effective Usage Correctly The "Uraside" of PHP 8.3's Latest Features
seike460
PRO
1
130
有効な使い方を正しく理解して実装する PHP8.3の最新機能 / Proper understanding and implementation of effective usage Latest features in PHP 8.3
seike460
PRO
2
350
Other Decks in Programming
See All in Programming
データサイエンスのフルサイクル開発を実現する機械学習パイプライン
xcnkx
2
500
선언형 UI를 학습할 때 알아둬야하는 키워드들
l2hyunwoo
0
140
GitHub Copilot Workspace で我々のアプリ開発がどう変わるのか?
shuyakinjo
0
940
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
1.2k
dbt-ga4パッケージを実業務に導入してみた話
t_tokumaru_feedcorp
0
130
◯◯エンジニアになった理由
gessy0129
PRO
0
650
Subclassing, Composition, Python, and You
hynek
3
170
個人開発で使ってるやつを紹介する回
yohfee
1
700
CSC509 Lecture 04
javiergs
PRO
0
140
デバッグの話 / Debugging for Beginners
kaityo256
PRO
6
480
学生の時に開催したPerl入学式をきっかけにエンジニアが組織に馴染むために勉強会を主催や仲間と参加して職能間の境界を越えていく
ohmori_yusuke
1
130
DevFest Android in Korea 2024 - 안드로이드의 문단속 : 앱을 지키는 암호화 이야기
mdb1217
1
160
Featured
See All Featured
Producing Creativity
orderedlist
PRO
341
39k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Learning to Love Humans: Emotional Interface Design
aarron
272
40k
How To Stay Up To Date on Web Technology
chriscoyier
787
250k
Docker and Python
trallard
40
3k
How GitHub (no longer) Works
holman
311
140k
How to Think Like a Performance Engineer
csswizardry
16
1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
25
660
Designing the Hi-DPI Web
ddemaree
280
34k
Done Done
chrislema
181
16k
Infographics Made Easy
chrislema
239
18k
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/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠