FastContainerアーキテクチャ概論 / Reactive, Stateless and Mortal Architecture for Web Applications

FastContainerアーキテクチャ概論 / Reactive, Stateless and Mortal Architecture for Web Applications

Reactive, Stateless and Mortal Architecture for Web Applications

松本亮介 / ペパボ研究所
GMOペパボ ホスティング技術カンファレンス
~破壊的イノベーションをおこす革新的技術~

2b692bd83f4418103142a053ecf5ff59?s=128

MATSUMOTO Ryosuke

December 15, 2016
Tweet

Transcript

  1. 3FBDUJWF 4UBUFMFTTBOE.PSUBM"SDIJUFDUVSFGPS8FC"QQMJDBUJPOT দຊ྄հϖύϘݚڀॴ (.0ϖύϘϗεςΟϯάٕज़ΧϯϑΝϨϯε ʙഁյతΠϊϕʔγϣϯΛֵ͓͜͢৽తٕज़ʙ 'BTU$POUBJOFSΞʔΩςΫνϟ֓࿦

  2. ओ੮ݚڀһγχΞɾϓϦϯγύϧΤϯδχΞ দຊ྄հ!NBUTVNPUPSZ ϖύϘݚڀॴ IUUQSFTFBSDINBUTVNPUPSKQ

  3. 'BTU$POUBJOFSΞʔΩςΫνϟ֓࿦ wͳʹΛ΍Γ͍ͨͷ͔ w͜Ε·Ͱͷ՝୊ wٕज़ʹΑ࣮ͬͯݱ͍ͨ͜͠ͱ w'BTU$POUBJOFSΞʔΩςΫνϟ w·ͱΊͱࠓޙͷऔΓ૊Έ 

  4. ͳʹΛ΍Γ͍ͨͷ͔

  5. Πϯλʔωοτར༻ऀ͕շదʹ දݱͰ͖Δ৔ॴΛఏڙ͍ͨ͠

  6. Πϯλʔωοτར༻ऀ wΤϯδχΞҎ֎ͷਓͨͪ wΤϯδχΞ 

  7. 4/4ͷ೥୅ผར༻཰ ʢग़యʣ૯຿লʮࣾձ՝୊ղܾͷͨΊͷ৽ͨͳ*$5αʔϏεɾٕज़΁ͷਓʑͷҙࣝʹؔ͢Δௐࠪݚڀʯʢฏ੒೥ʣ IUUQXXXTPVNVHPKQKPIPUTVTJOUPLFJXIJUFQBQFSKBIIUNMODIUNM 

  8. ඼࣭ͷߴ͍ίϯςϯπͰ͋Ε͹ ୭΋͕4/4Λհ֦ͯ͠ࢄ͠΍͘͢ͳͬͨ

  9. αʔόμ΢ϯ͸ ֦ࢄ࣌ͷ࠷΋وॏͳػձΛୣ͏

  10. ΤϯδχΞҎ֎Ͱ΋΋ͪΖΜ ࠷΋֦ࢄ͍ͯ͠ΔػձΛಀͨ͘͠ͳ͍

  11. ؆୯ʹεέʔϧͯ͠ཉ͍͠

  12. ͜Ε·Ͱͷ՝୊

  13. Α͋͘ΔΦʔτεέʔϧ wར༻ऀʹಠࣗ࢓༷Λཁٻ wಠࣗ࢓༷Ͱॻ͚͹ࣗಈతʹϦιʔεΛׂΓ౰ͯ wΤϯδχΞҎ֎ʹ͸೉͍͠ w͜Ε·ͰͷϨϯλϧαʔόͰ͸࢓্༷೉͍͠ 

  14. Α͋͘ΔεέʔϧΞοϓ w714ͷΠϝʔδΛεφοϓγϣοτ wੑೳྑ͍714ʹΠϝʔδΛద༻ͯ͠࠶ىಈ wϦΞϧλΠϜੑ͕௿͍ w࠶ىಈͨ͘͠ͳ͍ wͳΜ͔ͩΜͩͰΤϯδχΞҎ֎ʹ͸೉͍͠ 

  15. Α͋͘ΔεέʔϧΞ΢τ wߴෛՙ࣌ʹखಈͰ7.Λ௥Ճ wෛՙʹԠͯࣗ͡ಈͰ7.Λ௥Ճ wϦΞϧλΠϜੑ͕௿͍ɾεέʔϧ͢Δ·Ͱʹख஗Ε wߴ౓ͳεΩϧ͕ඞཁ 

  16. ୯ʹ714Λ࢖͍͍ͨΘ͚Ͱ͸ͳ͍ wΧʔωϧΛ͍͡Γ͍ͨΘ͚͡Όͳ͍ wࣗ༝ʹϛυϧ΢ΣΞΛ্ཱ͍ͪ͛ͨ wͰ͖Δ͚ͩੑೳ΍Մ༻ੑΛ୲อ͍ͨ͠ wͰ͖Ε͹ӡ༻΋ຊ౰͸ͨ͘͠ͳ͍ 

  17. ϨϯλϧαʔόͷΑ͏ʹ࢝ΊΒΕͯ 714ͷΑ͏ʹࣗ༝౓͕ߴ͘ Ϋϥ΢υαʔϏεͷΑ͏ʹ֦ுੑͷߴ͍ 8FCΞϓϦέʔγϣϯͷ ϗεςΟϯάαʔϏε͕ཉ͍͠

  18. ಉ࣌ʹγϯϓϧͰӡ༻͠қ͍ γεςϜΞʔΩςΫνϟΛ࣮ݱ͍ͨ͠

  19. ٕज़ʹΑ࣮ͬͯݱ͍ͨ͜͠ͱ

  20. ࣮ݱ͍ͨ͜͠ͱ̍ʢར༻ऀ໨ઢʣ w࢖͏ͨΊͷಠࣗ࢓༷͕ۃྗٻΊΒΕͳ͍ wઐ໳తͳ஌͕ࣝͳͯ͘΋ར༻Մೳ wΧελϚΠζͨ͠8PSE1SFTT͕ී௨ʹ࢖͑Δͱ͔ wίϯςϯπҎ֎͸Ϛωʔδυ͕Մೳ wকདྷతʹ͸714తͳ࢖͍ํ΋ݟਾ͑ͨઃܭ 

  21. ࣮ݱ͍ͨ͜͠ͱ̎ʢར༻ऀ໨ઢʣ w࠶ىಈͳ͘ଈ࣌ʢΦʔτʣεέʔϧΞοϓՄೳ wϦΫΤετܖػͰʢΦʔτʣεέʔϧΞ΢τՄೳ wΞϓϦέʔγϣϯىಈத͚ͩ՝ۚର৅ wΠϕϯτυϦϒϯͰΞϓϦέʔγϣϯΛىಈՄೳ 

  22. ࣮ݱ͍ͨ͜͠ͱ̏ʢࣄۀऀ໨ઢʣ wෳࡶͳγεςϜίϯϙʔωϯτͷ࿈ܞΛݮΒ͢ wঢ়ଶΛ࣋ͭɾ࣋ͨͳ͍Λ໌֬ʹ෼཭ w੾Γ෼͚΍ϝϯςφϯε౳ӡ༻͠қ͍γεςϜઃܭ 

  23. 'BTU$POUBJOFSΞʔΩςΫνϟ

  24. JNNPSUBM

  25. ࢮͳͳ͍ɺෆࢮ਎ͷ

  26. 8FCΞϓϦέʔγϣϯͷϓϩηε͸ JNNPSUBM͕ٻΊΒΕ͖ͯͨ

  27. TIPSUMJWFE

  28. ୹໋ͷɺ͔ͭͷؒͷɺ͸͔ͳ͍

  29. όονॲཧ΍πʔϧྨ͸֓ͶTIPSUMJWFE

  30. NPSUBM

  31. ࢮΛ໔Εͳ͍ɺࢮ͢΂͖ӡ໋ͷ

  32. 'BTU$POUBJOFSJTNPSUBM

  33. 'BTU$(*JTBMTPNPSUBM

  34. 'BTU$(*Ϟσϧ 'BTU$(*QSPDFTT QIQDHJJOEFYQIQ 'BTU$(*QSPDFTT GPSL ҰఆظؒܦաޙUFSNJOBUFQSPDFTT FYFDWF 1BSFOUIUUQEQSPDFTT PXOFSSPPU $IJMEIUUQEQSPDFTT

    PXOFSBQBDIF Ұఆظؒ࢖͍·Θ͢ 8FCαʔόͰ$(*Λ࣮ߦ͢ΔͨΊͷͻͱͭͷΞʔΩςΫνϟ 
  35. 'BTU$(*Ϟσϧ 'BTU$(*QSPDFTT QIQDHJJOEFYQIQ 'BTU$(*QSPDFTT GPSL ҰఆظؒܦաޙUFSNJOBUFQSPDFTT FYFDWF 1BSFOUIUUQEQSPDFTT PXOFSSPPU $IJMEIUUQEQSPDFTT

    PXOFSBQBDIF Ұఆظؒ࢖͍·Θ͢ 8FCαʔόͰ$(*Λ࣮ߦ͢ΔͨΊͷͻͱͭͷΞʔΩςΫνϟ ඇৗʹNPSUBMͳৼΔ෣͍ 
  36. 'BTU$(*ͷϝϦοτ w$(*ͱൺֱͯ͠ϦΫΤετຖͷϓϩηεੜ੒ഁغΛߦ Θͳ͍ͨΊੑೳ͕ߴ͍ wҰఆ࣌ؒͰϓϩηεഁغ͕ߦΘΕΔͨΊϓϩηε਺͕ ૿͑ଓ͚Δ͜ͱͳ͘Ϧιʔεޮ཰΋ൺֱతྑ͍ w$(*JTTIPSUMJWFE IUUQEJTJNNPSUBM 

  37. 'BTU$(*ΛϞμϯʹߟ࡯ w&WFOU%SJWFOʹ8FCαʔόΛىಈՄೳ w8FCαʔόΛ࢖͍ࣺͯ͢ΔJNNVUBCMFͳॲཧ wҰఆظؒϓϩηεϓʔϧՄೳͳॲཧํࣜ 3FBDUJWFͰ4UBUFMFTTʹಈ࡞͢ΔNPSUBMͳ8FCαʔ όϞσϧͰ͋Δ ͱ΋ݴ͑Δ 

  38. 'BTU$(*ΛԠ༻ wىಈର৅Λ$(*͔Βίϯςφ΁ wίϯςφىಈ͕஗͍΋ͷ͸$3*6ͰΠϝʔδԽ wϦΫΤετܖػͰίϯςφΛىಈͤ͞Δ wίϯςφͰ͋Ε͹ىಈ͕଎͘Ԡ༻ՄೳͰ͸ͱ͍͏ൃ૝ 

  39. 'BTU$POUBJOFS

  40. 8FCΞϓϦέʔγϣϯ࣮ߦج൫ͱͯ͠ͷ 'BTU$(*Λ࣮ݱ͢Δ

  41. 'BTU$POUBJOFSJTSFBDUJWF TUBUFMFTT BOENPSUBMBSDIJUFDUVSF GPS8FCBQQMJDBUJPOT

  42. 'BTU$POUBJOFSϑϩʔ֓ཁ )PTU04 'BTU$POUBJOFS )PTU04 8FC1SPYZ -PDBM 8FC1SPYZ 4UPSBHF $.%# DPOUBJOFS

    FOHJOF -74 $MJFOU 8FC1SPYZ 8FC1SPYZ -74 -74 ίϯςφ ৔ॴऔಘ ίϯςφ΁ ϓϩΩγ ίϯςφ΁ϓϩΩγ ϓϩΩγઌ͕ෳ਺͋Δ৔ ߹͸͍ͣΕ͔Λબ୒ ίϯςφىಈࢦࣔ ʢίϯςφఀࢭ࣌ʣ ίϯςφىಈ ʢίϯςφఀࢭ࣌ʣ ίϯςφ΁ ϓϩΩγ ίϯςφ΁ ΞΫηε 'BTU$POUBJOFS 'BTU$POUBJOFS 'BTU$POUBJOFS 8FC1SPYZ -PDBM ίϯςφ৘ใऔಘ ʢίϯςφఀࢭ࣌ʣ $MJFOU $MJFOU $MJFOU $MJFOU 
  43. ϦΫΤετܖػͷίϯςφىಈ֓ཁ 8FC1SPYZ ʢOHY@NSVCZ $.%# -PDBM8FC1SPYZ OHY@NSVCZ -74 ίϯςφ ίϯςφ ίϯςφ

    PSϙʔτΛ 8FC1SPYZ΁ྲྀ͢ )551ϦΫΤετ͔Β )PTUOBNFΛΩʔʹɺ $.%#͔Βϗετ04ͷ*1 ΞυϨεͱίϯςφͷ*1Ξ υϨεͱϙʔτ౳Λऔಘ )551 4  ϦΫΤετ ίϯςφͷ*1ΞυϨεɾϙʔτ ʹج͍ͯίϯςφʹϓϩΩγɻ ίϯςφͷ*1ΞυϨεɾϙʔτ ͸ɺ8FC1SPYZ͔Βϔομͱ ͯ͠෇༩͞Εͯ͘Δɻ ίϯςφ͕-JTUFO͍ͯ͠ͳ͍৔ ߹͸$.%#͔Βίϯςφ৘ใ Λಘͯىಈͤ͞Δɻ $POUBJOFS&OHJOF IBDPOJXB Πϯλʔωοτ ϓϥΠϕʔτ ωοτϫʔΫ $MJFOU 
  44. 'BTU$POUBJOFSͷγεςϜ؅ཧଆͷಛ௃ w$.%#ʹऩ༰ઌΛ௥Ճ͢Δ͚ͩͰεέʔϧΞ΢τՄೳ wεέʔϧΞ΢τͯ͠΋͍Βͳ͘ͳͬͨΒউखʹఀࢭ wίϯςφͳͷͰىಈͨ͠··εέʔϧΞοϓՄೳ wίϯςφͷϗετؒҠಈ΍ෳ੡ɾഁغ͕༰қ wγεςϜ΍ϥΠϒϥϦ͕౎౓࠷৽ͷঢ়ଶ΁ 

  45. 8FCBQQίϯςφߴूੵ࣌ͷ෼ྨ JNNPSUBM TIPSUMJWFE NPSUBM ੑೳ ̋ ✕ ˚ Ϧιʔε ✕

    ˚ ̋ εέʔϧ ˚ ̋ ̋ ӡ༻ɾอक ✕ ̋ ̋ ϓϩηεྫ ىಈͬ͠ͺͳ͠ͷ ίϯςφ ϦΫΤετ୯ҐͰ ίϯςφىಈ 'BTU$POUBJOFS 
  46. 'BTU$POUBJOFS࣌ͷσʔλઃܭྫ ετϨʔδ ϗετ04 ϗετ04 ϚελʔγεςϜΠϝʔδ 'BTU$POUBJOFSӡ༻ର৅ʣ Ϛελʔ8&#ϛυϧ΢ΣΞΠϝʔδ 'BTU$POUBJOFSӡ༻ର৅ʣ "ϢʔβσʔλྖҬ WBSMJCIBDPOJXBDPOUBJOFS"

    VTSMPDBMBQBDIF IUEPDT #ϢʔβσʔλྖҬ WBSMJCIBDPOJXBDPOUBJOFS# VTSMPDBMBQBDIF IUEPDT $ϢʔβσʔλྖҬ WBSMJCIBDPOJXBDPOUBJOFS$ Ϛελʔ44)ϛυϧ΢ΣΞΠϝʔδ ӡ༻ର৅ʣ WBSMJCIBDPOJXBDPOUBJOFS% IPNFVTFS VTSMPDBMTTIE Ϛ΢ϯτ Ϛ΢ϯτ
  47. 'BTU$POUBJOFS࣌ͷωοτϫʔΫߏ੒ྫ )PTU04 -PDBM8FC1SPYZ $POUBJOFS&OHJOF $POUBJOFS.BOBHFS CS $POUBJOFS OFUOT WFUI /*$

    $POUBJOFS OFUOT WFUI 4FSWJDF /FUXPSL 8FC1SPYZ FUI -74 FUI FUI *OUFSOFU )PTU04 -PDBM8FC1SPYZ $POUBJOFS&OHJOF $POUBJOFS.BOBHFS CS $POUBJOFS OFUOT WFUI /*$ $POUBJOFS OFUOT WFUI $.%# FUI FUI FUI FUI .BOBHFE /FUXPSL FUI 4UPSBHF /FUXPSL FUI FUI 4UPSBHF
  48. ·ͱΊ

  49. ·ͱΊ wΤϯδχΞҎ֎ͷਓͨͪͰ΋࢖͑Δշదͳ৔ॴͷఏڙ w৽͍͠ΞʔΩςΫνϟʹΑͬͯ՝୊Λٕज़తʹղܾ w'BTU$POUBJOFSΞʔΩςΫνϟͷఏҊ w8FCΞϓϦέʔγϣϯΛNPSUBMʹ࣮ߦ͢Δ wաڈͷރΕٕͨज़͕࣌୅എܠͱڞʹ࠶౓׆͖Δ 

  50. ࠓޙͷऔΓ૊Έ

  51. 'BTU$POUBJOFSͷΑ͏ʹഁյͱ࠶ߏஙΛ NPSUBMʹߦ͍ͳ͕Βಈతʹฏߧঢ়ଶΛอͪ ͦͷଞίϯϙʔωϯτΛωοτϫʔΫΛհͯ͠ แׅ͢ΔγεςϜ

  52. %JNFOTJPOGSFF"VUPOPNPVT 0QFSBUJOH4ZTUFN ͱఆٛ

  53. %"04

  54. %"04ʹ͓͚Δϓϩηε͸ ಈతฏߧͷܥʹ͋Δ7.ͷΑ͏ͳ΋ͷ

  55. %"04ʹ͓͚ΔεϨου͸ 'BTU$POUBJOFSͷίϯςφͷΑ͏ͳ΋ͷ

  56. %"04ʹ͓͚ΔεϨουΛ.PSUBMͱ໋໊

  57. %"04Ͱͷ֤ίϯϙʔωϯτ͸ωοτϫʔΫΛհͯ͠઀ଓ͢Δ %"04ͷΠϝʔδ -JOVY -JOVY -JOVY -JOVY %"04ͷγεςϜίʔϧϨΠϠʔʢ)BDPOJXBʣ .PSUBM %"04ͷεϨουʣ .PSUBM

    %"04ͷεϨουʣ .PSUBM %"04ͷεϨουʣ .PSUBM %"04ͷεϨουʣ .PSUBM %"04ͷεϨουʣ .PSUBM %"04ͷεϨουʣ .PSUBM %"04ͷεϨουʣ .PSUBM %"04ͷεϨουʣ %"04 Ϣʔβϥϯυ %"04 Χʔωϧ 
  58. %"04Λج൫ͱͨ͠ ͳΊΒ͔ͳγεςϜ΁

  59. None
  60. ݚڀһੵۃతʹืूத IUUQSBOEQFQBCPDPN