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

Cloudflare Workers x AWS Lambdaの組み合わせユースケース / C...

Cloudflare Workers x AWS Lambdaの組み合わせユースケース / Cloudflare Workers x AWS Lambda Combination Use Case

第36回 JAWS-UG札幌 勉強会【 #CloudflareUG_cts と合同開催です!】
https://jawsug-sapporo.connpass.com/event/321565/

shiro seike

July 12, 2024
Tweet

More Decks by shiro seike

Other Decks in Programming

Transcript

  1. ©Fusic Co., Ltd. 1 Cloudflare Workers x AWS Lambdaͷ ૊Έ߹ΘͤϢʔεέʔε

    2024.07.12 @seike460 ୈ36ճ JAWS-UGࡳຈ ษڧձ ʲ #CloudflareUG_cts ͱ߹ಉ։࠵Ͱ͢ʂʳ
  2. ©Fusic Co., Ltd. 2 ਗ਼Ո ࢙࿠ @seike460 AWS Community Builder

    Serverless ίϛϡχςΟ JAWS-UG Fukuoka Cloudflare Meetup Fukuoka Serverless Meetup Fukuoka Fukuoka.php Fukuoka.go JP_Stripes Fukuoka ࣗݾ঺հ ͸͡Ίʹ גࣜձࣾFusic ϓϦϯγύϧΤϯδχΞ/ΤόϯδΣϦετ
  3. ©Fusic Co., Ltd. 3 CONTENTS ໨࣍ 1. AWSʹ͓͚ΔαʔόʔϨεͷඪ४ߏ੒ 2. Amazon

    API Gatewayͷίετ 3. Cloudflare Workersͷར༻ 4. ͞ΒͳΔ޿͕Γ 5. ·ͱΊ
  4. ©Fusic Co., Ltd. 7 Amazon API Gateway͸Ҏ֎ʹߴ͍ ͍ͭ΋͜ͷجຊߏ੒Ͱಈ͍͍ͯͨ APIʹ1000ສϦΫΤετ͕ ߦΘΕ͍ͯΔࣄྫʹͯ

    શମίετͷͳΜͱ76.4%͕ Amazon API Gatewayͱ͍͏ ঢ়ଶʹͳ͍ͬͯͨ ΋ͪΖΜن໛ʹରͯ͠ ଟେͰ͸ͳ͍ͷ͕ͩɺ΍ͨΒ໨ཱͭ
  5. ©Fusic Co., Ltd. 15 ύϑΥʔϚϯε Time per Request͕ 200msͳͷͰ ͔ͳΓݱ࣮తͳύϑΥʔϚϯε

    ʢΉ͠Ζૣ͍ʣ 500 rpsͱ͍͏͜ͱͰ ฒྻੑ΋֬อ͞Ε͍ͯΔ API Gatewayͱͯ͠͸े෼ͳੑೳ
  6. ©Fusic Co., Ltd. 18 API Gatewayʹ࣮૷Ͱ͖ͳ͍ػೳ΋࣮૷Մೳʹ Honoࣗମʹ༷ʑͳMiddlewareػߏΛ ఏڙ͍ͯ͠Δ ྫ͑͹JWTೝূɺCSRFରԠɺ StreamingDataରԠͳͲ

    ༷ʑͳػೳ௥ՃΛखܰʹ࣮ࢪग़དྷΔ Ͳ͏ͯ͠΋ߏஙͷίετΛ΋ͭ ඞཁ͸͋Δ͕ߏஙίετ͕෇༩͢Δ Ձ஋Λڗड͢Δʹબ୒ࢶʹͳΔ͔΋
  7. ©Fusic Co., Ltd. 20 ·ͱΊ Α͋͘ΔAWSͷαʔόʔϨεߏ੒Ͱ͸Ҋ֎API Gatewayͷֹ͕͔͔ۚΔ Point 01 ίετ෦෼ͷղܾͱͯ͠Cloudflare

    Wokers x AWS Lambda Point 02 ύϑΥʔϚϯε΋্ʑɺશ͘໰୊ͳ͘࢖͑Δ Point 03 ΧελϚΠζੑʹັྗΛײ͡ΔͷͳΒબ୒ࢶʹͳΔ͔΋͠Εͳ͍ Point 04