Slide 1

Slide 1 text

©Fusic Co., Ltd.  1 ͍·͋ΔνʔϜʹϑΟοτͤ͞Δ Serverless ͦͯ͠ Platform Engineering΁ͷ௅ઓ 2024.09.22 @seike460 ServerlessDays Tokyo 2024

Slide 2

Slide 2 text

©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 ϓϦϯγύϧΤϯδχΞ/ΤόϯδΣϦετ

Slide 3

Slide 3 text

©Fusic Co., Ltd. 3 CONTENTS ໨࣍ 1. Serverless Ͱ͋Δ։ൃΛৼΓฦΔ 2. Serverless ద༻͠ଓ͚ͨՁ஋ͱݱ࣮ 3. νʔϜʹϑΟοτͤ͞ΔServerless 4. νʔϜͱServerlessΛܨ͙ͨΊͷPlatform Engineering΁ͷ௅ઓ 5. ·ͱΊ

Slide 4

Slide 4 text

©Fusic Co., Ltd. 4 Serverless Ͱ͋Δ։ൃΛৼΓฦΔ 1

Slide 5

Slide 5 text

©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

Slide 6

Slide 6 text

©Fusic Co., Ltd. 6 Serverlessͷ֓೦ΛऔΓೖΕΔϝϦοτ͸ଟ਺ Serverless Architecture 入 入 入 大 小 Serverless Serverless Architecture 用 行

Slide 7

Slide 7 text

©Fusic Co., Ltd. 7 ServerlessΒ͠͞ Serverlessͱ͸֓೦Ͱ͋Γɺ ͜ͷαʔϏε͸ServerlessͰ͋ΔɺServerlessͰ͸ͳ͍ͱ͍͏ٞ࿦ࣗମ ࣮͸ߦ͏ඞཁ͕ͳ͍ͷ͔΋͠Εͳ͍ େࣄͳͷ͸Serverlessͱ͍͏֓೦ͷཧղ౓ΛਂΊ ʮServerlessΒ͠͞ͷਖ਼ମΛ௫Ή͜ͱʯ

Slide 8

Slide 8 text

©Fusic Co., Ltd. 8 ServerlessΒ͠͞ͷਖ਼ମʁ ServerlessΩϟογϡͰ༗໊ͳmomentoʹΑΔදݱ 1. ϓϩϏδϣϯෆཁɺ؅ཧෆཁ 2. ࠷௿ྉۚͷͳ͍࢖ͬͨ෼͚ͩͷࢧ෷͍ 3. 1 ͭͷ API ݺͼग़͠Ͱར༻Մೳ 4. ܭըఀࢭ͕ͳ͍ 5. Πϯελϯε͕ͳ͍ Serverlessͷಛ௃ଊ͓͑ͯΓڌΓॴʹͯ͠΋ྑ͍ͱࢥ͏͕ ݸਓతͳҙࣝͱͯ͠͸ʮ౴͑ͩͱߟ͑Δඞཁ͸ͳ͍ʯ ServerlessΒ͍͠αʔϏε΋Ξοϓσʔτ͞Ε͍ͯ͘͠ɺ ৽͍֓͠೦ͷ௥ՃʹΑΓServerlessΒ͠͞͸มΘ͍ͬͯ͘

Slide 9

Slide 9 text

©Fusic Co., Ltd. 9 ServerlessΒ͋͘͠Ζ͏ͱ͢Δ Serverlessͱ͍͏ͷ͸ʮ͜Ε͚͕ͩServerlessͰ͋Δʯͱ͍͏΋ͷͰ͸ͳ͍ͱࢥ͍ͬͯ·͢ ࠓճ͸͜ͷServerlessͷ֓೦ΛऔΓೖΕΑ͏ͱ௅ઓ͠ଓ͚ͯఏڙ͖ͯͨ͠Ձ஋ͱڞʹ ͦͷதͰݟ͖͑ͯͨ։ൃऀʹ໨Λ޲͚ͯʮνʔϜʹϑΟοτͤ͞Δʯ͜ͱΛߟ͑ͨ ௅ઓͷ࿩Λͤͯ͞௖͖·͢

Slide 10

Slide 10 text

©Fusic Co., Ltd. 10 Serverless ద༻͠ଓ͚ͨݱ࣮ 2

Slide 11

Slide 11 text

