Upgrade to Pro — share decks privately, control downloads, hide ads and more …

いまあるチームにフィットさせる Serverless そして Platform Enginee...

shiro seike
September 21, 2024

いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering

ServerlessDays Tokyo 2024
https://tokyo.serverlessdays.io

shiro seike

September 21, 2024
Tweet

More Decks by shiro seike

Other Decks in Programming

Transcript

  1. ©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 ϓϦϯγύϧΤϯδχΞ/ΤόϯδΣϦετ
  2. ©Fusic Co., Ltd. 3 CONTENTS ໨࣍ 1. Serverless Ͱ͋Δ։ൃΛৼΓฦΔ 2.

    Serverless ద༻͠ଓ͚ͨՁ஋ͱݱ࣮ 3. νʔϜʹϑΟοτͤ͞ΔServerless 4. νʔϜͱServerlessΛܨ͙ͨΊͷPlatform Engineering΁ͷ௅ઓ 5. ·ͱΊ
  3. ©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
  4. ©Fusic Co., Ltd. 8 ServerlessΒ͠͞ͷਖ਼ମʁ ServerlessΩϟογϡͰ༗໊ͳmomentoʹΑΔදݱ 1. ϓϩϏδϣϯෆཁɺ؅ཧෆཁ 2. ࠷௿ྉۚͷͳ͍࢖ͬͨ෼͚ͩͷࢧ෷͍

    3. 1 ͭͷ API ݺͼग़͠Ͱར༻Մೳ 4. ܭըఀࢭ͕ͳ͍ 5. Πϯελϯε͕ͳ͍ Serverlessͷಛ௃ଊ͓͑ͯΓڌΓॴʹͯ͠΋ྑ͍ͱࢥ͏͕ ݸਓతͳҙࣝͱͯ͠͸ʮ౴͑ͩͱߟ͑Δඞཁ͸ͳ͍ʯ ServerlessΒ͍͠αʔϏε΋Ξοϓσʔτ͞Ε͍ͯ͘͠ɺ ৽͍֓͠೦ͷ௥ՃʹΑΓServerlessΒ͠͞͸มΘ͍ͬͯ͘
  5. ©Fusic Co., Ltd. 12 ServerlessͳAPIΛ෇ՃՁ஋ͱͯ͠௥Ճ EC 2 Web API Web

    API API Gateway -> Lambda -> S 3 Json EC 2 cron Web 大 200 用
  6. ©Fusic Co., Ltd. 15 ݴޠʹΑΒͳ͍ServerlessͳαΠτߏங AWS Amplify 用 AWS Amplify

    GraphQL AWS AppSync 用 AWS Configuration GraphQL Serverless 行 AWS Amplify ( 自 )
  7. ©Fusic Co., Ltd. 21 Laravel + Bref on AWS Lambda

    ฐࣾͷจԽͱͯࠜ͠෇͍͍ͯΔPHP WebFrameworkͷLaravel AWSͱͷ૬ੑ͕ඇৗʹྑ͘ɺ .envʹAWSͷύϥϝʔλʔΛઃఆ͢Δ͚ͩͰAWSΛ্खʹѻ͏ࣄ͕Մೳ PHPͷOSSϓϩδΣΫτͰ͋ΔBref AWS Lambda্ͰPHPΞϓϦέʔγϣϯΛ؆୯ʹσϓϩΠͱ؅ཧΛՄೳʹ͢Δπʔϧ ͜ΕΒΛ૊Έ߹ΘͤɺνʔϜͷٕज़ελοΫʹϑΟοτͤ͞Δ͜ͱ͕ॏཁͩͱߟ͑·ͨ͠
  8. ©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
  9. ©Fusic Co., Ltd. 23 ͦͷޙผͷνʔϜͰಋೖ͢Δ͜ͱ΋Ͱ͖ͨ AWS Lambda x PHPʹͯएखͷϝϯόʔ͕ߏங Laravelͷ஌ࣝ͸͋ͬͨҝɺීஈͷߏஙͷΑ͏ʹ

    ࣗ෼Ҏ֎ͷϝϯόʔʹߏஙͤ͞Δ͜ͱ͕Ͱ͖ͨ ϕʔε͑͞ߏஙग़དྷΕ͹νʔϜͰͷಋೖͱӡ༻͸Մೳ
  10. ©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
  11. ©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
  12. ©Fusic Co., Ltd. 29 Monolith First Serverless Development ࢀߟURL :

    https://speakerdeck.com/_kensh/monolith-first-serverless-development?slide=55 @_kensh ʮMonolith First Serverless Developmentʯ
  13. ©Fusic Co., Ltd. 37 νʔϜτϙϩδʔ : ・ , ・ .

      ʮϓϥοτϑΥʔϜ͸։ൃνʔϜͷʮअຐʹͳΒͳ͍ʯΑ͏ʹ͢Δɻ ɹ։ൃνʔϜ͕։ൃ͢Δ্Ͱͷલఏ৚݅ΛͳΔ΂͘গͳ͘͢Δͷͩɻʯ ɹɹɹɹɹɹɹɹɹ→ೝ஌ෛՙͷ௿ݮ - ετϦʔϜΞϥΠϯυνʔϜ - ಛఆͷ੡඼΍ػೳʹϑΥʔΧεͨ͠νʔϜ -ϓϥοτϑΥʔϜνʔϜ -ڞ௨ͷαʔϏε΍πʔϧΛఏڙ͢ΔνʔϜ
  14. ©Fusic Co., Ltd. 41 Platform Engineering ͷEssenceͷద༻ ૊৫ߏ଄ɺίϛϡχέʔγϣϯ͕൓ө͞Εͨߏ੒ʹ Serverless ArchitectureଆΛϑΟοτͤ͞ʹ͍͘

    ࠓ·Ͱഓͬͨ஌ݟͱฐࣾͷٕज़ελοΫΛ ༥߹ͤ͞ΔͨΊʹTiDB ServerlessΛ࠾༻ ΠϯλʔϑΣʔεͱͯ͠ɺ SQL͕࢖͑Δ͜ͱͰࣗવʹ։ൃ͕Մೳ
  15. ©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