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

サーバーレスを採用すべき100の理由(1つしか話さないよ)

 サーバーレスを採用すべき100の理由(1つしか話さないよ)

Kouta Ozaki

August 30, 2023
Tweet

More Decks by Kouta Ozaki

Other Decks in Programming

Transcript

  1. © Chatwork
    αʔόʔϨεΛ
    ࠾༻͢΂͖100ͷཧ༝
    (1͔ͭ͠࿩͞ͳ͍)
    ϓϩμΫτج൫։ൃ෦ɹKouta Ozaki
    ࢲͨͪͷαʔόʔϨεΞʔΩςΫνϟߏ੒͸͜Εͩʂ
    Lunch LT

    View full-size slide

  2. ཧ༝ ᶃ
    εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্

    View full-size slide

  3. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    3
    ChatworkͰى͖ͨো֐ͷ࿩

    View full-size slide

  4. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    4

    View full-size slide

  5. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    5

    View full-size slide

  6. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    6

    View full-size slide

  7. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    7

    View full-size slide

  8. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    8

    View full-size slide

  9. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    9
    ʊਓਓਓਓਓਓਓਓਓʊ
    ʼɹαʔϏεμ΢ϯɹʻ
    ʉY^Y^Y^Y^Y^Y^Y^Y^Y^ʉ

    View full-size slide

  10. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    10
    Կ͕໰୊ͩͬͨͷ͔

    View full-size slide

  11. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    11
    Ϧιʔε͕ރׇ͢Δ଎౓ > ϦιʔεΛ֬อ͢Δ଎౓

    View full-size slide

  12. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    12
    ਖ਼ৗ࣌ʹ100rpsɺ100ms (AVG)Λظ଴͢Δέʔε
    • 10 process / sec ͷϦιʔε͕ඞཁ
    • ҟৗέʔεͰ1000ms (AVG)ʹͳΔͱ100 process / secͷϦιʔε͕ඞཁ
    • 10 processͷ··ͩͱ1ඵܦա͢Δຖʹ90 request͕ཷ·͍ͬͯ͘ڪා

    View full-size slide

  13. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    13
    εέʔϧ଎౓ΛͲΕ͚ͩૣ͘Ͱ͖Δ͔
    ࣄલʹόοϑΝΛͲΕ͚ͩऔΔ͔ͷ໰୊

    View full-size slide

  14. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    14
    • ݪଇͱͯ͠N secҎ಺ʹϨεϙϯεΛඞͣฦ͞ͳ͚Ε͹͍͚ͳ͍
    • Ϣʔβʔσʔλͷྔʹґଘ͠ͳ͍
    • όοΫΤϯυʢDB΍MSͳͲʣͷঢ়ଶʹґଘ͠ͳ͍
    • ద੾ͳλΠϜΞ΢τઃఆ
    • αʔΩοτϒϨʔΧʔͷಋೖ
    • ͜ͷN secͱ࣮ଌͷฏۉ஋ͷM secΛ΋ͱʹඞཁͳεέʔϧ଎౓ͱόοϑΝ
    Λࢉग़͢Δ

    View full-size slide

  15. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    15
    ʊਓਓਓਓਓਓʊ
    ʼɹ໘౗ष͍ɹʻ
    ʉY^Y^Y^Y^Y^Y^ʉ

    View full-size slide

  16. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    16
    ͦ͏ͩLambdaΛ࢖͓͏

    View full-size slide

  17. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    17
    • Lambda͸1 Request - 1 Function
    • ಉ࣌ʹॲཧ͢ΔRequest͕૿͑ΔFunction͕εέʔϧ
    • ίʔϧυελʔτ࣍ୈ͕ͩඵͰεέʔϧՄೳ
    • ༨෼ͳόοϑΝΛ࣋ͭඞཁ͕ͳ͍ͨΊίετతʹ΋༏͍͠

    View full-size slide

  18. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    18

    View full-size slide

  19. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    19
    ʊਓਓਓਓਓਓਓਓਓʊ
    ʼɹΫϥ΢υഁ࢈ɹʻ
    ʉY^Y^Y^Y^Y^Y^Y^Y^Y^ʉ

    View full-size slide

  20. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    20
    Lambda͔ͩΒͱա৴͸ͯ͠͸͍͚ͳ͍

    View full-size slide

  21. εέʔϥϏϦςΟʹΑΔ଱ো֐ੑͷ޲্
    21
    ChatworkͰ͸OGPදࣔػೳͳͲͰLambdaΛར༻͍ͯ͠Δ

    OGPऔಘͷϨΠςϯγ͕ෆ໌Ͱ͋Γɺࣄલܭଌ͕೉͍͠ྖҬʹͳΔ

    View full-size slide