©Fusic Co., Ltd. 11 ฐࣾͷٕज़ελοΫ PHPɺRubyɺͦͯ͠AWSΛத৺ͱͨ͠डୗ։ൃΛओʹߦ͍ͬͯ·ͨ͠ ࣗࣾϓϩμΫτ΋PHPͰ։ൃ͓ͯ͠Γɺٕज़ελοΫͱͯ͠PHP͸੾Γ཭ͤͳ͍΋ͷ ҰํͰPHP͸AWS LambdaͷެࣜϥϯλΠϜ͕ଘࡏ͠ͳ͍ɺϛεϚον͕͋ͬͨ ͦΜͳத๻͸ServerlessͷՁ஋Λײͯ͡ɺಋೖΛଓ͚·ͨ͠

Slide 12

Slide 12 text

©Fusic Co., Ltd. 12 ServerlessͳAPIΛ෇ՃՁ஋ͱͯ͠௥Ճ EC 2 Web API Web API API Gateway -> Lambda -> S 3 Json EC 2 cron Web 大 200 用

Slide 13

Slide 13 text

©Fusic Co., Ltd. 13 ServerlessͳAPIΛ෇ՃՁ஋ͱͯ͠௥Ճ 一見 Web 自 Serverless API 自 行 小 Python 行 Go

Slide 14

Slide 14 text

©Fusic Co., Ltd. 14 ݴޠʹΑΒͳ͍ServerlessͳαΠτߏங 0 力 用 Serverless

Slide 15

Slide 15 text

©Fusic Co., Ltd. 15 ݴޠʹΑΒͳ͍ServerlessͳαΠτߏங AWS Amplify 用 AWS Amplify GraphQL AWS AppSync 用 AWS Configuration GraphQL Serverless 行 AWS Amplify ( 自 )

Slide 16

Slide 16 text

©Fusic Co., Ltd. 16 ϥϯλΠϜͱͷϛεϚον ࣮֬ʹServerlessͷԸܙ͸ײ͍ͯͨ͡Ұํɺ ಋೖ͢Δ͜ͱͰϝϯςφʔ͕গͳ͍ϓϩδΣΫτΛ૿΍͍ͯ͠ΔΑ͏ͳײ֮΋͋Γ·ͨ͠ ٯʹRubyͷνʔϜʹؔͯ͠͸ɺެࣜϥϯλΠϜ͕͋ΔͨΊ͔ Serverless͕গͣͭ͠ਁಁ͍ͯͨ͠ ࣾ಺ͷٕज़ελοΫͰ͋ΔPHPͱAWS LambdaͷϥϯλΠϜͱͷϛεϚονͱ Serverlessͱ͍͏࣮ߦ؀ڥʹର͢Δೝ஌ෛՙ͕૝૾Ҏ্ʹେ͖͍ͷΛ࣮ײ࢝͠Ί͍ͯͨ

Slide 17

Slide 17 text

©Fusic Co., Ltd. 17 ServerlessΛద༻͢Δ͜ͱ͸ѱͳͷ͔

Slide 18

Slide 18 text

©Fusic Co., Ltd. 18 ໨ඪΛݟ௚͢ 目 Serverless 入 用 Serverless

Slide 19

Slide 19 text

©Fusic Co., Ltd. 19 νʔϜʹϑΟοτͤ͞ΔServerless 3

Slide 20

Slide 20 text

©Fusic Co., Ltd. 20 PHPΛAWS Lambda্Ͱ࢖͏͜ͱΛݕ౼ PHPΛಋೖ͢Δ͜ͱΛ2018೥͋ͨΓ͔Βݕ౼Λ࢝Ί͍ͯͨ ΧελϜϥϯλΠϜ͕ൃද͞Εͨཌ೥ͷPHP Conference 2019ͷࢿྉʹͯ ʮAWS LambdaΛPHPʹͯ࢖͏ͨΊʹ͸ʯͱ͍͏ͱ͜ΖΛௐ΂͍ͯͨ

Slide 21

Slide 21 text

©Fusic Co., Ltd. 21 Laravel + Bref on AWS Lambda ฐࣾͷจԽͱͯࠜ͠෇͍͍ͯΔPHP WebFrameworkͷLaravel AWSͱͷ૬ੑ͕ඇৗʹྑ͘ɺ .envʹAWSͷύϥϝʔλʔΛઃఆ͢Δ͚ͩͰAWSΛ্खʹѻ͏ࣄ͕Մೳ PHPͷOSSϓϩδΣΫτͰ͋ΔBref AWS Lambda্ͰPHPΞϓϦέʔγϣϯΛ؆୯ʹσϓϩΠͱ؅ཧΛՄೳʹ͢Δπʔϧ ͜ΕΒΛ૊Έ߹ΘͤɺνʔϜͷٕज़ελοΫʹϑΟοτͤ͞Δ͜ͱ͕ॏཁͩͱߟ͑·ͨ͠

Slide 22

Slide 22 text

©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

Slide 23

Slide 23 text

