$30 off During Our Annual Pro Sale. View Details »

次世代PaaSとServerless 未来はどこにある?

次世代PaaSとServerless 未来はどこにある?

2016年10月の第34回PaaS勉強会で発表した資料です

Kazuto Kusama

May 11, 2017
Tweet

More Decks by Kazuto Kusama

Other Decks in Technology

Transcript

  1. ࣍ੈ୅PaaSͱ
    Serverless

    ະདྷ͸Ͳ͜ʹ͋Δʁ

    View Slide

  2. Kazuto Kusama
    @jacopen

    View Slide

  3. ͜ͷൃද͸ݸਓͷݟղͰ͋Γɺ
    ॴଐ͢Δ૊৫ͷެࣜݟղͰ͸͋Γ·ͤΜ
    ஫ҙ

    View Slide

  4. ࠷ۙPaaSͬͯͲ͏Ͱ͔͢ʁ
    ੝Γ্͕ͬͯΔʁ

    View Slide

  5. ࣄ࣮:
    “PaaS”ͱ͍͏͚ͩͰ͓ۚΛग़ͯ͠

    ໯͑Δ࣌୅͸ͱͬ͘ʹऴΘͬͨ
    㱺όζϫʔυͱͯ͠͸Φϫίϯ

    View Slide

  6. ϋΠϓɾαΠΫϧ
    https://www.gartner.co.jp/research/methodologies/research_hype.php

    View Slide

  7. ϋΠϓɾαΠΫϧ
    https://www.gartner.co.jp/research/methodologies/research_hype.php
    ͓͔Ͷͨͬ΀Γ
    ϘʔφελΠϜ
    PaaS͸ଟ෼͜ͷ΁Μ

    View Slide

  8. ʮPaaSͰṶ͔͍ͬͯΔձࣾʯ

    ͱݴΘΕͯࢥ͍ු͔΂Δձ͕ࣾগͳ͍
    ͳͥʁ
    㱺Ϗδωεͱͯ͠ͷকདྷੑ͕ෆ͔֬

    View Slide

  9. ͔֬Β͍͠ະདྷ

    View Slide

  10. ͜Ε͔ΒPaaSͱ͍͏ݴ༿͸
    ࢖ΘΕͳ͘ͳ͍ͬͯ͘
    ͔֬Β͍͠ະདྷ

    View Slide

  11. “Cloud Native Platform”

    View Slide

  12. “Container Platform”

    View Slide

  13. “Container as a Service”

    View Slide

  14. Կނʮ୤PaaS͔ʯ
    • PaaSͱ͍͏ݴ༿ͷ෼͔ΓͮΒ͞
    • ΑΓαʔϏεͷੑ֨Λද͢ݴ༿ʹ
    • PaaSͰେ੒ޭͨ͠ྫ͕͋·Γͳ͍ͷͰɺϏδωεతʹ

    ྑ͍ҹ৅͕ͳ͍

    View Slide

  15. ͦ΋ͦ΋Կނ੒ޭ͠ͳ͔ͬͨͷ͔Ծઆ
    • ϩοΫΠϯ
    • ϕϯμʔ͸ʮϩοΫΠϯͯ͠ͳ͍ʯͱ͍͏ɻ

    ʮΦʔϓϯͳٕज़͕ͦͷ··࢖͑ΔΑʂʯɹŋŋŋͦ͏͍͏໰୊͡Όͳ͍

    • ҙࣝվֵͷ೉͠͞
    • ϓϩηε͸εςʔτϑϧʹʂ ઃఆ͸؀ڥม਺ʹʂϩά͸ඪ४ग़ྗʹʂ 

    ͜ΕͰΫϥ΢υωΠςΟϒΞϓϦέʔγϣϯͩʂɹŋŋŋ͑ʔΊΜͲ͍͘͞
    • യવͱͨ͠ෆ҆

    View Slide

  16. ͜Ε͔ΒͷPaaS͸
    Ͳ͏ͳΔͷ͔

    View Slide

  17. ୈ1ੈ୅ͷPaaS
    • 2007೥ʙ2010͝Ζ·Ͱ
    • ϓϩϓϥΠΤλϦ
    • ܾΊଧͪͷݴޠɾϑϨʔϜϫʔΫɾDB

    View Slide

  18. ୈ2ੈ୅ͷPaaS
    • 2011೥ʙ
    • ϓϩϓϥΠΤλϦ / Φʔϓϯ
    • ༷ʑͳݴޠɾϑϨʔϜϫʔΫɾDB
    • Ծ૝Խٕज़Λϑϧ׆༻

    View Slide

  19. ୈ3ੈ୅ͷPaaS
    • 2014೥ʙ
    • ίϯςφωΠςΟϒ
    • Ͳͷ؀ڥͰ΋ɺಉ͡΋ͷ͕࢖͑Δ
    • ΑΓૣ͘ɺΑΓॊೈʹɺΑΓΦʔϓϯʹ

    View Slide

  20. ୈ4ੈ୅ͷPaaS

    View Slide

  21. • ߏ੒͍ͨ͠ΠϯϑϥΛίʔυͰදݱɻIaaSͱಉ౳ͷॊೈੑΛɺ
    ΑΓߴ଎ʹɺΑΓ؆୯ʹɺΑΓޮ཰Α࣮͘ݱग़དྷΔɻ
    • ͜Ε·ͰͷPaaS

    ʮΠϯϑϥ͸ҙࣝ͠ͳ͍͍ͯ͘ɻ

    ɹͱʹ͔͘Ξοϓϩʔυͯ͘͠Εɺ͋ͱ͸Կͱ͔͢Δʯ

    㱺HerokuͳͲͰ࣮ݱͨ͠ੈքɻ͘͢͝؆୯ʹ࢖͑Δɻ
    Infrastructure as CodeΛ
    ࣮ݱ͢Δ
    ϓϥοτϑΥʔϜ

    View Slide

  22. • ͲͷΞϓϦΛԿݸ্ཱͪ͛ͯɺ

    Ͳ͏͍͏NWߏ੒ʹͯ͠

    ʓʓΛϚ΢ϯτͯ͠

    XXXͱ͍͏ίϯϑΟάΛೖΕͯŋŋŋ


    ͱ͍ͬͨߏ੒৘ใΛίʔυͰ؅ཧ

    σϓϩΠ͢Δͱج൫ଆ͕͏·͍͜ͱ

    ࣮ݱͯ͘͠ΕΔɻ

    ίϯςφٕज़΍SDNͳͲͷ߹Θٕͤ

    View Slide

  23. Infrastructure as CodeΛ
    ࣮ݱ͢Δ
    ϓϥοτϑΥʔϜ
    • Google͕BorgͰ࣮ূࡁ
    • BorgΛࢀߟʹ࡞ΒΕ͍ͯΔKubernetesɺ

    KubernetesϕʔεͷOpenShift͸ɺঃʑʹ͜ͷੈքΛ

    ࣮ݱ͍ͯ͠Δ
    • Docker΋ɺόʔδϣϯΛ௥͏͝ͱʹ࣮૷ͭͭ͋͠Δ

    View Slide

  24. • ෳࡶʹͳͬͯ͋ΔҙຯୀԽͯ͠ͳ͍ʁ
    • ෳࡶͳ͜ͱ͕ग़དྷΔϓϥοτϑΥʔϜΛϥοϓͯ͠

    ؆୯ʹ࢖͏ͷ͸Մೳ
    • ؆୯ͳ͜ͱ͔͠ग़དྷͳ͍ϓϥοτϑΥʔϜͰෳࡶͳ͜ͱΛ
    ͢Δͷ͸ࠔ೉
    Infrastructure as CodeΛ
    ࣮ݱ͢Δ
    ϓϥοτϑΥʔϜ

    View Slide

  25. • Herokuͷ12 Factor app͸ྑ͘ग़དྷͨߟ͑
    • ग़དྷΔݶΓStatelessʹ࡞Δ͜ͱͰɺεέʔϥϒϧͰϝϯς

    ͠΍͍͢ɺΫϥ΢υωΠςΟϒͳΞϓϦέʔγϣϯ͕࡞ΕΔ
    • ͡Ό͋DB΍MQͳͲͷStatelessʹग़དྷͳ͍΋ͷ͸ʁ

    㱺 ʮΞλον͞ΕͨϦιʔεͱͯ͠ѻ͏ʯ

    㱺ӡ༻͸୭͕΍ͬͯ΋ྑ͍Μ͚ͩͲɺϦιʔεͱͯ͠෼཭ͯ͠

    ߟ͑Ε͹͍ΖΜͳέʔεʹରԠͰ͖ΔΑ
    Stateful applicationͷαϙʔτ

    View Slide

  26. Container 2.0
    • Mesosphere͕ݴ͍࢝Ίͨ
    • Stateful application޲͚ͷ

    εέδϡʔϥΛDC/OSͰ

    αϙʔτɻ྆ํΛಉ͡ج൫্Ͱ

    ࣮ݱͰ͖Δ

    View Slide

  27. View Slide

  28. Stateful Sets (Pet Sets)
    • KubernetesͰ࣮૷͕ਐΜͰ͍Δ
    • k8s্ͰɺैདྷͷΞϓϦέʔγϣϯΛ

    αϙʔτ͢Δ࢓૊Έ
    • ӬଓԽϘϦϡʔϜ

    ݻఆ͞ΕͨHostname

    ໊લղܾ

    View Slide

  29. Stateful Sets (Pet Sets)
    • εέʔϥϒϧͳΞʔΩςΫνϟΛ࡞Δ৔߹ɺϦιʔεΛϖοτ

    Ͱ͸ͳ͘ɺՈச(Cattle)ͷΑ͏ʹѻ͏ͷ͕͍͍ɻ
    • ͜Ε·ͰͷΫϥ΢υ͸ɺ͜ͷCattleΛڧ੍͖ͯͨ͠અ͕͋Δ
    • Ͱ΋શͯͷΞϓϦέʔγϣϯ͕௒ઈεέʔϧ͢Δඞཁ͋ΔΜ͚ͩͬʁ

    View Slide

  30. Serverless
    ͓ۚग़ͯ͠໯͑Δ ྲྀߦΓͷϫʔυ

    View Slide

  31. View Slide

  32. PaaS
    • ServerؚΊͨɺApplicationͷӡ༻Λݞ୅ΘΓ͢Δ
    Serverless
    • ServerΛͦ΋ͦ΋ҙࣝ͠ͳ͍

    View Slide

  33. Serverless͕ͦ͜ະདྷʂ

    View Slide

  34. ຊ౰ʹͦ͏ͳͷ͔ʁ

    View Slide

  35. ઌʹݴ༿ͷ੔ཧ
    FaaS (Functions as a Service)
    γϯϓϧͳίʔυΛFaaSʹॻ͍͓ͯ͘ͱɺࢦఆͨ͠ΠϕϯτʹԠͯ͡
    ίʔυ͕࣮ߦ͞ΕΔαʔϏεɻ AWS Lambda΍Azure Functionsɺ
    OpenWhiskͳͲ
    BaaS (Backend as a Service)ɺFunctional SaaS
    ೝূ΍ϓογϡ഑৴ͳͲɺϞόΠϧΞϓϦ΍SPAͰඞཁͳػೳΛαʔ
    Ϗεͱͯ͠ఏڙ͢ΔɻFirebase΍ɺαʔϏεऴྃͨ͠ParseͳͲ

    View Slide

  36. ઌʹݴ༿ͷ੔ཧ
    FaaS (Functions as a Service)
    γϯϓϧͳίʔυΛFaaSʹॻ͍͓ͯ͘ͱɺࢦఆͨ͠ΠϕϯτʹԠͯ͡
    ίʔυ͕࣮ߦ͞ΕΔαʔϏεɻ AWS Lambda΍Azure Functionsɺ
    OpenWhiskͳͲ
    BaaS (Backend as a Service)ɺFunctional SaaS
    ೝূ΍ϓογϡ഑৴ͳͲɺϞόΠϧΞϓϦ΍SPAͰඞཁͳػೳΛαʔ
    Ϗεͱͯ͠ఏڙ͢ΔɻFirebase΍ɺαʔϏεऴྃͨ͠ParseͳͲ
    㱺 BaaS+PaaSͷ૊Έ߹Θͤ͸ҎલΑΓҰൠతʹߦΘΕ͍ͯΔ

    ͷͰɺ͔͜͜Βઌ͸FaaSʹ͍ͭͯݴٴ͠·͢

    View Slide

  37. API Gateway
    ObjectStorage
    etc…
    Functions
    Πϕϯτ
    Πϕϯτ
    Πϕϯτ
    ࣮ߦ
    output
    etc…
    ΠϕϯτυϦϒϯ
    Πϕϯτड͚෇͚ͨͱ͖ͷ
    ॲཧ಺༰Λॻ͍͓ͯ͘
    FaaSͷಈ͖

    View Slide

  38. API Gateway
    ObjectStorage
    etc…
    Application
    output
    etc…
    ಉ͜͡ͱΛPaaSͰ΍Ζ͏ͱ͢Δͱɾɾɾ
    HTTPͳΓԿͳΓͰ

    ΠϕϯτΛड͚෇͚Δ
    ޱΛͭ͘Δ
    αʔόʔϓϩηε(Πϯελϯε)
    Λ্ཱͪ͛ͯ଴ػͤ͞Δ
    Πϕϯτड͚෇͚ͨͱ͖ͷ
    ॲཧ಺༰Λॻ͍͓ͯ͘

    View Slide

  39. API Gateway
    ObjectStorage
    etc…
    Application
    output
    etc…
    ͜͏͍͏ͱ͖Ͳ͏͢Δʁ
    શવΠϕϯτ͕དྷͳ͍ͱ͖΋Πϯελϯε͸
    ͣͬͱ্ཱ͓͔ͪ͛ͯͳ͚Ε͹͍͚ͳ͍

    View Slide

  40. API Gateway
    ObjectStorage
    etc…
    Application
    output
    etc…
    ͜͏͍͏ͱ͖Ͳ͏͢Δʁ
    ಥવΠϕϯτ͕ٸ૿ͨ͠ͱ͖ʹ
    ΠϯελϯεΛεέʔϧͤ͞Δૢ࡞͕ඞཁ
    ɾ
    ɾ
    ɾ

    View Slide

  41. PaaSʹग़དྷͳͯ͘FaaSʹग़དྷΔ͜ͱ
    • PaaSͰ͸ɺΠϕϯτ͕ى͖ͳ͍࣌Ͱ΋ৗʹϓϩηε্͕͕Δɻ·
    ͨɺಥવΠϕϯτ͕ٸ૿ͨ͠ͱ͖͸ɺϓϩηεΛ૿΍͢ͱ͍͏ૢ
    ࡞ΛࣗಈͳΓखಈͳΓͰߦΘͳͯ͘͸͍͚ͳ͍ɻ

    (ͦΕͰ΋ɺIaaS΍ΦϯϓϨϛεΑΓ͸͍ͩͿָ)
    • FaaS͸ࡉ͔ͳॲཧ୯ҐͰFunction͕࡞ΒΕɺΠϕϯτͷ౓ʹϓϩ
    ηε্͕͕Γɺॲཧ͕ऴΘΔͱϓϩηε΋ফ͑Δɻ

    Πϕϯτ͕ى͖ͳ͍ͱϦιʔε͸ফඅ͠ͳ͍ɻେྔͷΠϕϯτൃੜ
    ࣌΋ͦΕʹԠͯ͡ϓϩηε্͕͕Γɺফ͍͑ͯ͘

    View Slide

  42. FaaS vs PaaS
    • FaaS͸PaaSʹ࢒͍ͬͯͨʮӡ༻ʯ͕ແ͘ͳ͍ͬͯΔ
    • ΑΓεέʔϥϒϧɺ͔ͭޮ཰ͷྑ͍࢓૊ΈΛ࡞ΕΔ
    • ػೳ୯ҐͰ෼͚͟ΔΛಘͳ͍

    㱺 εςʔτΛ࣋ͨͤΔ͜ͱ͕೉͍͠

    㱺 ݁Ռͱͯ͠εέʔϥϒϧʹͳΔ

    View Slide

  43. FaaS is better than PaaS?
    • ͦΜͳ͜ͱ͸ͳ͍
    • PaaSͷΑ͏ͳෳࡶͳॲཧΛ1FunctionͰߦΘͤΔ͜ͱ͸ग़དྷͳ͍
    • WebαʔόʔͷΑ͏ͳίϯςϯπΛ഑৴͢ΔΑ͏ͳ

    ࢓૊ΈͰ΋ͳ͍
    • PaaSͰಈ͔͢ΞϓϦ͸ɺϩʔΧϧͰ΋IaaSͰ΋ΦϯϓϨͰ΋

    ಈ͘Α͏ʹ࡞ΕΔɻFaaS͸FaaS༻ͷ଄Γʹͤ͟ΔΛಘͳ͍

    View Slide

  44. PaaS ͱ FaaS Λਖ਼͘͠࢖͍෼͚Δߟ͑ํ
    Hub Glue

    View Slide

  45. PaaS = Hub
    Application
    database
    monitoring message queue
    mail
    logging
    CI/CD

    View Slide

  46. App
    database
    monitoring message queue
    mail
    logging
    CI/CD
    ΞϓϦέʔγϣϯ͕த৺(Hub)ͱͳΔɻ
    ΍Γ͍ͨ͜ͱ͸ΞϓϦʹॻ͘
    PaaS͸ӡ༻ͷݞ୅ΘΓͱ
    ศརͳػೳΛఏڙ͢Δ

    View Slide

  47. FaaS = Glue
    database
    mail
    CI/CD
    Object Storage
    API Gateway
    Function
    messaging
    Function
    Function

    View Slide

  48. {}
    {}
    {}
    FaaS͸ɺ֤Ϋϥ΢υαʔϏεΛܨ͛ΔͨΊͷކ (Glue)
    ΍Γ͍ͨ͜ͱ͸ɺ֤αʔϏεΛܨ࣮͛ͯݱ͢Δ
    ֤FunctionͰ͸ෳࡶͳ͜ͱ͸ͤͣ͞ɺ
    γϯϓϧͳॲཧʹཹΊΔ

    View Slide

  49. ʮ΋͋͠ͳͨͷPaaS͕ɺ0.5ඵ͚ͩಈ͘ΠϯελϯεΛ
    ɹɹ20msͰىಈͰ͖ΔͳΒɺͦΕ͸αʔόʔϨεͱݺͿʯ

    View Slide

  50. • ΞϓϦέʔγϣϯͷ։ൃͱӡ༻Λศརʹ͢Δ΋ͷ͕PaaS
    • ͜Ε·Ͱͷߟ͑ํΛɺΫϥ΢υͰΑΓศརʹ
    • ͞·͟·ͳΫϥ΢υαʔϏεΛ׆༻͠ɺͪΐͬͱͨ͠ίʔυͰ

    ͋Ε͜Ε࣮ݱ͢Δͷ͕FaaS
    • Ϋϥ΢υ͋Γ͖ͷαʔϏεʢΨνͰϩοΫΠϯ͞ΕΔؾ͕ແ͍ͱ࢖͑ͳ͍ΑͶŋŋŋ
    • ͜Ε͚ͩΫϥ΢υαʔϏε͕ॆ࣮͍ͯ͠ΔΜ͔ͩΒ׆༻͠Α͏ʂ
    ͦ΋ͦ΋ͷߟ͑ํ͕ҧ͏ͷͰɺ৔߹ʹԠͯ͡࢖͍෼͚Α͏

    View Slide

  51. ͪͳΈʹPaaSษڧձͷϞοτʔ

    View Slide

  52. PaaSʹؔΘΔ͜ͱͳΒԿͰ΋OK
    ͭ·ΓServerlessωλ΋OK

    View Slide

  53. ࣍ճҎ߱ɺServerlessωλ΋େ׻ܴ

    View Slide

  54. Questions?

    View Slide