Actor Model meets the Kubernetes - CNDT 2019

Actor Model meets the Kubernetes - CNDT 2019

1b963e66060bcc77b7ed647f5b6ff3a7?s=128

Shinichi Morimoto

July 22, 2019
Tweet

Transcript

  1. Actor Model meets the Kubernetes Cloud Native Days Tokyo 2019

    ৿ຊਅҰ @shnmorimotoʢFringe81גࣜձࣾʣ
  2. ࣗݾ঺հ • ໊લɿ৿ຊ ਅҰ • twitter: @shnmorimoto • github: github.com/shnmorimoto

    • ॴଐɿFringe81 גࣜձࣾ • ࢓ࣄɿ޿ࠂܥϓϩμΫτɾόοΫΤϯυΤϯδχΞ • ྖҬɿScala, Elm, Azure, Kubernetes
  3. Fringe81 • ࿡ຊ໦ͷձࣾ • Ad Techܥ/HR TechܥͷྖҬͰ༷ʑͳαʔϏεΛల։ • Ad Tech:

    docomo Ad Network, GrowLio, … • HR Tech: Unipos
  4. ࠓ೔࿩͢͜ͱ/࿩͞ͳ͍͜ͱ • ࿩͢͜ͱ • εςʔτϑϧͳΞϓϦέʔγϣϯʹ͍ͭͯ • εςʔτϑϧͳΞϓϦέʔγϣϯΛ࣮ݱ͢ΔͨΊͷखஈʹͭ ͍ͯʢActorModel/AkkaɾAkka Clusterʣ •

    Akka ClusterΛk8sͰՔಇͤ͞ΔϝϦοτ • ࿩͞ͳ͍͜ͱ • εςʔτϑϧηοτ
  5. εςʔτϨεͳΞϓϦέʔγϣϯ "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS ɾ ɾ ɾ

    -# 4DBMF0VU*O ͷ੍໿ͳ͠ ো֐ͷ෮چ ΋؆୯ • εςʔτϨεͳΞϓϦέʔ γϣϯ • ঢ়ଶΛ࣋ͨͳ͍ • ো֐͕ى͖ͯ΋ɺ෮چ͸ָ • εέʔϦϯάͷ੍໿΋ͳ͠ • ࣮ݱͰ͖Δࣄ͸ඇৗʹݶΒ ΕΔ
  6. εςʔτϨεͳΞϓϦέʔγϣϯ + DB "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS -#

    %# ඞཁͳঢ়ଶΛ %#ʹอଘ͢Δʂ ௨ৗɺ༗༻ͳΞϓϦέʔγϣϯΛ࡞੒͢ΔͨΊʹ͸ঢ়ଶΛ%# ౳ʹ࣋ͭඞཁ͕͋Δ ͜ΕͰશ͕ͯ໰୊ͳ͘ղܾʁ
  7. εςʔτϨεͳΞϓϦέʔγϣϯ + DB "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS -#

    %# ঢ়ଶΛߋ৽͢ΔͨΊʹ-PDL -PDL͕ղআ͞ΕΔ·Ͱ ଴ͭඞཁ͕͋Δ Ϩεϙϯε͕஗͘ͳΔ ಉ͡ঢ়ଶΛෳ਺͔Βߋ৽͠Α͏ͱͨ͠ࡍʹɺϨεϙϯε͕஗͘ͳΔʂ ʢঢ়ଶߋ৽͕ෳࡶͳ৔߹͸%FBE-PDL΋ൃੜ͢Δʜʣ ಉҰͷঢ়ଶΛಉ࣌ʹߋ৽͢Δέʔε
  8. εςʔτϨεͳΞϓϦέʔγϣϯ + KVS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS -#

    ,74 ඞཁͳঢ়ଶΛ ,74ʹอଘ͢Δʂ Ϩεϙϯε͕໰୊ʹͳΔͳΒɺ,74ʹ͢Ε͹ྑ͍ʂ ͜ΕͰશ͕ͯ໰୊ͳ͘ղܾʁ ଎͍ͧ͒ʂʂʂ
  9. εςʔτϨεͳΞϓϦέʔγϣϯ + KVS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS -#

    ,74 ߋ৽࣌ʹ-PDL͕͔͔Βͳ͍ͷͰɺঢ়ଶͷෆ੔߹͕͓͖ΔՄೳ ੑ͕͋Δ ಉҰͷঢ়ଶΛಉ࣌ʹߋ৽͢Δέʔε ʢઌʹʣঢ়ଶΛߋ৽ʂ ʢޙʹʣঢ়ଶΛߋ৽ʂ 8*/
  10. εςʔτϨεͳΞϓϦέʔγϣϯ + DB/KVS + ??? "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO

    4FSWFS -# ౰વɺղܾ͢Δखஈ͸৭ʑ͋Δ͕ɺߏ੒͸ෳࡶʹͳΒ͟ΔΛ ಘͳ͍ ಉҰͷঢ়ଶΛಉ࣌ʹߋ৽͢Δέʔε ԿΒ͔ͷ ιϦϡʔγϣ ϯʁʁʁʁ
  11. ݱ୅ͷΞϓϦέʔγϣϯ΁ͷཁٻ 5IF3FBDUJWF.BOJGFTUP IUUQTXXXSFBDUJWFNBOJGFTUPPSH ΑΓ ΞϓϦέʔγϣϯ͕ σϓϩΠ͞ΕΔ৔ॴ͸ϞόΠϧ ͔ΒΫϥ΢υ·Ͱ༷ʑ ϨεϙϯελΠϜ͸ ϛϦඵ ϝϯςφϯεͷμ΢ϯλΠϜ

    ͸θϩɾμ΢ϯλΠϜ ѻ͏σʔλ͸೔ʑ૿Ճ ͔͠΋ɺݱ୅ͷΞϓϦέʔγϣϯ͸ΑΓෳࡶɺ଎͘ɺམͪͳ ͍͜ͱΛཁٻ͞ΕΔ
  12. εςʔτϑϧͳΞϓϦέʔγϣϯ "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS -# ֎෦ʹ͍࣋ͬͯͨঢ়ଶΛΞϓϦέʔγϣϯଆʹ͍࣋ͬͯ͘͜ ͱͰγϯϓϧͳߏ੒ʹͰ͖ΔͷͰ͸ʁ

    ঢ়ଶ ঢ়ଶ ঢ়ଶ ঢ়ଶ ঢ়ଶ
  13. εςʔτϑϧͳΞϓϦέʔγϣϯ "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS -# ֎෦ʹ͍࣋ͬͯͨঢ়ଶΛΞϓϦέʔγϣϯଆʹ͍࣋ͬͯ͘͜ ͱͰγϯϓϧͳߏ੒ʹͰ͖ΔͷͰ͸ʁ

    ঢ়ଶ ঢ়ଶ ঢ়ଶ ঢ়ଶ ঢ়ଶΛߋ৽ʂ
  14. εςʔτϑϧͳΞϓϦέʔγϣϯ "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS -# ঢ়ଶ ঢ়ଶ

    ঢ়ଶ ঢ়ଶ • εςʔτϑϧͳΞϓϦέʔγϣϯ • ঢ়ଶΛ࣋ͭ • ঢ়ଶͷߋ৽͕γϯϓϧʂ • ঢ়ଶΛΞϓϦέʔγϣϯʹ࣋ͭʹ ͸ʁʁʁ • ঢ়ଶΛߋ৽͢ΔͨΊʹద੾ʹScaling/ Balancing͢Δํ๏͸ʁʁʁ • ΞϓϦέʔγϣϯΛ࠶ىಈͨ͠Βঢ় ଶ͕ফ͑ͳ͍ʁʁʁ
  15. ঢ়ଶΛΞϓϦέʔγϣϯʹ࣋ͭʹ͸ʁʁʁ

  16. Actor Model • ฒߦγεςϜͷϞσϧͷҰछ • ActorʢΞΫλʔʣͱ͍͏֓೦Λಋೖ͠ɺฒߦγεςϜΛ؆қʹѻ͏͜ͱ͕ Ͱ͖Δʢޙड़ʣ • Erlang͕Actor ModelΛ࠾༻͍ͯ͠Δ

    • Java/ScalaͰ΋Akkaͱ͍͏πʔϧΩοτΛར༻͢Δ͜ͱͰ࣮ݱͰ͖Δ ΞΫλʔϞσϧʢӳBDUPSNPEFMʣͱ͸ɺ೥ɺΧʔϧɾώϡʔΠοτɺ1FUFS #JTIPQɺ3JDIBSE4UFJHFS͕ൃදͨ͠ฒߦܭࢉͷ਺ֶతϞσϧͷҰछɻ ग़యϑϦʔඦՊࣄయʰ΢ΟΩϖσΟΞʢ8JLJQFEJBʣʱ ຊηογϣϯͰ͸"LLBΛྫʹऔΓɺ"DUPS.PEFMʹ͍ͭͯઆ໌͠·͢
  17. • Java/Scala޲͚ʹActor ModelΛ࣮ݱ͢ΔπʔϧΩοτ • LightbendࣾʹΑͬͯ։ൃ͞Εɺݱࡏ͸ΦʔϓϯιʔεͰ։ൃ͕ଓ͚ΒΕ͍ͯΔ • ԼهΛ؆қʹ࣮ݱͰ͖Δ • Actor Model

    • SupervisorʹΑΔো֐ִ཭ɾ෮چʹ༏ΕͨγεςϜͷߏங • ΫϥελϦϯά • ετϦʔϜॲཧ • etc … Akka - ֓ཁ
  18. "DUPS Akka Actor "DUPS "DUPS "DUPS "DUPS "DUPS "DUPS "DUPS

    "DUPS +7.
  19. +7. "DUPS Akka Actor "DUPS "DUPS "DUPS "DUPS "DUPS "DUPS

    "DUPS "DUPS w ঢ়ଶΛ࣋ͭ w ͦΕͧΕͷ"DUPSͰϩδοΫΛ࣋ͭ w ̍ͭ̍ͭͷ"DUPS͕ϓϩηεͷΑ͏ʹৼΔ෣͏ FY  $POGFSFODF/BNF$MPVE/BUJWF %BZT5PLZP  %BUF FY  $POGFSFODF/BNF$MPVE/BUJWF %BZT'VLVPLB  %BUF ෳ਺ͷ"DUPS͕Ծ૝ϓϩηεͷΑ͏ʹՔಇ͢Δ
  20. +7. "DUPS Akka Actor "DUPS "DUPS "DUPS "DUPS "DUPS "DUPS

    "DUPS "DUPS $POGFSFODF໊͸ʁ $MPVE/BUJWF %BZT5PLZP ͦΕͧΕͷ"DUPSؒ͸ϝοηʔδΛ௨ͯ͠ඇಉظʹॲཧΛߦ͏
  21. "DUPS Akka Actor "DUPS "DUPS "DUPS "DUPS "DUPS "DUPS "DUPS

    "DUPS ɾݸʑͷ"DUPS͸ΞυϨεΛ͓࣋ͬͯΓɺͦͷΞυϨεѼʹϝοηʔδΛૹ৴͢Δɻ ɾϝʔϧϘοΫεͷΑ͏ͳΩϡʔΛ͓࣋ͬͯΓɺಧ͍ͨϝοηʔδʹ͍ͭͯॱ࣍ॲཧΛߦ͏ +7.
  22. "DUPS Akka Actor - Supervisionʢิʣ "DUPS "DUPS "DUPS "DUPS ਌

    ࢠ ଙ • Actor͸ࣗ਎ͷࢠͱͳ ΔActorΛੜ੒Ͱ͖Δ • ActorؒͰͷ਌ࢠؔ ܎ɺҰछͷπϦʔߏ ଄Λߏ੒Ͱ͖Δ
  23. "DUPS "DUPS "DUPS "DUPS "DUPS ਌ ࢠ ଙ • ਌Actor͸ࢠActorͷ؂

    ಜऀʢSupervisorʣͱ ͳΔ • ࢠActorʹ໰୊͕ൃੜ ͨ͠৔߹ʹఀࢭ΍࠶ى ಈ౳ͷॲཧΛߦ͏ ؂ࢹ ؂ࢹ Akka Actor - Supervisionʢิʣ
  24. "DUPS "DUPS "DUPS "DUPS "DUPS ਌ ࢠ ଙ • ਌Actor͸ࢠActorʹ໰୊͕ൃੜ͢

    ΔͱઓུʹԊͬͯରԠ • ఀࢭ • ࠶ىಈʢActorΛ࠶ੜ੒͢Δʣ • ΤεΧϨʔγϣϯ ໰୊͕ൃੜ "DUPS͕ઓུʹԊͬͯɺରԠ Akka Actor - Supervisionʢิʣ
  25. • ActorΛར༻͢Δ͜ͱͰɺΞϓϦέʔγϣϯଆͰঢ়ଶΛ΋ͭ͜ͱ͕Ͱ͖Δ • Actor͸ঢ়ଶ΍ϩδοΫΛ࣋ͭ • Actor͸ͦΕͧΕಠཱ͍ͯ͠Δ • Actorؒͷ௨৴͸ϝοηʔδϯάΛ௨ͯ͠ѻ͏ • Actor͸SupervisionͷػೳΛ͓࣋ͬͯΓɺ؆୯ʹΞϓϦέʔγϣϯଆͰো֐ͷ

    ִ཭ɾ෮چΛ͢Δ͜ͱ͕Ͱ͖Δ Akka Actor - ·ͱΊ
  26. ঢ়ଶΛߋ৽͢ΔͨΊʹద੾ʹScaling/ Balancing͢Δํ๏͸ʁʁʁ

  27. ActorͷScaling/Balancing /PEF /PEF /PEF -# ঢ়ଶ"DUPS ঢ়ଶ"DUPS ঢ়ଶ"DUPS ঢ়ଶ"DUPS ˞࣮ࡍʹ͸΋ͬͱଟ͘ͷ"DUPS͕

    Քಇ͢Δ͜ͱʹͳΔ /PEFؒʹ౉ͬͯɺ"DUPSΛల ։͢Δʹ͸ʁ ͲͷΑ͏ʹɺͲͷ/PEFʹͲͷ ঢ়ଶ͕͋Δ͔Λ஌Δ͜ͱ͕Ͱ͖ Δʁ
  28. Akka Cluster "LLBͰ͸$MVTUFSΛߏ੒͢Δ͜ͱ͕Ͱ͖Δ +7. +7. +7. +7. +7.

  29. Akka Cluster +7. +7. +7. +7. +7. ϩʔΧϧͰͷ"DUPSؒͷϝοηʔδύογϯά͸ͦͷ··Ͱ

  30. Akka Cluster +7. +7. +7. +7. +7. ϊʔυΛ·͍ͨͩ"DUPSؒͷϝοηʔδϯά͸ ϩʔΧϧͱશ͘ಉ͡Α͏ʹѻ͏͜ͱ͕Ͱ͖Δ

  31. Akka Cluster ϩʔΧϧͱಉ༷ʹϊʔυΛ·͍ͨͩ"DUPSؒͷ؂ࢹ΋Մೳ +7. +7. +7. +7. +7. ਌ ࢠ

    ؂ࢹ
  32. ͦΕͧΕຖʹϢχʔΫͳࣝผࢠ Λ"DUPSΛ&OUJUZͱݺͿ Akka Cluster Sharding +7. +7. +7. +7. 4IBSE

    4IBSE 4IBSE 4IBSE 4IBSE 4IBSE ୯ମͷϊʔυ্ͷ"DUPS $MVTUFS্Ͱ4IBSEJOH͞Εͨ"DUPS &OUJUZΛ4IBSEʹ෼͚ɺ4IBSEΛ ෳ਺ͷϊʔυʹ෼ࢄͤ͞Δ͜ͱ͕Ͱ ͖Δ
  33. Akka Cluster Sharding +7. +7. +7. +7. 4IBSE 4IBSE 4IBSE

    4IBSE 4IBSE 4IBSE ୯ମͷϊʔυ্ͷ"DUPS $MVTUFS্Ͱ4IBSEJOH͞Εͨ"DUPS ಉҰͷࣝผࢠΛ΋ͭ&OUJUZ͸ $MVTUFSʹҰՕॴ͔͠ଘࡏ͠ͳ͍͜ ͱΛอূ 4IBSEʹ9999ͱ͍͏ࣝผࢠ Λ࣋ͭ&OUJUZ͕͍ͨΒɺଞͷ 4IBSEʹ͸ಉ͡&OUJUZ͸ଘࡏ͠ ͳ͍
  34. Akka Cluster Sharding +7. +7. +7. +7. 4IBSE 4IBSE 4IBSE

    4IBSE 4IBSE 4IBSE ୯ମͷϊʔυ্ͷ"DUPS $MVTUFS্Ͱ4IBSEJOH͞Εͨ"DUPS Ͳ͜ͷ4IBSEʹԿͷ&OUJUZ͕ଘࡏ ͢Δͷ͔΋؅ཧ͞Ε͍ͯΔ 4IBSEʹ9999ͱ͍͏&OUJUZ ͕ଘࡏ͢Δ
  35. Akka Cluster - Clusterͷߏஙʢิʣ $MVTUFSΛߏங͢Δʹ͸ɺ$MVTUFSͷى఺ɺϊʔυͷ+PJO΍ -FBWFΛ؅ཧ͢Δ4FFEϊʔυ͕ඞཁ 4FFE 4FFE +7. +7.

    +7. +7.
  36. $MVTUFSʹ৽نϊʔυΛ௥Ճ͢Δ৔߹ɺ ·ͣ͸4FFEϊʔυͱ௨৴͢Δඞཁ͕͋Δ 4FFE 4FFE ৽نϊʔυ +PJO Akka Cluster - Clusterͷߏஙʢิʣ

    +7. +7. +7. +7. +7.
  37. • ϊʔυؒͰClusterΛߏங͢Δ͜ͱ͕Ͱ͖Δ • ͜Ε·Ͱͷػೳ͸ϩʔΧϧͱಉ͡Α͏ʹѻ͏͜ͱ͕Ͱ͖ΔʢTransparencyʣ • ϝοηʔδύογϯά • Supervision(؂ಜ) • Akka

    Cluster (Sharding)Λར༻͢Δ͜ͱͰ • ActorͷҰҙੑΛอূɿCluster಺ͰEntity͕Ұҙʹଘࡏ͢Δ͜ͱΛอূ͢Δ • ActorͷҐஔΛ؅ཧɿCluster಺ͰEntityͷҐஔΛ؅ཧ͍ͯ͠ΔͷͰɺͲͷshardʹ͍Δͷ͔͕෼͔Δ • ϊʔυ͕௥Ճ͞ΕΔͱγϟʔυΛࣗಈతʹϦόϥϯε͢Δ͜ͱ͕Ͱ͖Δ • ৽نʹϊʔυΛ௥Ճ͢Δʹ͸ɺSeedϊʔυͷ৘ใΛ஌͍ͬͯΔඞཁ͕͋Δʢͨͩ͠ɺAkka Clusterʹ͸ Service Discoveryͷػೳ͸ͳ͍ʣ Akka Cluster - ·ͱΊ
  38. ΞϓϦέʔγϣϯΛ࠶ىಈͨ͠Βঢ়ଶ͕ফ ͑ͳ͍ʁʁʁ

  39. /PEF /PEF /PEF ঢ়ଶ"DUPS ঢ়ଶ"DUPS ঢ়ଶ"DUPS ঢ়ଶ"DUPS "LLB$MVTUFS "DUPSͷঢ়ଶ͕ফ͑ͳ͍ʁ ϊʔυʹো֐͕

    ൃੜʂ ϊʔυʹো֐͕ى͖ͨΓɺ"QQMJDBUJPO͕མͪͨΒ"DUPSͷঢ় ଶ͸ফ͑ͯ͠·͏ɻͨͩ͠"DUPSΛӬଓԽ͢Δํ๏͕༻ҙ͞Ε ͍ͯΔɻ ActorͷӬଓԽ
  40. "DUPS ActorͷӬଓԽ %#,74 ͑ͬɺ݁ہ%#,74ར༻͢Δͷʁʁʁ ӬଓԽ͢ΔͨΊʹɺ%#,74Λར༻͢Δ ঢ়ଶ  $POGFSFODF /BNF$MPVE /BUJWF%BZT

    5PLZP  5JDLFU
  41. &WFOU4PVSDJOH͸"LLB 1FSTJTUFODFͷػೳͰ࣮ݱՄೳ "DUPS ActorͷӬଓԽ %#,74 %#,74ʹอଘ͢Δͷ͸ɺঢ়ଶͰ͸ͳ͘ɺΠϕϯτΛ อଘ͢Δʢ&WFOU4PVSDJOHʣ อଘ͢Δͷ͸ঢ়ଶΛมߋͨ͠Πϕϯτ ঢ়ଶ 

    $POGFSFODF /BNF$MPVE /BUJWF%BZT 5PLZP  5JDLFU νέοτΛຕొ࿥ νέοτ͕ຕചΕͨ νέοτ͕ຕചΕͨ ɾ ɾ ɾ
  42. "DUPS ActorͷӬଓԽ %#,74 ো֐࣌ʹ͸ΠϕϯτΛશͯಡΈࠐΈɺঢ়ଶΛ෮ݩ͢Δ ঢ়ଶ  $POGFSFODF /BNF$MPVE /BUJWF%BZT 5PLZP

     5JDLFU νέοτΛຕొ࿥ νέοτ͕ຕചΕͨ νέοτ͕ຕചΕͨ ɾ ɾ ɾ Πϕϯτ͔Βঢ়ଶΛ෮ݩ͢Δ
  43. εςʔτϨεͳΞϓϦέʔγϣϯ + DBʢ࠶ܝʣ "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS "QQMJDBUJPO 4FSWFS -#

    %# ঢ়ଶΛߋ৽͢ΔͨΊʹ-PDL -PDL͕ղআ͞ΕΔ·Ͱ ଴ͭඞཁ͕͋Δ Ϩεϙϯε͕஗͘ͳΔ ಉ͡ঢ়ଶΛෳ਺͔Βߋ৽͠Α͏ͱͨ͠ࡍʹɺϨεϙϯε͕஗͘ͳΔʂ ʢঢ়ଶߋ৽͕ෳࡶͳ৔߹͸%FBE-PDL΋ൃੜ͢Δʜʣ ಉҰͷঢ়ଶΛಉ࣌ʹߋ৽͢Δέʔε
  44. "DUPS ActorͷӬଓԽ %#,74 ɾঢ়ଶͷߋ৽͸ϝϞϦ্Ͱ׬݁ ɾঢ়ଶΛߋ৽͢Δͷ͸ҰՕॴʢ&OUJUZʣͷΈͱอূ͞Ε͍ͯΔ ɾΠϕϯτΛอଘ͢Δ͚ͩͳͷͰɺBEE͚ͩͰྑ͍ νέοτΛຕొ࿥ νέοτ͕ຕചΕͨ νέοτ͕ຕചΕͨ ɾ

    ɾ ɾ νέοτ͕ຕചΕͨ ϩοΫ΍ഉଞ੍ޚ͕ඞཁͳ͍ͷͰɺϨεϙϯε͕଎͍ ߋ৽
  45. • Actorͷঢ়ଶΛอଘ͢ΔͷͰ͸ͳ͘ɺঢ়ଶΛมߋ͢ΔΠϕϯτΛอଘ͢Δ ʢEvent Sourcingʣ • ঢ়ଶͷߋ৽͸ϝϞϦ্Ͱ׬݁ • ϩοΫ΍ഉଞ੍ޚ͕ඞཁͳ͍ • ϨεϙϯεΛ଎͘͢Δ͜ͱ͕Ͱ͖Δ

    • ActorͰEventSourcing͢Δʹ͸Akka PersistenceΛར༻Ͱ͖Δ ActorͷӬଓԽ - ·ͱΊ
  46. εςʔτϑϧͳΞϓϦέʔγϣϯ

  47. /PEF /PEF /PEF ঢ়ଶ"DUPS ঢ়ଶ"DUPS ঢ়ଶ"DUPS ঢ়ଶ"DUPS "LLB$MVTUFS %#,74 εςʔτϑϧͳΞϓϦέʔγϣϯ

    "LLB1FSTJTUFODF &WFOU4PVSDJOH ঢ়ଶΛߋ৽ʂ "DUPSͷঢ়ଶΛ ߋ৽͢Δϝοηʔδ "LLB"DUPS "LLB$MVTUFS 4IBSEJOH  "LLB 1FSTJTUFODFͰεςʔτϑϧͳΞϓϦέʔγϣϯΛߏ੒Ͱ͖Δ
  48. • ֎෦σʔλετΞʢDB/KVSʣʹอଘ͍ͯͨ͠ঢ়ଶΛΞϓϦέʔγϣϯ಺ ʹอ࣋͢Δ • ঢ়ଶͷߋ৽͕ϝϞϦ্Ͱ׬݁͢ΔͨΊʹɺଈԠੑ͕ߴ·Δ • ঢ়ଶͷߋ৽ΛҰՕॴͷΈʹอূ͢Δ͜ͱͰɺෆ੔߹Λ๷͙͜ͱ͕Ͱ͖Δ • ActorͷӬଓԽʹ͸Event SourcingΛ༻͍Δ

    • σʔλͷ௥ՃͷΈͳͷͰɺlock΍ഉଞ੍ޚ͕ඞཁͳ͍ εςʔτϑϧͳΞϓϦέʔγϣϯ
  49. • ϊʔυͷεέʔϧΞ΢τ/Πϯ • ϊʔυো֐࣌ͷࣗಈ෮چ • Clusterʹ৽نϊʔυΛ௥Ճ͢ΔࡍʹඞཁͱͳΔService Discovery Akka ClusterͷΈͰରԠͰ͖ͳ͍͜ͱ ,VCFSOFUFTͱ૊Έ߹ΘͤΔ͜ͱͰղܾ

  50. Akka Cluster on Kubernetes

  51. 7. 7. 1PE +7. 1PE +7. 1PE +7. 1PE +7.

    Akka Cluster on k8s - ֓ཁ
  52. 7. 7. 1PE +7. 1PE +7. 1PE +7. 1PE +7.

    ͭͷ1PEͭͷ"LLB$MVTUFSͷϊʔυͱͳΔ Akka Cluster on k8s - ֓ཁ
  53. 7. 7. 1PE +7. 1PE +7. 1PE +7. 1PE +7.

    "LLB$MVTUFS ,VCFSOFUFT ΞϓϦέʔγϣϯଆͷΫϥελϦϯά͸"LLB$MVTUFSɺ ΠϯϑϥଆͷΫϥελϦϯά͸,VCFSOFUFTͰ؅ཧ Akka Cluster on k8s - ֓ཁ
  54. 7. 7. 1PE +7. 1PE +7. 1PE +7. 1PE Πϯϑϥଆ͸)1"Ͱ1PEͷεέʔϦϯά

    Akka Cluster on k8s - εέʔϦϯά
  55. 7. 7. 1PE +7. 1PE +7. 1PE +7. 1PE +7.

    ΞϓϦέʔγϣϯଆ͸"DUPS$MVTUFSͰ"DUPSͷεέʔϦϯά Akka Cluster on k8s - εέʔϦϯά
  56. 7. 7. 1PE +7. 1PE +7. 1PE +7. 1PE +7.

    ো֐ ΦʔτώʔϦϯά 1PEଆͷো֐͸1PEͷΦʔτώʔϦϯάͰରԠ Akka Cluster on k8s - ো֐෮چ
  57. 7. 7. 1PE +7. 1PE +7. 1PE +7. 1PE +7.

    "DUPSଆͷ$SBTI͸"DUPSͷ4VQFSWJTJPOͰରԠ $SBTI 4VQFSWJTJPOͰରԠ Akka Cluster on k8s - ো֐෮چ
  58. +7. +7. +7. 1PE 1PE 1PE "LLB$MVTUFS Akka Cluster On

    k8s - Node௥Ճ "LLB$MVTUFSʹ͸,VCFSOFUFTͱͷ࿈ܞػೳ͕༻ҙ͞Ε͍ͯΔ +7. 1PE ৽نϊʔυ LT"1*
  59. +7. +7. +7. 1PE 1PE 1PE "LLB$MVTUFS Akka Cluster On

    k8s - Node௥Ճ ,VCFSOFUFTͷ"1*ʹ໰͍߹ΘͤΔࣄͰɺ $MVTUFS಺ͷ1PEͷѼઌΛ஌Δ͜ͱ͕Ͱ͖Δ +7. 1PE ৽نϊʔυ LT"1* $MVTUFSͷ1PEͷѼઌΛ໰͍߹ Θͤ
  60. +7. +7. +7. 1PE 1PE 1PE "LLB$MVTUFS Akka Cluster On

    k8s - Node௥Ճ $MVTUFS಺ͷ1PEʹ޲͚ͯɺ+PJOϝοηʔδΛૹΔ +7. 1PE ৽نϊʔυ LT"1* ໰͍߹Θͤͨ݁Ռ͔Βϊʔυ΁ +PJOϝοηʔδΛ͓͘Δ
  61. +7. +7. +7. 1PE 1PE 1PE "LLB$MVTUFS Akka Cluster On

    k8s - Node௥Ճ "LLB$MVTUFSʹ͸ͳ͔ͬͨɺ4FSWJDF%JTDPWFSͷػೳΛ LT͕ิ׬ͯ͘͠ΕΔ +7. 1PE ৽نϊʔυ LT"1*
  62. • Akka ClusterͷΈ͚ͩͰ͸ରԠͰ͖ͳ͔ͬͨ఺ΛKubernetes͕ Χόʔͯ͘͠ΕΔ • Akka Cluster͔ΒݟͨNodeͷScaleOut/In • Akka Cluster͔Βݟͨϊʔυͷো֐෮چ

    • Akka Cluster͔ΒݟͨଞϊʔυͷService Discovery • PodʹKubernetes API΁ͷΞΫηεݖݶΛ෇༩͢Δඞཁ͕͋Δ Akka Cluster On k8s - ·ͱΊ
  63. ·ͱΊ

  64. • ʢຊདྷ֎෦DV/KVSʹ͍࣋ͬͯΔʣঢ়ଶΛΞϓϦέʔγϣϯʹ͍࣋ͬͯΔͷ͕ɺεςʔτϑϧ ͳΞϓϦέʔγϣϯ • εςʔτϑϧͳΞϓϦέʔγϣϯ͸ଈԠੑ͕ߴ͍ • εςʔτϑϧͳΞϓϦέʔγϣϯΛߏ੒͢ΔͨΊʹActor ModelʢAkkaʣ͕͋Δ • Akka

    Actor + Akka ClusterʢShardingʣ+ Akka PersistenceͰεςʔτϑϧͳΞϓϦέʔ γϣϯΛ؆୯ʹߏ੒Ͱ͖Δ • ActorͷӬଓԽʹ͸Event SourcingΛར༻͢Δ • ΞϓϦέʔγϣϯ૚ʹActor ModelɺΠϯϑϥ૚ʹKubernetesΛ૊Έ߹ΘͤΔ͜ͱͰɺ Actor Model͚ͩͰ͸ରԠͰ͖ͳ͔ͬͨ͜ͱΛิ׬͢Δ͜ͱ͕Ͱ͖Δ ·ͱΊ
  65. • Akkaͷଞͷศརπʔϧ • Akka HttpɺAkka Streamsɺetc… • NWো֐࣌౳ͷClusterͷSpritBrain • CQRS

    + ES ࠓ೔࿩͞ͳ͔ͬͨ͜ͱ
  66. • Using Akka Cluster for a payment service - Scala

    Matsuri 2019 • https://speakerdeck.com/negokaz/using-akka-cluster-for-a-payment-service • How to build an Event-Sourcing system using Akka with EKS - Scala Matsuri 2019 • https://speakerdeck.com/j5ik2o/how-to-build-an-event-sourcing-system-using-akka-with-eks • Managing an Akka Cluster on Kubernetes - Scala Days LAUSANNE 2019 • https://portal.klewel.com/watch/webcast/scala-days-2019/talk/23/ • White Paper: The Benefits Of Using Akka With Kubernetes • https://www.lightbend.com/blog/new-white-paper-the-benefits-of-using-akka-with-kubernetes ࢀߟ