分散アプリケーションアーキテクチャ 2015

B4afc7d853d7f1cb6a253d3c7183c05a?s=47 Naoya Ito
October 14, 2015

分散アプリケーションアーキテクチャ 2015

Developer Summit 2015 Autumn での講演資料です

B4afc7d853d7f1cb6a253d3c7183c05a?s=128

Naoya Ito

October 14, 2015
Tweet

Transcript

  1. ෼ࢄΞϓϦέʔγϣϯ ΞʔΩςΫνϟ /BPZB*UP ,BJ[FO1MBUGPSN *OD  %FWFMPQFS4VNNJU"VUVNO

  2. ґཔ •  ʮ8FCςΫϊϩδʔͷ࠷લઢɺಛʹେྔͷτϥϑΟοΫ ͱσʔλͷ࠷લઢͰઓ͏։ൃऀͱΠϯϑϥΤϯδχΞͷ ͨΊͷςΫϊϩδʔϚοϓΛఏ͍ࣔͯͩ͘͠͞ʯ •  ʮૄ݁߹Ͱڧਟͳ8FCγεςϜΛ࡞Γɺ·ͨӡ༻ɺ %FW0QTɺεέʔϧΞ΢τ্͍ͤͯ͘͞Ͱԡ͓͑ͯ͘͞ ΂͖τϐοΫΛڍ͍͛ͯͩ͘͞ʯ

  3. େྔτϥϑΟοΫͱσʔλ •  ͔ͭͯ͸-".1Ͱ3%#ʹೖΕͯɺॲཧ͖͠Εͣʹۤ ͠ΜͰ͍ͨ –  ෳࡶͳόονΛྲྀ͢ͱ*0͕٧·Δ –  ಉظॲཧͷ8FCΞϓϦέʔγϣϯͰ͸ϦΞϧλΠϜʹσʔλΛ ը໘ʹ൓ө͢ΔͷʹҰۤ࿑

  4. ࡢࠓ •  όον –  )BEPPQ΍#JH2VFSZతͳ΋ͷʹ೚ͤΔ –  ͜ΕͰ೰Ήػձ͸গͳ͘ͳͬͨ  •  όονͰ͸ͳ͍ॲཧ

    ετϦʔϜ  –  ·ͩྗۀͰ৐Γ੾͍ͬͯΔˡ͍·͜͜ –  ,BJ[FO1MBUGPSNͰ͸ •  "#ςετͷMPHΛड͚औͬͯܭࢉ͢ΔαʔόʔFUD –  ඞવతʹ෼ࢄγεςϜʹ –  ͜ͷล͜Ε͔ΒͲ͏ͳ͍ͬͯ͘ΜͩΖ͏  σʔλॲཧج൫΍ෛՙ෼ࢄʹͭ ͍ͯ͸ॾઌഐ͕ޠΔͱࢥ͏ͷͰɺ ΞϓϦέʔγϣϯɾΞʔΩςΫ νϟʹ͍ͭͯ
  5. 3FBMUJNF8FC

  6. ϦΞϧλΠϜ8FC •  ͦ͏ݴΘΕͯ͸΍೥ –  ͋·Γฉ͔ͳ͘ͳͬͨ –  ഇΕͨΘ͚Ͱ͸ͳ͘ 5XJUUFS΍'BDFCPPL͕ୡ੒͠ɺࡢࠓ͸ ίϞσΟςΟʹ • 

    Ͱ΋ɺ·͚ͩͬ͜͏ྗۀͰ࡞͍ͬͯΔ –  Ұ෦ʹ1VC4VCͷϛυϧ΢ΣΞΛೖΕͯŋŋŋ –  ཪͰ͸1PMMJOHͯ͠ϦΞϧλΠϜʹݟ͔͚ͤͯŋŋŋ –  ಉظͳ+40/PWFS)551Ͱŋŋŋ
  7. None
  8. 3FBDUJWF4ZTUFN •  4DBMBͷ1MBZ"LLB౳ͷ5ZQFTBGF͕ࣾఏҊ͢ΔϞ μϯͳ8FC ౳ͷ γεςϜํࣜ –  5ZQFTBGF3FBUJWF1MBUGPSN •  1MBZ"LLB4MJDL4QBSLͳͲΛ࢖ͬͯϦΞϧλΠϜͳγεςϜ

    Λମܥཱͬͨख๏ͰߏஙͰ͖Δ  •  3FBDUJWF.BOJGFTUPΛຬͨ͢ –  IUUQXXXSFBDUJWFNBOJGFTUPPSH –  ˞ͳ͓ɺ͜ͷจॻʹؔͯ͠͸3FBDUJWFͱ͍͏ݴ༿ͷ࢖͍ํʹ͍ͭͯ൷൑͕͋ΔͷͰ஫ҙ •  QPLBSJN͞Μͷ3FBDUJWF.BOJGFTUPʹؔ͢Δҹ৅IUUQUPHFUUFSDPNMJ
  9. 3FBDUJWF.BOJGFTUP •  ࡢࠓͷ෼ࢄΞϓϦέʔγϣϯ͕ٻΊΔੑ࣭ •  ϝοηʔδύογϯάɺϊϯϒϩοΩϯάɺ4IBSFE/PUIJOHɺૄ݁߹Ͱ࣮ݱ͠Α͏ͱ ͍͏͜ͱΛఏҊ

  10. h"ps://speakerdeck.com/okapies/reac1ve-streams-ru-men-number-jjug

  11. 3FBDUJWF4ZTUFNͷ࣮ࡍ •  શͯͷίϯϙʔωϯτ͕ඇಉظΠϯλϑΣʔεΛ࣋ͭ –  8FCϑϨʔϜϫʔΫ 1MBZ ɺϝοηʔδج൫ "LLB ɺσʔλ 4MJDL

    4QBSL  –  'VUVSFͰந৅Խ –  ૬ޓ઀ଓ͸3FBDUJWF4USFBNTʹै͏ •  3FBDUJWF4USFBNT –  ͢΂͕ͯඇಉظˠྲྀྔ੍ޚ͕ඞཁ •  σʔλΛྲྀ͠·͘Δͱܾյͯ͠͠·͏ –  +7.ॲཧܥʹ͓͚Δ1VC4VC ྲྀྔ੍ޚ CBDLQSFTTVSF ͷ "1*࢓༷ͷඪ४Խ •  ϛυϧ΢ΣΞ޲͚ͷ"1*Ͱ͋ΓɺϢʔβʔ͸ҙࣝ͠ͳ͍
  12. h"p://www.slideshare.net/rolandkuhn/akka-streams-and-h"p

  13. h"p://www.slideshare.net/rolandkuhn/akka-streams-and-h"p όοΫΤϯυͷσʔλϑ ϩʔΛετϦʔϜͱͯ͠ ѻ͏Α͏ந৅Խ

  14. ߟ࡯ •  ྗۀˠମܥͩͬͨख๏ͱ࣮૷Ͱ࡞Δ –  ϑϩϯτ͔ΒόοΫΤϯυ·Ͱ௨͠ͰϊϯϒϩοΩϯ άલఏͷϛυϧ΢ΣΞ܈ –  ඇಉظετϦʔϜͱ͍͏ϓϩάϥϛϯάϞσϧͱ"1* ඪ४ʹΑΔ૬ޓ઀ଓੑ ϦΞΫςΟϒ͔Ͳ͏

    ͔͸͓͖ͯ͞ŋŋŋ
  15. ͪͳΈʹ •  5ZQFTBGF3FBDUJWF1MBUGPSNͷϝοηʔδج൫ͷ "LLB͸&SMBOH051ͷΠϯεύΠΞ –  &SMBOH051΋3FBDUJWF.BOJGFTUPΛຬͨ͢Α –  &SMBOH051ͱ͍͑͹&MJYJS –  ࠓ೔͸&MJYJSͷ࿩͸͠·ͤΜ

    
  16. .JDSPTFSWJDFT •  େن໛γεςϜΛ #PVOEFE$POUFYU Ͱ෼ׂ ౷࣏͢Δख๏ –  γεςϜΛ૊৫తʹಠཱͯ͠։ൃ͢ΔͨΊʹ෼ׂ –  ໾ׂͷҟͳΔαϒγεςϜΛૄ݁߹ʹ͢ΔͨΊ෼ׂ

  17. h"ps://speakerdeck.com/okapies/reac1ve-streams-ru-men-number-jjug

  18. .JDSPTFSWJDFTͷ࣮ࡍ •  ʮ.JDSPTFSJWFTʯʹ͸௨৴खஈͷఆٛ͸ͳ͍ –  ͦ΋ͦ΋ɺ୯ʹݱ৅ ʹ໊෇͚͚ͨͩ͠ –  +40/PWFS)551ͳ"1*Ͱಉظ௨৴͢Δ͚ͩͰ΋ .JDSPTFSWJDFTͱݴ͍ுΕΔ 

  19. ͱ͸͍͑ŋŋŋ •  ϓϩάϥϛϯάϞσϧͷ՝୊ –  ʮͬͨࣽ͝ʯγεςϜ͸͠ΜͲ͍ –  Կͷந৅Խٕ๏΋࣋ͨͣ+40/"1*͚ͩͰ͸ෳࡶ౓͸૿͢Ұํ •  Πϯϑϥͷ՝୊ – 

    ௨৴ʹ͋ͨͬͯߟྀ͢΂͖ཁ͍݅Ζ͍Ζŋŋŋ •  ϦτϥΠ •  ো֐ݕ஌ •  ෛՙ෼ࢄ ϩʔυόϥϯε  •  ϑΣΠϧΦʔόʔ •  ϑϩʔ੍ޚ CBDLQSFTTVSF 
  20. .JDSPTFSWJDFTϑϨʔϜϫʔΫ •  ϓϩάϥϛϯάϞσϧ ந৅Խ ͱΠϯϑϥΛఏ ڙ͢Δ࣮૷ –  'JOBHMF 5XJUUFS 

    –  $PMPTTVT 5VNCMS 
  21. 'JOBHMF •  5XJUUFS •  4DBMBͷ31$ϑϨʔϜϫʔΫ •  ;ͨͭͷଆ໘ –   ϓϩάϥϛϯάϞσϧ

    •  :PVS4FSWFSBTB'VODUJPOͱ'VUVSFʹΑΔαʔϏεɺ ௨৴ͷந৅Խ –   31$ͷͨΊͷΠϯϑϥ •  ো֐ݕ஌ɺϩʔυόϥϯεŋŋŋ
  22. h"p://www.slideshare.net/raffikrikorian/real1me-systems-at-twi"er

  23. h"p://www.slideshare.net/raffikrikorian/real1me-systems-at-twi"er

  24. :PVS4FSWFSBTB'VODUJPO •  4FSWFS͸3FRΛड͚औΓ3FQΛ'VUVSFͰฦؔ͢਺ͱͯ͠ந৅Խ͞ΕΔ •  ෳ਺ͷαʔϏεݺͼग़͠Λؔ਺ݺͼग़͠ͷܨ͕Γͱͯ͠هड़Ͱ͖Δ class Service[-Req, +Rep] extends (Req

    => Future[Rep]) val service = new Service[httpx.Request, httpx.Response] { def apply(req: httpx.Request): Future[httpx.Response] = Future.value(httpx.Response(req.version, httpx.Status.Ok)) } val server = Httpx.serve(":8080", service) Await.ready(server)
  25. 'JOBHMFʹΑΔந৅Խ •  4FSWJDF'JMUFSͳͲͷந৅ԽʹΑΓϓϩάϥϚ͸31$ Λؔ਺ݺͼग़͠ͱͯ͠هड़ –  ඇಉظॲཧ͸'VUVSFͰ –  αʔόʔ΋ൺֱత༰қʹॻ͚Δ –  ҟͳΔαʔϏεݺͼग़͠Λಉ͡ΠϯλϑΣʔεͰ

    •  'JOBHMFͰॻ͔Εͨ௨৴͸ɺো֐ݕ஌΍ྲྀྔ੍ޚͳͲͷ ΠϯϑϥػೳΛ࣋ͭ .JDSPTFSWJDFTͰࢄΒ͹ Δ͜ͱͷෳࡶੑΛ཈͑ࠐ Ή
  26. Θ͔Δ͜ͱ •  ैདྷͷํ๏Ͱ͸େن໛ͳετϦʔϜɺେ͖ͳ෼ࢄγ εςϜΛεϚʔτʹ͸ѻ͑ͳ͍ •  ૄ݁߹Խʹ൐͍ίϯϙʔωϯτؒͷ௨৴ͷந৅Խ͕ ՝୊ʹ •  ࣮૷Λ൐ͬͨ৽͍͠Ξϓϩʔν – 

    ந৅ϨΠϠΛඃͤͯϓϩάϥϛϯάϞσϧͱΠϯϑϥΛఏ ڙ •  5ZQFTBGF3FBDUJWF1MBUGPSN •  'JOBHMF$PMPTTVT –  ܥશମΛͲ͏ઃܭɾ࣮૷͢Δ͔ΛఏҊ  ͜ͷล͕τϨϯυ͔
  27. ܏޲ •  ෼ࢄγεςϜΞʔΩςΫνϟʹମܥతͳΞϓϩʔν •  ྗۀͰݸผ࠷దʹ࡞ΔϑΣʔζ͔ΒɺܥશମΛͲ͏ઃ ܭɾ࣮૷͢Δ͔ߟ͑ΔϑΣʔζʹ •  ྫ3FBDUJWF4ZTUFNTɺ.JDSPTFSWJDFTϑϨʔϜϫʔΫ –  ෼ࢄγεςϜΛ͜ͷखͷϛυϧ΢ΣΞɺϑϨʔϜϫʔΫΛ࢖ͬͯ

    ߏங͢Δࣄྫ͸૿͍͑ͯ͘ͱਪଌ͠·͢ •  ༨ஊͦΕʹͯ͠΋෼ࢄ31$ϑϨʔϜϫʔΫͱ͔40" తͳ΋ͷ .JDSPTFSWJDFT ͱ͔ŋŋŋʙ೥ӽ͠ʹ ΢Σϒʹ΋σϑΝΫτ͕  
  28. ॾ஫ҙ •  ͨͩͷ܏޲Ͱ͋ͬͯɺʮͬͪ͜ͷํ޲ʹਐΊʯͱ͍͏࿩ Ͱ͸͋Γ·ͤΜ –  $PPLQBEͷΑ͏ʹϞϊϦγοΫͳ3BJMTγεςϜͰ૬౰ͳن໛ ·Ͱ੒௕͍ͯ͠Δ༏Εͨࣄྫ΋͋Γ·͢ •  ʮϦΞΫςΟϒʯʹ͸ॾઆ͋ΔͷͰ֤ࣗͰௐ΂·͠ΐ͏ • 

    4DBMBͷ࿩͕ଟ͍ͷ͸ɺ͜ͷखͷ࿩୊ͷൃ঵͕4DBMBͰ ͋Δ͜ͱ͕ଟ͍ͷ͕ཧ༝Ͱ͢ɻ 4DBMBΛਪ͍ͯ͠ΔΘ͚ Ͱ͸͋Γ·ͤΜ 
  29. ༨ஊ JVM BEAM Erlang / Elixir Scala OTP Akka etc.

    Frameworks Frameworks Reac1ve Manifesto 的な ものの基盤
  30. 5IBOLT