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

実践AWSサーバーレスアーキテクチャ導入の基礎とその概念/serverless-webinar-01

 実践AWSサーバーレスアーキテクチャ導入の基礎とその概念/serverless-webinar-01

Serverless Operations

July 03, 2020
Tweet

More Decks by Serverless Operations

Other Decks in Programming

Transcript

  1. 4FSWFSMFTT0QFSBUJPOTງՈོ޺
    ࣮ફAWSαʔόʔϨεΞʔΩςΫνϟ
    ಋೖͷجૅͱͦͷ֓೦

    View full-size slide

  2. ࣗݾ঺հ
    גࣜձࣾServerless Operations CEO
    ΦʔϓϯιʔεLover
    αʔόʔϨεϛʔτΞοϓOrganizer

    View full-size slide

  3. αʔόʔϨεͰ
    Ϋϥ΢υͷՁ஋Λ࠷େݶʹ
    Serverless Operations ͸͜Ε·ͰάϩʔόϧͷୈҰઢͰ
    ഓ͖ͬͯͨΫϥ΢υٕज़ʢ"84ʵΞϚκϯ΢ΣϒαʔϏεʣͷ
    ๛෋ͳ࣮੷ͱ஌ݟΛ׆͔͠ɺ͓٬͞·ͷαʔόʔϨε
    ʹؔ͢Δ͞·͟·ͳ՝୊Λղܾ͠·͢ɻ
    ձࣾ঺հ
    serverless.co.jp

    View full-size slide

  4. 0VS0QFO4PVSDF1SPEVDUT

    View full-size slide

  5. ͳͥαʔόʔϨεͳͷ͔ʁ

    View full-size slide

  6. ࣮૷ऀͷϦιʔεΛຊ࣭ʹϑΥʔΧε͢ΔͨΊ
    ྫ͑͹ήʔϜιϑτΛ։ൃ͢Δ࣌ʹϑΥʔΧε͍ͨ͠ͷ͸ήʔϜͷγφϦΦͷϓϩάϥ
    ϜɻͦΕҎ֎ͷ։ൃ΍ӡ༻͸Ͱ͖ΔݶΓΫϥ΢υʹΞ΢τιʔε
    ։ൃऀͷϦιʔεΛຊ࣭తͳ͜ͱʹूதͯ͠ɺͦΕҎ֎ͷίετ͸ग़དྷΔݶΓ࡟ݮ͢Δ
    ΠϯϑϥɺೝূೝՄɺܾࡁγεςϜɺϝʔϧ഑৴ͳͲͷߏங΍ӡ༻͸͠ͳ͍ɻ
    Ϋϥ΢υ΍4BB4ͷαʔϏεΛͰ͖Δ͚ͩར༻͢Δ͜ͱͰຊ࣭ʹूத͢Δ

    View full-size slide

  7. ϓϩμΫτͷ඼࣭ΛΞʔΩςΫνϟϨϕϧͰ୲อ
    ग़དྷΔݶΓো֐Λൃੜͤ͞ͳ͍ͨΊʹΞʔΩςΫνϟϨϕϧͰεέʔϥϏϦςΟͱ
    ߴՄ༻ੑΛ࣮ݱ͢Δ
    ͦͷͨΊʹΫϥ΢υͷఏڙ͢ΔαʔόʔϨεͳαʔϏεΛ׆༻͢Δ
    "84΍(PPHMFͷ௒༏लͳਓ͕ͨͪ࡞ͬͨΠϯϑϥͷ࢓૊Έ΍αϙʔτͷ্ʹ
    ৐͔ͬΔ͜ͱͷ҆৺ײɻ

    View full-size slide

  8. ίετͷ࡟ݮ
    ΞΫηε͕গͳ͍͏ͪ͸ѹ౗తʹίετ͕͍҆
    ͭ·Γখ͘͞ॳΊͯେ͖͘εέʔϧ͠΍͍͢
    ࣮ߦ͞Εͨ࣌ؒʹରͯ͠՝ۚ͞ΕΔ࢓૊ΈʹΑΓɺ
    ࣮֬ʹίετ͸࠷దԽ͞ΕΔɻΠϯϑϥͷো֐͸Ϋϥ΢υͷதʹ͍Δ௒༏लͳ
    ਓୡʹ೚ͤΔ͜ͱͰΠϯγσϯτίετ΋ൃੜͤ͞ͳ͍

    View full-size slide

  9. ͭ·Γ
    ΞʔΩςΫνϟϨϕϧͰ͸ߴ඼࣭͔ͭίετΛ࠷ద
    Խͨ͠ঢ়ଶͰɺϓϩμΫτͷຊ࣭తͳ։ൃʹϦιʔ
    εΛूத͢ΔͨΊʹαʔόʔϨεͳαʔϏεΛ׆༻
    ͯ͠࡞Δબ୒Λ͢Δ

    View full-size slide

  10. αʔόʔϨεͳαʔϏεͱ͸ʁ
    ͪΌΜͱ"84ͷ༻ޠͰ͍͏ͱ
    ϑϧϚωʔδυαʔϏεͱ͍͍·͢

    View full-size slide

  11. ϑϧϚωʔδυαʔϏεͱ͸
    "84ͷαʔϏεͷதͰ΋ͦͷػೳ͚ͩͰͳ͘ߏங΍ӡ༻؅ཧͳͲ΋Ұׅͯ͠ఏڙͯ͘͠
    ΕΔ΋ͷ͕ϚωʔδυαʔϏε
    ͦΕʹ߹Θͤͯɺਫฏํ޲ͷεέʔϦϯά΍৑௕ԽʹΑΔՄ༻ੑɻͦͷσΟεΫ༰ྔ΍
    ύʔςΟγϣχϯάͷ؅ཧ΋શؚͯΊͯαʔϏεͱͯ͠ఏڙͯ͘͠ΕΔ΋ͷΛϑϧϚ
    ωʔδυαʔϏεͱ͍͏

    View full-size slide

  12. "84ͷϑϧϚωʔδυαʔϏε
    'BB4 ΞϓϦέʔγϣϯ %#ɾετϨʔδ ϝοηʔδϯά
    ετϦʔϜ
    "1*(BUFXBZ %ZOBNP%#
    "QQ4ZOD 4
    -BNCEB
    4/4
    424
    &WFOU#SJEHF
    ,JOFTJT

    View full-size slide

  13. ·ͣ͸AWS Lambda(FaaS)ͱ
    ͦͷΞʔΩςΫνϟʹεϙοτΛ౰ͯΔ

    View full-size slide

  14. "84-BNCEB 'BB4
    ͷಛ௃ͱϝϦοτ
    ΞϓϦέʔγϣϯίʔυΛ࣮ߦͯ͘͠ΕΔαʔϏε
    Πϕϯτ͕ൃੜ͢Δ͜ͱͰίʔυ͕࣮ߦ͞ΕΔ
    ࣗಈతʹฒྻํ޲ʹεέʔϦϯάͯ͘͠ΕΔ
    ίʔυ͕࣮ߦ͞Εͨ࣌ؒʹରͯ͠ͷ՝ۚɻΞϓϦέʔγϣϯͷಛੑ࣍ୈͰ͸େ͖ͳ࡟ݮ
    ΋ݟࠐΊΔ
    ίʔυΛಈ͔ͨ͢ΊͷϓϥοτϑΥʔϜͷ؅ཧ͸ෆཁ

    View full-size slide

  15. ͳͥ͜͏͍ͬͨϝϦοτ͕
    ੜ·ΕΔͷ͔

    View full-size slide

  16. ϙΠϯτ͸Lambda͕Πϕϯτۦಈ͔ͭ
    εςʔτϨεʹઃܭ͞Ε͍ͯΔ͜ͱ

    View full-size slide

  17. εςʔτϨεͱ͸
    ؆୯ʹݴ͏ͱӬଓతͳσʔλΛ-BNCEBͷ಺෦Ͱอ࣋͠ͳ
    ͍ɻͦΕʹΑΓਫฏํ޲ͷεέʔϧ͕ՄೳʹͳΔ
    εέʔϧͷ؅ཧ͸"84͕׬શʹϑϧϚωʔδυͰߦͬͯ͘Ε
    Δ
    ͭ·Γɺ࣮૷ऀ͕εςʔτϨεʹ-BNCEBΛ࣮૷͢Δ͚ͩͰɺޙ͸τϥϑΟοΫʹ
    ߹ΘͤͯΦʔτεέʔϦϯάͯ͘͠ΕΔͱ͍͏ϝϦοτΛڗडͰ͖Δ

    View full-size slide

  18. Πϕϯτۦಈͱ͸
    Կ͔͠ΒͷΞΫγϣϯΛݩʹ-BNCEB͕ಈ࡞͢Δͱ͍͏͜ͱ
    ɾS3ʹϑΝΠϧ͕Ξοϓϩʔυ͞Εͨ
    ɾAPI GatewayʹϦΫΤετ͕͋ͬͨ
    ɾDynamoDBͷσʔλʹߋ৽͕͋ͬͨ
    ϙʔϦϯάΛߦͬͯঢ়ଶͷมԽΛ౎౓֬ೝ͢Δ͜ͱͱ͸
    ਅٯͷ࢓૊Έ
    ͭ·ΓɺΠϕϯτ͕ൃੜͨ͠ͱ͖͚ͩ-BNCEB͕ಈ͘͜ͱͰ
    "84ͷίϯϐϡʔςΟϯάϦιʔεͷ࢖༻͸࣮ߦ୯ҐͰ࠷దԽ͞ΕΔ
    ͜ΕʹΑΓίετޮ཰͸ࣗಈతʹ࠷దԽ͞ΕΔ

    View full-size slide

  19. ΠϕϯτۦಈͰ͋Δ͜ͱ͕
    ϓϩάϥϛϯάϞσϧʹͲ͏͍ͬͨ
    มԽΛ΋ͨΒ͢ͷ͔

    View full-size slide

  20. ΠϕϯτυϦϒϯΞʔΩςΫνϟ
    -BNCEBͱαʔϏε͕ΠϕϯτͰ਺चͭͳ͗ͱͳͬͨ
    ϚΠΫϩαʔϏεͰΠϕϯτυϦϒϯͳΞʔΩςΫνϟ͕ࣗ
    વͱग़དྷ্͕Δ
    ͭ·ΓɺαʔόʔϨεͷ੍໿Ͳ͓Γʹ࣮૷Λߦ͏͜ͱͰ
    ࣗવͱϚΠΫϩαʔϏεͳΞʔΩςΫνϟ͕ग़དྷ্͕Δ

    View full-size slide

  21. ΠϕϯτυϦϒϯͰ͋Δ͜ͱͰ
    Կ͕͏Ε͍͠ͷ͔

    View full-size slide

  22. ଱ো֐ੑ͕͕͋Δ

    View full-size slide

  23. ଱ো֐ੑ͕͕͋Δ
    ϩδοΫ ϩδοΫ ϩδοΫ
    ϦΫΤετ

    View full-size slide

  24. ଱ো֐ੑ͕͕͋Δ
    ϩδοΫ ϩδοΫ ϩδοΫ
    ϦΫΤετ
    ো֐ͷൃੜ
    ໰୊ͷղܾޙʹϦΫΤετ͔Β΍Γ௚͢ඞཁ͕͋Δ

    View full-size slide

  25. 2VFVFΛڬΜͰ͍Δͱ
    ϩδοΫ ϩδοΫ ϩδοΫ
    ϦΫΤετ 2VFVF 2VFVF

    View full-size slide

  26. 2VFVFΛڬΜͰ͍Δͱ
    ϩδοΫ ϩδοΫ ϩδοΫ
    ϦΫΤετ 2VFVF 2VFVF

    View full-size slide

  27. 2VFVFΛڬΜͰ͍Δͱ
    ϩδοΫ ϩδοΫ ϩδοΫ
    ϦΫΤετ 2VFVF 2VFVF
    2VFVFʹϦΫΤετ͕ཷ·͍ͬͯ͘

    View full-size slide

  28. 2VFVFΛڬΜͰ͍Δͱ
    ϩδοΫ ϩδοΫ ϩδοΫ
    ϦΫΤετ 2VFVF 2VFVF
    ো֐ͷղܾޙɺ2VFVFʹཷ·ͬͨ
    ϦΫΤετ͸ྲྀΕ੔߹ੑ͕อͨΕΔ

    View full-size slide

  29. ΤϥʔϋϯυϦϯά͕
    ΍Γ΍͘͢ͳΔ

    View full-size slide

  30. ΤϥʔϋϯυϦϯά
    ϩδοΫ ϩδοΫ
    ϦΫΤετ 2VFVF
    %-2
    %FBE-FUUFS2VFVFͰ
    ΤϥʔϋϯυϦϯά

    View full-size slide

  31. ΤϥʔϋϯυϦϯά
    ϩδοΫ ϩδοΫ
    ϦΫΤετ 2VFVF
    %-2
    ܽଛͨ͠
    σʔλ
    ॲཧͰ͖ͣʹϦτϥΠͷޙ
    %FBE-FUUFS2VFVFʹ
    ৼΓ෼͚ΒΕΔ

    View full-size slide

  32. ΤϥʔϋϯυϦϯά
    ϩδοΫ ϩδοΫ
    ϦΫΤετ 2VFVF
    %-2
    ܽଛσʔλΛमਖ਼ͯ͠
    ϩδοΫ͔ΒϦΧόϦ͕
    ࣮ࢪͰ͖Δ

    View full-size slide

  33. ػೳ௥Ճʹڧ͘ͳΔ

    View full-size slide

  34. ϞϊϦγοΫͳΞʔΩςΫνϟͷ৔߹
    ػೳ௥ՃͰιʔείʔυΛมߋ͢ΔͱӨڹൣғ͸
    ϓϩμΫτશମʹٴͿͨΊίʔυͷྔ͕ଟ͚Ε͹ଟ͍΄Ͳ
    ৺ཧతʹ͸͠ΜͲ͘ͳΔ

    View full-size slide

  35. ΠϕϯτυϦϒϯΞʔΩςΫνϟͷ৔߹
    'VODUJPO
    4FSWJDF
    'VODUJPO
    4FSWJDF
    'VODUJPO
    &WFOU &WFOU
    ৽ػೳ
    ৽ػೳ
    Πϕϯτιʔεʹରͯ͠৽ͨʹ
    4VCTDSJCFSΛ௥Ճ͍ͯ͘͠
    Ξϓϩʔνʹ͢Δ͜ͱͰӨڹൣ
    ғ͕ߜΓ΍͘͢ͳΔ

    View full-size slide

  36. αʔόʔϨεʹ͢Δ͜ͱͰࣗવͱΠϕϯτυϦϒϯ
    ʹͳΓɺϚΠΫϩαʔϏεͷΞʔΩςΫνϟతͳ
    ϝϦοτΛ׆͔ͤΔΑ͏ʹͳΔ
    ͭ·Γ

    View full-size slide

  37. ·ͣ͸αʔόʔϨεΛ࢝ΊΔͨΊʹ
    ֤ϑϧϚωʔδυαʔϏεͷಛ௃Λ
    ཧղ͠Α͏

    View full-size slide

  38. API
    Gateway
    "1*(BUFXBZ
    "1*Λ࡞੒͢ΔαʔϏε
    αʔόʔϨεͷੈքͰ͸γεςϜ΁ΞΫη
    ε͢ΔͨΊͷʮϑϩϯτυΞʯͱͯ͠ػೳ
    ͢ΔαʔϏε

    View full-size slide

  39. AppSync
    "QQ4ZOD
    (SBQI2-ͷόοΫΤϯυΛఏڙ͢ΔϑϧϚ
    ωʔδυαʔϏε
    ϑϩϯτΤϯυΞϓϦέʔγϣϯͷόοΫ
    Τϯυͱͯ͠
    ਺ඦສ୆ͷσόΠεͱͷؒͷϦΞϧλΠϜ
    αϒεΫϦϓγϣϯ΋ɺΞϓϦσʔλ΁ͷ
    ΦϑϥΠϯΞΫηε΋Մೳ

    View full-size slide

  40. DynamoDB
    %ZOBNP%#
    ߴ଎Ͱεέʔϥϒϧͳ/P42-σʔλϕʔε
    ਖ਼͘͠ઃܭ͢Δ͜ͱͰແݶͷεέʔϥϏϦ
    ςΟ͕͋Δ
    ༰ྔ͸ແ੍ݶɻσʔλ͕૿͑ΔʹͭΕͯউ
    खʹύʔςΟγϣχϯάͯ͠σʔλΛ഑ஔ
    ͯ͘͠ΕΔ
    Ϧʔδϣϯ಺ͷ஍ཧతʹ෼ࢄͨ͠Օॴʹ
    σʔλΛϨϓϦέʔγϣϯ͢Δ͜ͱͰՄ༻
    ੑͱରো֐ੑΛ֬อ͢Δ

    View full-size slide

  41. S3
    4
    ֦ுੑͱ଱ٱੑΛ݉Ͷඋ͑ͨΦϒδΣΫτ
    ετϨʔδ
    ༰ྔແ੍ݶͰɺͷ଱ٱੑΛ
    ࣋ͭ
    ՕॴͷΞϕΠϥϏϦςΟκʔϯͰࣗಈͰϨ
    ϓϦέʔγϣϯ͢Δ͜ͱͰ଱ো֐ੑͱՄ༻
    ੑΛ֬อ
    "UIFOB΍4 4FMFDUΛ࢖༻ͯ͠42-ͰΦϒ
    δΣΫτʹΞΫηεՄೳ

    View full-size slide

  42. SQS
    424
    ׬શϚωʔδυܕͷϝοηʔδΩϡʔΠϯ
    άαʔϏε
    Ωϡʔ͋ͨΓͷϝοηʔδ਺͸ແ੍ݶͰ΄
    ΅ແ੍ݶͷεϧʔϓοτ
    େྔͷδϣϒʢϝοηʔδʣΛ-BNCEBͰ͞
    ͹͖͍ͨ࣌ʹ424ΛڬΉͱ༗ޮ

    View full-size slide

  43. EventBridge
    &WFOU#SJEHF
    ड͚औͬͨΠϕϯτͷ഑৴΍ϑΟϧλϦϯ
    άΛ௨ͯ͠ϧʔςΟϯάΛߦ͏αʔϏε
    %BUB%PHͳͲͷ4BB4͔ΒͷσʔλΛ"84಺
    Ͱ-BNCEBͳͲʹϧʔςΟϯάͯ͠ॲཧͤ͞
    ͨΓग़དྷΔ
    -BNCEBಉ࢜Λ઀ଓ͢Δʹ΋༗ޮ

    View full-size slide

  44. Kinesis
    Streams
    ,JOFTJT4USFBNT
    ετϦʔϜσʔλΛϦΞϧλΠϜʹऩू͠
    ͯॲཧ͢ΔͨΊͷαʔϏε
    αʔόʔϨεͷੈքͰ͸୹ظؒͰେྔʹ͘
    ΔΞΫηε΍3%4ͷಉ࣌઀ଓ਺ͷ໰୊ʹର
    ॲ͢ΔͨΊʹྲྀྔΛௐ੔ͯ͠ཪଆͷ-BNCEB
    Ͱ·ͱΊͯॲཧ͢ΔϢʔεέʔε͕ଟ͍

    View full-size slide

  45. Step
    Functions
    4UFQ'VODUJPOT
    "84ͷ༷ʑͳαʔϏεΛܨ͍Ͱॲཧͷϫʔ
    ΫϑϩʔΛઃܭɾ࣮ߦ͢ΔαʔϏε
    -BNCEB୯ମͰ͸λΠϜΞ΢τ͢ΔΑ͏ͳॲ
    ཧΛϫʔΫϑϩʔʹ෼ղ࣮ͯ͠ߦ͢ΔΑ͏
    ͳϩϯάϥϯχϯάͳόονॲཧʹ޲͍ͯ
    ͍Δɻ

    View full-size slide

  46. ·ͣ͸͜ΕΒͷϑϧϚωʔδυαʔϏεͷಛੑΛ
    ཧղͯ͠దࡐదॴͰ࢖͑ΔΑ͏ʹͳΓ·͠ΐ͏ʂ
    ॏཁͳ͜ͱ͸

    View full-size slide

  47. ·ͱΊ
    Ϗδωεͷຊ࣭ʹूத͢ΔͨΊʹΠϯϑϥͷӡ༻؅ཧΛΫϥ
    ΢υʹؙ౤͛͠·͠ΐ͏ɻͦͷͨΊͷαʔόʔϨε
    ΠϕϯτυϦϒϯͳΞʔΩςΫνϟΛҙࣝ͠Α͏ɻͦͷ͜ͱ
    Ͱมߋʹڧ͘ͳΓɺ଱ো֐ੑ΍ΤϥʔϋϯυϦϯάʹڧ͍γ
    εςϜʹͳΓ·͢
    ग़དྷΔݶΓϑϧϚωʔδυαʔϏεϑΝʔετͰઃܭ͠·
    ͠ΐ͏ɻ֤αʔϏεͷಛੑΛཧղͯ͠దࡐదॴͰ࢖͍෼͚Ε
    ΔΑ͏ʹ͠·͠ΐ͏

    View full-size slide

  48. ͱ͸͍͑
    ϑϧϚωʔδυαʔϏεͷ࢓༷΍੍໿΍ΠϕϯτυϦϒϯͳ
    ϓϩάϥϛϯάϞσϧʹ׳ΕΔ͜ͱ͸ͦΕͳΓʹֶशίετ
    ͕͔͔Δ͜ͱ΋ࣄ࣮

    View full-size slide

  49. ࠷ॳͷೖΓํͱͯ͠
    "1*(BUFXBZ-BNCEB%ZOBNP%#ͱ͍ͬͨߏ੒Ͱখن໛ͳͱ͜Ζ͔ΒॳΊͯΈΔɻ
    ΤϥʔϋϯυϦϯάͳͲ͕ಛʹॏ༻Ͱͳ͍έʔεͳΒɺ
    -BNCEBʹॲཧΛ٧Ίͯॻ͘ͷ΋ແ͠͡Όͳ͍
    ࠓͰ͸3%4ͷίʔϧυελʔτ໰୊΋େ෯ʹվળ͍ͯ͠Δɻ3BJMT΍-BSBWFMͱ͍ͬͨ8FCΞϓϦ
    έʔγϣϯϑϨʔϜϫʔΫΛࡌͤͯɺීஈ͔Β΍͍ͬͯΔΞʔΩςΫνϟΛࡌͤସ͑ͯΈΔɻ
    ࠷ॳ͔Β఺ͷΠϕϯτυϦϒϯΞʔΩςΫνϟΛ໨ࢦ͞ͳ͍

    View full-size slide

  50. গ͠ฐࣾͷϏδωεͷ঺հΛ
    ͍ͤͯͩ͘͞͞

    View full-size slide

  51. ڞ૑ܕडୗ։ൃ

    View full-size slide

  52. ཁ͢Δʹ
    ϏδωεͷΰʔϧΛୡ੒͢ΔͨΊʹαʔόʔϨεΞϓϦέʔ
    γϣϯΛҰॹʹ࡞͍͖ͬͯ·͠ΐ͏ɻͦͷࢧԉΛߦ͍·͢ɻ
    "84αʔόʔϨεʹؔ͢Δ͜ͱͳΒɺઃܭɾ։ൃɾ1P$ɾෛ
    ՙࢼݧɾӡ༻ɾίετ࠷దԽͳͲ͋ΒΏΔ͜ͱ͕Մೳ

    View full-size slide

  53. ϓϥϯʢࢀߟՁ֨ʣ
    νϟοτͷΈͰͷ։ൃαϙʔτ
    ઃܭɾΞʔΩςΫςΟϯάΛҰॹʹ࣮ࢪ
    Ұॹʹ։ൃΛ࣮ࢪ
    ෛՙࢼݧͷઃܭ͔Β࣮ࢪ
    ສ݄ʙ
    ສ݄ʙ
    ສ݄ʙ
    ສ݄ʙ

    View full-size slide

  54. ڵຯ͕͋Ε͹ੋඇαΠτ͔Β
    ͓໰͍߹Θ͍ͤͩ͘͞

    View full-size slide

  55. serverless.co.jp

    View full-size slide