©Fusic Co., Ltd. 23 ͦͷޙผͷνʔϜͰಋೖ͢Δ͜ͱ΋Ͱ͖ͨ AWS Lambda x PHPʹͯएखͷϝϯόʔ͕ߏங Laravelͷ஌ࣝ͸͋ͬͨҝɺීஈͷߏஙͷΑ͏ʹ ࣗ෼Ҏ֎ͷϝϯόʔʹߏஙͤ͞Δ͜ͱ͕Ͱ͖ͨ ϕʔε͑͞ߏஙग़དྷΕ͹νʔϜͰͷಋೖͱӡ༻͸Մೳ

Slide 24

Slide 24 text

©Fusic Co., Ltd. 24 ҰํͰ

Slide 25

Slide 25 text

©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

Slide 26

Slide 26 text

©Fusic Co., Ltd. 26 The Lambda monolith ࢀߟURL : https://docs.aws.amazon.com/lambda/latest/operatorguide/monolith.html ʮThe Lambda monolithʯ

Slide 27

Slide 27 text

©Fusic Co., Ltd. 27 ServerlessͷՁ஋ΛνʔϜͰڗडग़དྷΔ ʮAWS Lambdaͱͯ͠͸ϕετͰ͸ͳ͍ ɹͰ΋ߏஙɺӡ༻·ͰؚΊͨΞϓϦέʔγϣϯͱͯ͠͸ ɹνʔϜͱͯ͠ϕετͩͬͨʯͱߟ͑·ͨ͠ νʔϜͷจԽͱͯ͠ServerlessΛड͚ೖΕΔ͜ͱ͕ग़དྷͨ

Slide 28

Slide 28 text

©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

Slide 29

Slide 29 text

©Fusic Co., Ltd. 29 Monolith First Serverless Development ࢀߟURL : https://speakerdeck.com/_kensh/monolith-first-serverless-development?slide=55 @_kensh ʮMonolith First Serverless Developmentʯ

Slide 30

Slide 30 text

©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?ʯ

Slide 31

Slide 31 text

©Fusic Co., Ltd. 31 ServerlessͷՁ஋Λఏڙ͢ΔνʔϜʹϑΟοτͨ͠ߏ੒

Slide 32

Slide 32 text

©Fusic Co., Ltd. 32 νʔϜͱServerlessΛܨ͙ͨΊͷ Platform Engineering΁ͷ௅ઓ 4

Slide 33

Slide 33 text

©Fusic Co., Ltd. 33 Platform Engineeringͱ͸ ・ 用 目

Slide 34

Slide 34 text

©Fusic Co., Ltd. 34 CNCF Platforms White Paper Serverless CNCF White Paper

Slide 35

Slide 35 text

©Fusic Co., Ltd. 35 Platform Engineering Platform Engineering Platform Engineering Meetup Serverless Meetup Osaka 自

Slide 36

Slide 36 text

©Fusic Co., Ltd. 36 Platform Engineering On Serverless URL :https://speakerdeck.com/_kensh/platform-engineering-on-serverless @_kensh

Slide 37

Slide 37 text

©Fusic Co., Ltd. 37 νʔϜτϙϩδʔ : ・ , ・ .   ʮϓϥοτϑΥʔϜ͸։ൃνʔϜͷʮअຐʹͳΒͳ͍ʯΑ͏ʹ͢Δɻ ɹ։ൃνʔϜ͕։ൃ͢Δ্Ͱͷલఏ৚݅ΛͳΔ΂͘গͳ͘͢Δͷͩɻʯ ɹɹɹɹɹɹɹɹɹ→ೝ஌ෛՙͷ௿ݮ - ετϦʔϜΞϥΠϯυνʔϜ - ಛఆͷ੡඼΍ػೳʹϑΥʔΧεͨ͠νʔϜ -ϓϥοτϑΥʔϜνʔϜ -ڞ௨ͷαʔϏε΍πʔϧΛఏڙ͢ΔνʔϜ

Slide 38

Slide 38 text

