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

Webサービスにおけるインフラアーキテクチャの体系化と選択自動化の研究/study on web system architecture #1

Webサービスにおけるインフラアーキテクチャの体系化と選択自動化の研究/study on web system architecture #1

第一回WSA研の発表資料

masayoshi
PRO

December 27, 2017
Tweet

More Decks by masayoshi

Other Decks in Technology

Transcript

  1. WebαʔϏεʹ͓͚ΔΠϯϑϥΞʔΩςΫνϟ
    ͷମܥԽͱ
    ΠϯϑϥΞʔΩςΫνϟͷબ୒ࣗಈԽͷݚڀ՝୊
    ʹ͍ͭͯͷ੔ཧͱߟ࡯

    View Slide

  2. ΞδΣϯμ
    • ݚڀςʔϚ
    • ݚڀഎܠ
    • ݚڀ՝୊ͷ੔ཧͱํ਑
    • طଘͷΠϯϑϥΞʔΩςΫνϟͷௐࠪͱ෼ྨ
    • ࠓޙͷํ਑ͱ·ͱΊ

    View Slide

  3. ݚڀςʔϚ

    View Slide

  4. ݚڀςʔϚ
    • WebαʔϏεʹ͓͚ΔΠϯϑϥΞʔΩςΫνϟͷମܥԽ
    • ΠϯϑϥΞʔΩςΫνϟͷબ୒ࣗಈԽ

    View Slide

  5. ݚڀςʔϚ ~ΠϯϑϥΞʔΩςΫνϟͷମܥԽ~
    ෼ྨЋ
    ΞʔΩςΫνϟ"
    ཁૉ ཁૉ ཁૉ
    ཁૉ ཁૉ ཁૉ
    ΞʔΩςΫνϟ#
    ཁૉ ཁૉ ཁૉ
    ཁૉ ཁૉ ཁૉ
    ෼ྨЌ
    ΞʔΩςΫνϟ$
    ཁૉ ཁૉ ཁૉ
    ཁૉ ཁૉ ཁૉ
    ΞʔΩςΫνϟ%
    ཁૉ ཁૉ ཁૉ
    ཁૉ ཁૉ ཁૉ

    View Slide

  6. ݚڀςʔϚ ~ΠϯϑϥΞʔΩςΫνϟͷબ୒ࣗಈԽ~
    Πϯϑϥ
    ΞʔΩςΫνϟ"
    Πϯϑϥ
    ΞʔΩςΫνϟ#
    Πϯϑϥ
    ΞʔΩςΫνϟ$
    Πϯϑϥ
    ΞʔΩςΫνϟ
    ܾఆ܅
    8FCαʔϏε
    Πϯϑϥ
    ΞʔΩςΫνϟ%

    View Slide

  7. ݚڀഎܠ

    View Slide

  8. ݚڀഎܠ
    • WebαʔϏεͷߴ౓Խ
    • Πϯϑϥߏ੒ͷબ୒ࢶͷ૿Ճ
    • Πϯϑϥઃܭͷ҉໧஌
    • ΤϯδχΞͱͯ͠ͷࢥ͍

    View Slide

  9. ݚڀഎܠ ~WebαʔϏεͷߴ౓Խ~
    8FCαʔϏε
    Λࢧ͑ΔͨΊͷ
    ߴ౓ͳΠϯϑϥཁٻ
    ࣮ݱ͢ΔͨΊͷ
    ϛυϧ΢ΣΞɺ
    γεςϜͷ։ൃ
    044΍αʔϏε
    ͱͯ͠ެ։
    ޿͘࢖͑ΔΑ͏ʹ
    Πϯϑϥ͕ڧ͘ͳΓ
    ΑΓߴ౓ͳ8FCαʔϏε͕
    ߏஙՄೳʹ

    View Slide

  10. ݚڀഎܠ ~Πϯϑϥߏ੒ͷબ୒ࢶͷ૿Ճ~
    • աڈ(2000೥୆ॳ಄)
    • σʔληϯλͰ
    • ෺ཧαʔόΛ࢖ͬͯ
    • Web, App, DBߏ੒ΛLAMPͰ࡞Δ
    • ࠓ
    • σʔληϯλ or Ϋϥ΢υ Ͱ
    • ෺ཧαʔό or Ծ૝αʔό or ίϯςφ or X as a Service ্Ͱ
    • Web, App, DB, Batch, Cacheߏ੒Λ,

    ༷ʑͳϛυϧ΢ΣΞͱαʔϏεͱ࿈ܞ͠࡞Δ

    View Slide

  11. ݚڀഎܠ ~ΠϯϑϥΞʔΩςΫνϟͷύλʔϯԽ~
    • աڈ
    • ઃܭͷબ୒ࢶ͕গͳ͍
    • ࣮ݱ͢ΔͨΊͷϛυϧ΢ΣΞ͕ͳ͍ͨΊ࣮૷͕ඞཁ
    • ߏஙʹ͸͕͔͔࣌ؒΔ
    • ࠓ
    • ઃܭͷબ୒ࢶ͸ඇৗʹଟ͘ɺۛຯ͕ඞཁ
    • ػೳΛ࣮ݱͰ͖Δϛυϧ΢ΣΞɺαʔϏε͕ଟ਺ଘࡏ
    • ΑΓগͳ͍࣌ؒͰߏங͕Մೳʹͳͬͨ
    ߏங࣌ؒ͸୹͘ɺઃܭʹ͔͚Δ(ΒΕΔ)͕࣌ؒ૿େ

    View Slide

  12. ݚڀഎܠ ~Πϯϑϥઃܭͷ҉໧஌~
    • Πϯϑϥઃܭ͸ઃܭऀͷ҉໧஌ʹΑΔͱ͜Ζ͕େ͖͍
    • ߏங͍ͨ͠αʔϏε͔ΒΠϯϑϥཁ݅ͷ೺Ѳ
    • ྨࣅͨ͠αʔϏεͷߏஙܦݧɺࣄྫΛݟͨ͜ͱ͕͋Δ
    • Πϯϑϥཁ݅Λຬͨͨ͢Ίͷ࣮૷ɺαʔϏεͷ೺Ѳ
    • ͦΕ͸hogehogeͱ͍͏ϛυϧ΢ΣΞͰग़དྷΔ
    • ͋ͷαʔϏε͸ΞϨ͕͋Δ
    • ϝϦοτɺσϝϦοτͷ൑அ(ಛʹӡ༻ίετͳͲ)
    • hogehoge͸ػೳ͕ศར͚ͩͲɺӡ༻͕େม
    • ͋ͷαʔϏε͸͕͔͔ۚΔ͚Ͳɺӡ༻ָ͕

    View Slide

  13. ݚڀഎܠ ~Πϯϑϥઃܭͷ҉໧஌~
    ϒϩάαʔϏεΛ࡞Δ
    ϒϩάαʔϏε͸ϢʔβͰ͋Δਓ͕ؒॻ͖ࠐΉͷͰDB΁ͷॻ͖
    ࠐΈΑΓɺಡΈࠐΈͷํ͕ଟ͍ɻ͋ΔಛఆͷΤϯτϦ͕όζͬͯ
    τϥϑΟοΫ͕όʔετ͢ΔՄೳੑ͕͋Δɻจࣈ͕த৺ͳͷͰɺ
    ಈը΍ը૾͕ͳ͚Ε͹τϥϑΟοΫྔ͸গͳ͍ɻίϯςϯπ͸Ϧ
    ϦʔεޙʹϢʔβ͕౤ߘ͠૿͍͑ͯ͘ͷͰɺσʔλྔͱτϥϑΟο
    Ϋྔ͸ঃʑʹ૿͍͑ͯ͘ɻҎ্ͷ͜ͱΛ౿·͑ΔͱɺΩϟογϡ
    ઓུ͕༗ޮͦ͏ͩɻॻ͖ࠐΈ͕ൺֱతগͳ͍ͷͰΩϟογϡͷѻ
    ָ͍͕ͦ͏ͩ͠ɺΤϯτϦ͕όζͬͨͱ͖͸ΩϟογϡͰฦ͢͜
    ͱ͕ग़དྷΔɻಛʹը૾ͱಈը͸τϥϑΟοΫ͕ؾʹͳΔͷͰɺ
    CDN͔Βฦ͢ɻϦϦʔεॳظ͸ෛՙ͕গͳͦ͏ͳͷͰɺӡ༻ɺඅ
    ༻౳Λߟ͑ɺεϞʔϧͳߏ੒ɺ୆਺͔Β੒௕ʹ߹Θͤͯ૿΍͢ɻ

    View Slide

  14. ݚڀഎܠ ~Πϯϑϥઃܭͷ҉໧஌~
    ͋Δηϯαʔ৘ใΛू໿ͯ͠ՄࢹԽ͢ΔαʔϏε
    ηϯαʔϊʔυͷૹ৴σʔλΛอଘ͢ΔͨΊɺDB΁ͷॻ͖ࠐΈ
    ͕ଟ͍ɻσʔλͷॻ͖ࠐΈͷྔɺτϥϑΟοΫྔ͸ηϯαʔϊʔ
    υ਺͔Β༧ଌ͕ग़དྷΔɻσʔλྔ͸ͲΜͲΜ૿Ճ͢Δɻσʔλ͸
    ߏ଄Խ͠қ͍ɻఆظతʹσʔλΛूܭ͢Δඞཁ͕͋ΔɻҎ্ͷ͜
    ͱΛ౿·͑ΔͱɺDBͷબ୒͸ॏཁͰ͋ΔɻηϯαʔσʔλΛѻ
    ͍΍͍࣌͢ܥྻσʔλϕʔεΛબ୒͠ूܭΛ༰қʹ͢Δɻ༰ྔͷ
    ૿Ճͱॻ͖ࠐΈͷεϧʔϓοτΛ্͛΍͍͢෼ࢄετϨʔδ্ʹ
    ߏங͢Δͷ͕ྑͦ͞͏Ͱ͋Δ͕ɺ෼ࢄετϨʔδ͸ӡ༻͕େมͱ
    Α͘ฉ͘ɻඅ༻͕ڐ͢ͳΒϚωʔδυDBαʔϏεΛϕʔεʹ૊
    Ή͜ͱͰɺӡ༻ίετΛԼ͛ɺεέʔϧ͠ɺ༰ྔ͕૿͑ΔΑ͏ʹ
    ͍ͨ͠ɻඅ༻ݟੵ΋Γ͸σʔλྔ͕༧ଌՄೳͳͨΊՄೳɻ

    View Slide

  15. ΤϯδχΞͱͯ͠ͷࢥ͍
    • ӡ༻,ߏங͸ࣗಈԽ΍αʔϏε,ϛυϧ΢ΣΞͷॆ࣮Ͱָʹ
    • ͚ͩͲઃܭ͸ָʹͳͬͨͩΖ͏͔
    • ઃܭͷࣗಈԽ͸? (͍ͬ͢͝େมͦ͏ʂʂʂ)
    • Զୡ͸ܦݧ΍஌Γ߹͍ΤϯδχΞͷ࿩Λ΋ͱʹงғؾͰઃܭ͠
    ͍ͯΔʂ
    • ٯʹબ୒ࢶ૿͑ͯେมʹͳ͍ͬͯΔ?(બ୒Λશͯࢼ͢ͷ΋େม)
    • (͍ΘΏΔ)ΠϯϑϥΤϯδχΞ͸ΞʔΩςΫτ
    • ຊ࣭͸ੲ͔ΒมΘ͍ͬͯͳ͍ͷͰ͸ͳ͍͔

    (2೥໨΋ΤϯδχΞ͍ͯ͠ͳ͍ͷͰਪଌ)

    View Slide

  16. ݚڀ՝୊ͷ੔ཧͱํ਑

    View Slide

  17. ݚڀ՝୊ͷ੔ཧͱํ਑
    • ݚڀ՝୊
    • ཁૉͱಛੑ
    • ॱ൪ɺํ਑

    View Slide

  18. ΠϯϑϥΞʔΩςΫνϟબ୒ࣗಈԽ (࠶ܝ)
    Πϯϑϥ
    ΞʔΩςΫνϟ"
    Πϯϑϥ
    ΞʔΩςΫνϟ#
    Πϯϑϥ
    ΞʔΩςΫνϟ$
    Πϯϑϥ
    ΞʔΩςΫνϟ
    ܾఆ܅
    8FCαʔϏε
    Πϯϑϥ
    ΞʔΩςΫνϟ%

    View Slide

  19. ݚڀ՝୊
    • બ୒ࣗಈԽͷͨΊͷείΞϦϯάख๏ͷཱ֬
    • WebαʔϏεͷཁૉચ͍ग़͠ͱϞσϧԽ
    • طଘͷWebαʔϏεͷௐࠪͱ෼ྨ
    • ΠϯϑϥΞʔΩςΫνϟͷཁૉͷચ͍ग़͠ͱϞσϧԽ
    • طଘͷΠϯϑϥΞʔΩςΫνϟͷௐࠪͱ෼ྨ

    View Slide

  20. αʔϏεͱΠϯϑϥͷϞσϧԽͱཁૉͷඥ෇͚
    • αʔϏεɺΠϯϑϥڞʹϞσϧԽ͕ඞཁ
    • ཁૉΛઃఆ͠ɺͦΕʹԠͯ͡ಛੑ͕͋Γɺ͍ۙ΋ͷΛબ୒
    8FCαʔϏε
    ཁૉ ཁૉ
    ཁૉ ཁૉ
    ΞʔΩςΫνϟ"
    ཁૉ ཁૉ
    ཁૉ ཁૉ
    ΞʔΩςΫνϟ#
    ཁૉ


    ཁૉ ཁૉ

    View Slide

  21. ཁૉͱಛੑ
    • ཁૉ
    • αʔϏε΍Πϯϑϥͷߏ੒ཁૉͷ͜ͱ
    • ྫ͑͹ɺσΟεΫॻ͖ࠐΈ଎౓ɺந৅తͳ΋ͷͩͱอक
    ͷ೉͠͞(ఆྔԽ͕ඞཁ)ͳͲ
    • ಛੑ
    • ཁૉʹରͯ͠ॏΈ෇͚Λͯ͠ಘΒΕΔ΋ͷ
    • nݸཁૉͷn࣍ϕΫτϧʹॏΈΛ͚ͭͯಘΒΕͨϕΫτϧ

    View Slide

  22. ॱ൪ɺํ਑
    • طଘͷΠϯϑϥΞʔΩςΫνϟͷௐࠪͱ෼ྨ
    • ΠϯϑϥΞʔΩςΫνϟͷཁૉͷચ͍ग़͠ͱϞσϧԽ
    • طଘͷWebαʔϏεͷௐࠪͱ෼ྨ
    • WebαʔϏεͷཁૉચ͍ग़͠ͱϞσϧԽ
    • બ୒ࣗಈԽͷͨΊͷείΞϦϯάख๏ͷཱ֬

    View Slide

  23. طଘͷΠϯϑϥΞʔΩςΫνϟͷௐࠪͱ෼ྨ

    View Slide

  24. طଘͷΠϯϑϥΞʔΩςΫνϟͷௐࠪͱ෼ྨ
    • ͔͜͜Βઌ͸ͲͪΒ͔ͱݴ͏ͱΈͳ͞Μͱٞ࿦͍ͨ͠
    ͱ͍͏಺༰ʹͳΓ·͢
    • MicroserviceͱServerless
    • ෼ྨͱཁૉ
    • ௐࠪํ๏

    View Slide

  25. MicroserviceͱServerless
    • બΜͩཧ༝͸୯७ʹ࠷ۙྲྀߦ͍ͬͯΔͷͰྫͱͨ͠
    • ࠓ೔ͷൃදͰ΋࿩୊ͱ্͕ͯ͠ΔͩΖ͏ͱࢥͬͨ
    • ʮϚΠΫϩαʔϏεΞʔΩςΫνϟͷͨΊͷṷత࣮
    ߦج൫ߏ૝ʯ
    • ʮαʔϏεͷύϑΥʔϚϯε਺஋ͱґଘؔ܎Λ༻͍
    ͨαʔϏεಉ࢜ͷڠௐεέʔϧߏ૝ʯ
    • ʮ࣮ߦ؀ڥͷมԽʹૉૣ͘దԠͰ͖Δ߃ৗੑΛ࣋
    ͭγεςϜΞʔΩςΫνϟʯ

    View Slide

  26. Microservice Architecture
    http://microservices.io/patterns/microservices.html

    View Slide

  27. Microservice
    • ϞϊϦγοΫͰ͸ͳ͘ɺෳ਺ͷαʔϏεʹ෼͚ͯͦΕΒΛڠௐͤ͞ɺ
    ҰͭͷαʔϏεΛߏ੒͢Δ
    • ಛʹɺෳࡶͰߴ౓ͳWebαʔϏεͰ͸༗ޮͱ͞ΕΔ
    • ػೳΛہॴԽ͠։ൃ΍ϦϦʔεΛ༰қʹ͢Δ
    • ӡ༻͸༰қʹͳΔ෦෼΋͋Ε͹ෳࡶԽ͢Δͱ͜Ζ΋͋Δ
    • ྫ͑͹αʔϏε૿ՃʹΑΔαʔόӡ༻ίετͷ૿Ճ
    • γϯϓϧͳαʔϏεʹద༻͢Δʹ͸ɺෳࡶͳΞʔΩςΫνϟ
    • ແବʹෳࡶͳߏ੒ɺΦʔόʔεϖοΫͱͳΔՄೳੑ
    • Developers must deal with the additional complexity of
    creating a distributed system. (http://microservices.io/patterns/microservices.htmlΑΓ
    )
    • ؔ࿈ൃදʮαʔϏεͷύϑΥʔϚϯε਺஋ͱґଘؔ܎Λ༻͍ͨαʔϏεಉ࢜ͷڠௐεέʔϧߏ૝ʯ
    • ؔ࿈ൃදʮϚΠΫϩαʔϏεΞʔΩςΫνϟͷͨΊͷṷత࣮ߦج൫ߏ૝ʯ
    • ؔ࿈ൃදʮ࠶ར༻ੑͷߴ͍ Test Drive Intrastructure ࣮ߦ؀ڥʹؔ͢ΔऔΓ૊Έʯ

    View Slide

  28. Serverless
    • AWS lambda ʹ୅ද͞ΕΔFaaS (Function as a Service)౳Λར༻͠ɺ
    αʔόΛҙࣝͤͣΞϓϦέʔγϣϯΛ࣮ߦ
    • αʔόӡ༻ίετ͕Լ͛ΒΕΔɺεέʔϧ͠қ͍ͳͲͷϝϦοτ
    • Microserviceͷӡ༻ίετͷ໰୊ͷղܾํ๏ͷҰͭ
    • Microservice Architectureͱڞʹ༻͍ΒΕΔ
    • ੍໿͕ଟ͍σϝϦοτ
    • ࣮ߦ؀ڥͳͲʹڧ੍͍໿͕ଘࡏ͢Δ
    • Significant limitation and constraints - A serverless deployment
    environment typically has far more constraints that a VM-based
    or Container-based infrastructure. (http://microservices.io/patterns/deployment/serverless-
    deployment.htmlΑΓ)
    • ؔ࿈ൃදʮ࣮ߦ؀ڥͷมԽʹૉૣ͘దԠͰ͖Δ߃ৗੑΛ࣋ͭγεςϜΞʔΩςΫνϟʯ

    View Slide

  29. MicroserviceͱServerless
    • Microservice͔ͭServerlessͰ͋ΔΠϯϑϥߏ੒͸Մೳ
    • ͦΕͧΕͷΞʔΩςΫνϟ͸ഉଞతͰ͸ͳ͍ɽ
    • ୯७ʹMicroserviceͱServerlessΛൺ΂ΔͳͲ͸ग़དྷͳ͍
    • ServerlessͷΑ͏ʹ੍໿͕͋ΔΞʔΩςΫνϟ͕͋Δɽ
    • Serverless͸ϞϊϦγοΫͳαʔϏεߏ੒ͩͱ࠾༻͸೉͍͠
    • ServerlessͷલʹMicroService͕͋Δͱ͍ͬͨґଘؔ
    ܎ɼ֊૚ߏ଄͕ଘࡏ͢Δɽ

    View Slide

  30. ෼ྨͱཁૉ
    • microservices.ioͰ͸ҎԼͷΑ͏ʹ෼͚ΒΕ͍ͯΔ
    • Core Patterns (Monolithic, Microservice)
    • Deployment patterns (Serverless deployment, etc…)
    • Web3૚ߏ੒ͱMicroservice͸ൺ΂ΒΕΔ͔
    • ػೳຖʹߟ͑ΒΕͨΞʔΩςΫνϟ͸ൺ΂ΒΕΔ͔
    • http://microservices.io/patterns/index.htmlΑΓ
    • ؔ࿈ൃදʮϚΠΫϩαʔϏεΞʔΩςΫνϟͷͨΊͷṷత࣮ߦج൫ߏ૝ʯ
    • ؔ࿈ൃදʮTimeFuzeΞʔΩςΫνϟߏ૝ - ॲཧͱσʔλͱλΠϚʔΛҰମԽͨ͠ఆظσʔλύΠϓϥΠϯʯ

    View Slide

  31. ෼ྨͱཁૉ
    • ΞʔΩςΫνϟͷϝϦοτɺσϝϦοτ
    • ΞʔΩςΫνϟͷ࣮૷͕༩͑Δཁૉ
    • ಉ͡ΞʔΩςΫνϟΛ࠾༻ͯ͠΋࣮૷ʹΑͬͯཁૉͷ
    ॏΈ͕มΘΔՄೳੑ͕͋Γͦ͏?
    • ࣮૷ͷΞʔΩςΫνϟ͸ߟྀ͢Δ͔?
    • ͋Δಛఆͷ༻్ʹয఺Λ౰࣮ͯͨ૷͕͋Δ৔߹ߟྀ͕
    ͋Δͱྑͦ͞͏?
    • ؔ࿈ൃදʮ෼ࢄΞϓϦέʔγϣϯʹ͓͚Δෳ਺୺຤ར༻Λߟྀͨ͠ϓϥΠϕʔτσʔλͷ؅ཧʯ
    • ؔ࿈ൃදʮߴ଎ͳϩάݕࡧΤϯδϯHayabusaʹ͍ͭͯʯ

    View Slide

  32. ௐࠪํ๏
    • ؔ࿈ݚڀͷௐࠪ
    • ࿦จௐࠪ
    • microservice.ioͳͲͷWebαΠτ
    • ࣄྫͷݕূ
    • ٕज़ษڧձͷൃදࢿྉ
    • ΤϯδχΞಉ࢜ͷަྲྀ
    • ݚڀऀͱͷަྲྀ
    • WebSystemArchitectureݚڀձΛ׆༻

    View Slide

  33. ࠓޙͷํ਑ͱ·ͱΊ

    View Slide

  34. ࠓޙͷํ਑
    • ؔ࿈ݚڀͷௐࠪ
    • ௐ͕ࠪ·ͩ·ͩ଍Γͳ͍ͷͰҾ͖ଓ͖΍Δ
    • ΠϯϑϥΞʔΩςΫνϟࣄྫͷௐࠪ
    • ௐ͕ࠪ·ͩ·ͩ଍Γͳ͍ͷͰҾ͖ଓ͖΍Δ
    • ٞ࿦

    View Slide

  35. ·ͱΊ
    • WebαʔϏεʹ͓͚ΔΠϯϑϥΞʔΩςΫνϟͷମܥԽͱ
    ΠϯϑϥΞʔΩςΫνϟͷબ୒ࣗಈԽΛ໨ࢦ͢
    • WebαʔϏεͱɺΠϯϑϥΞʔΩςΫνϟͷϞσϧԽ͕ඞ

    • ·ͣ͸طଘΠϯϑϥΞʔΩςΫνϟͷௐࠪͱ෼ྨ͕ඞཁ
    • ࿦จͷௐࠪ͸΋ͪΖΜͷ͜ͱɺٕज़ษڧձͷൃදࢿྉʹ͋
    Δࣄྫͷൺֱ΍ɺWSAݚͰఏҊ͞Εͨ৽ͨͳΞʔΩςΫ
    νϟͷٞ࿦Λߦ͍ɺΠϯϑϥΞʔΩςΫνϟͷ෼ྨΛݕ౼
    ͢Δ

    View Slide