©Fusic Co., Ltd. 38 ίϯ΢ΣΠͷ๏ଇɺٯίϯ΢ΣΠͷ๏ଇ ίϯ΢ΣΠͷ๏ଇ ૊৫͕ઃܭ͢ΔγεςϜ͸ɺͦͷ૊৫ͷίϛϡχέʔγϣϯߏ଄͕൓ө͞Εͨ΋ͷʹͳΔ ٯίϯ΢ΣΠͷ๏ଇ ๬·͍͠γεςϜΞʔΩςΫνϟΛ࣮ݱ͢ΔͨΊʹɺ૊৫ߏ଄ΛͦΕʹ߹Θͤͯઃܭ͢Δ Ϋϥ΢υωΠςΟϒͳΞʔΩςΫνϟʹ߹Θͤͨ૊৫ߏ଄ʹมߋग़དྷΕ͹Α͍͕ ݱ࣮తʹࣗ෼ͷࡋྔͷൣғͰ૊৫ߏ଄มߋ͸೉͍͕͔͔࣌ؒ͠͠Δ ίϯ΢ΣΠͷ๏ଇʹج͖ͮɺ૊৫ͷٕज़ελοΫ߹Θͤͨ ServerlessͳγεςϜΞʔΩςΫνϟΛఏڙ͢ΔPlatform EngineeringΛߟ͑Δ

Slide 39

Slide 39 text

©Fusic Co., Ltd. 39 AWSʹ͓͚ΔServerless Architectureͷ୅දతͳߏ੒ Serverless Architectureͷࣗવͳߏ੒ ແཧʹ౰ͯ͸ΊΔ͜ͱ͸ೝ஌ෛՙʹܨ͕ΓServerlessͷਁಁʹ͸ܨ͕Βͳ͍

Slide 40

Slide 40 text

©Fusic Co., Ltd. 40 ฐࣾͷಘҙͳٕज़ελοΫΛ૊Έ߹Θͤͨߏ੒ ྨࣅͷฐ͕ࣾಘҙͳߏ੒Λ࠶ߟ͢Δ ૊৫ߏ଄ɺνʔϜؒͷίϛϡχέʔγϣϯ͕൓ө͞Εͨೝ஌ෛՙ͕௿͍ߏ੒

Slide 41

Slide 41 text

©Fusic Co., Ltd. 41 Platform Engineering ͷEssenceͷద༻ ૊৫ߏ଄ɺίϛϡχέʔγϣϯ͕൓ө͞Εͨߏ੒ʹ Serverless ArchitectureଆΛϑΟοτͤ͞ʹ͍͘ ࠓ·Ͱഓͬͨ஌ݟͱฐࣾͷٕज़ελοΫΛ ༥߹ͤ͞ΔͨΊʹTiDB ServerlessΛ࠾༻ ΠϯλʔϑΣʔεͱͯ͠ɺ SQL͕࢖͑Δ͜ͱͰࣗવʹ։ൃ͕Մೳ

Slide 42

Slide 42 text

©Fusic Co., Ltd. 42 ετϦʔϜΞϥΠϯυνʔϜͷ։ൃ΋ࣗવͳߏ੒Ͱ ࠓ·Ͱͷ։ൃʹϑΟοτͤ͞ΔܗͰ։ൃ؀ڥΛDockerͰఏڙ Laravel + MySQL + LocalStackΛར༻ͨࣗ͠વͳ։ൃߏ੒ ҧ࿨ײͷͳ͍ɺ͍ͭ΋ͷ։ൃମݧΛ࠶ݱ

Slide 43

Slide 43 text

©Fusic Co., Ltd. 43 ࢲୡͳΓͷPlatform Engineering΁ͷ௅ઓ ΞϓϦέʔγϣϯ։ൃऀ͕PlatformΛબͿ →ձࣾͷٕज़ελοΫʹ߹ΘͤͨPlatformΛ੔උͯࣗ͠વʹར༻ͯ͠΋Β͏ ࠓ·ͰServerlessͷ։ൃΛݗҾ͍ͯͨ͠ ࣗ෼ࣗ਎͕։ൃʹ͸Ұ੾ՃΘΒͣਐḿ Platform Engineering ͷ໨తͷҰͭ ೝ஌ෛՙͷ௿ݮΛୡ੒

Slide 44

Slide 44 text

©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

Slide 45

Slide 45 text

©Fusic Co., Ltd. 45 νʔϜͱಉԽ͢ΔΑ͏ʹServerlessΛϑΟοτͤ͞Δ Serverless

Slide 46

Slide 46 text

©Fusic Co., Ltd. 46 αεςφϏϦςΟΛҙࣝͨ͠νʔϜ΁ͷద༻ ServerlessͷՁ஋͸େ͖͍ ͨͩ͠νʔϜͷจԽΛແࢹͯ͠σϦόϦʔͷํ๏Λؒҧ͑Δͱ ଐਓԽͨ͠ෛͷҨ࢈ͱͳΔՄೳੑ΋͋Δ αεςφϏϦςΟΛҙࣝͨ͠ʮ͍·͋ΔνʔϜʹϑΟοτͤ͞ΔServerlessʯ

Slide 47

Slide 47 text

©Fusic Co., Ltd. 47 Thank You We are Hiring! https://recruit.fusic.co.jp/ ͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