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

実践して分かったJavaマイクロサービス開発 #JavaDayTokyo

実践して分かったJavaマイクロサービス開発 #JavaDayTokyo

Java Day Tokyo 2016
2016/05/24

Ad3fbc316f916a341c24035e34913121?s=128

Shin Tanimoto

May 24, 2016
Tweet

Transcript

  1. ࣮ફͯ͠෼͔ͬͨJavaϚΠΫϩαʔϏε։ൃ
 - What I learned about Microservices - 
 #jdt2016_4E

    ୩ຊ ৺
 Acroquest Technologyגࣜձࣾ
  2. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Who

    am I? 2 • ୩ຊ ৺ (Shin Tanimoto) - Acroquest Technology גࣜձࣾ - Javaτϥϒϧγϡʔλʔ - ೔ຊJavaϢʔβάϧʔϓװࣄ
 Twitter : @cero_t - Facebook : shin.tainmoto
  3. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ࣭໰ 3
  4. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ։ൃऀͷํʁ 4
  5. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 ͲΕ͙Β͍ฉ͍ͨ͜ͱ͕͋Δʁ 5
  6. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 1. ໊લΛฉ͍ͨ͜ͱ͸͋Δ 2. ֓ཁ͙Β͍͸஌͍ͬͯΔ 3. ։ൃͨ͜͠ͱ͕͋Δ 4. ӡ༻͍ͯ͠Δ 5. ׬શʹϚελʔͨ͠ 6
  7. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. No.5ʁ ؼ͍ͬͯͩ͘͞ʂʂ 7
  8. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏεͱ͸ʁ 8
  9. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 খ͞ͳαʔϏεͷू߹ମͱͯ͠
 ߏங͞ΕͨγεςϜͰ͋Δ 9
  10. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 ໨ࢦ͢΋ͷͰ͸ͳ͘
 ݁Ռ࿦Ͱ͋Δ 10
  11. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 ϓϩάϥϛϯάͷख๏Ͱ͸ͳ͍ 11
  12. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 ઃܭɺ࣮૷ɺσϓϩΠɺӡ༻ͳͲ
 ଟذʹΘͨΔ֓೦Ͱ͋Δ 12
  13. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ΦϥΠϦʔͷ
 ϚΠΫϩαʔϏε
 ΞʔΩςΫνϟ 13
  14. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 1ষ ϚΠΫϩαʔϏε 2ষ ਐԽతΞʔΩςΫτ 3ষ αʔϏεͷ
 ɹɹϞσϧԽํ๏ 4ষ ౷߹ 5ষ ϞϊϦεͷ෼ׂ 6ষ σϓϩΠ 14 7ষ ςετ 8ষ ؂ࢹ 9ষ ηΩϡϦςΟ 10ষ ίϯ΢ΣΠͷ๏ଇͱ
 ɹɹ γεςϜઃܭ 11ষ େن໛ͳ
 ɹɹ ϚΠΫϩαʔϏε 12ষ ·ͱΊ
  15. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 1.1 ϚΠΫϩαʔϏεͱ͸ 1.1.1 খ͘͞ɺ͔ͭ1ͭͷ໾ׂʹઐ೦ 1.1.2 ࣗ཯ੑ 1.2 ओͳར఺ 1.2.1 ٕज़ҟ࣭ੑ 1.2.2 ճ෮ੑ 1.2.3 εέʔϦϯά 1.2.4 σϓϩΠͷ༰қੑ 1.2.5 ૊৫໘ͷҰக 1.2.6 ߹੒Մೳੑ 1.2.7 ަ׵Մೳʹ͢ΔͨΊͷ࠷దԽ 15
  16. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 ૊৫࿦΍จԽ࿦ʹ·ͰࢸΔ֓೦ 16
  17. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 1. ϚΠΫϩαʔϏεԽ΁ͷऔΓ૊Έ 2. ·ͣ͸APIԽ 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ 6. ࠓޙɺऔΓ૊Έ͍ͨ͜ͱ 7. ຊ౰ʹϚΠΫϩαʔϏε͸࠷ద͔ʁ 17 Table of contents
  18. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 18 #1 ϚΠΫϩαʔϏεԽ
 ΁ͷऔΓ૊Έ
  19. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 1. ϚΠΫϩαʔϏεԽ΁ͷऔΓ૊Έ ର৅ͷγεςϜ ECαΠτ ߪೖϖʔδ όοΫΤϯυͷγεςϜ ߏ੒ Java SE 6 JBoss AS 6 Struts2 Hibernate3 MySQL 5.1 19
  20. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. Start simple, not small 20
  21. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ঃʑʹߏ੒มߋ 1. αʔόαΠυϨϯμϦϯάܥͷγεςϜ
 ɹɹˣ 2. ߪೖαΠτΛHTML5 + WebAPIʹ෼ׂ
 ɹɹˣ 3. όοΫΤϯυγεςϜΛϚΠΫϩαʔϏεԽ
 ɹɹˣ 4. ؅ཧը໘ΛϚΠΫϩαʔϏεԽ
 ɹɹˣ 5. ߪೖαΠτΛϚΠΫϩαʔϏεԽ 21 1. ϚΠΫϩαʔϏεԽ΁ͷऔΓ૊Έ
  22. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 22 #2 ·ͣ͸APIԽ
  23. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ΍ͬͨ͜ͱ 1. Struts2 + Hibernateͷ
 αʔόαΠυϨϯμϦϯάܥγεςϜΛɺ
 Angular1 + SpringMVCͰWeb APIԽ 2. AWS্Ͱ։ൃ/ߏங 3. యܕతͳτϥϯβΫγϣϯεΫϦϓτ • Controller • Service • Dao 23
  24. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ྑ͔ͬͨ͜ͱ 1. ը໘ͱAPIͰɺ׬શͳ෼ۀ͕Ͱ͖ͨ 2. Ұ෦ͷ஗͍ॲཧʹɺը໘શମͷඳը͕
 Ҿ͖ͣΒΕΔ͜ͱ͕ͳ͘ͳͬͨ 3. ݕࡧAPIΛ࠶ར༻ͯ͠ɺ
 ผͷը໘Λ࡞੒͢Δ͜ͱ͕Ͱ͖ͨɻ 24
  25. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ࣦഊͨ͜͠ͱ 1. APIΛը໘ʹಛԽ͗ͨ͢͠ʢ࠶ར༻ͮ͠Β͍ʣ • ঎඼৘ใɺࡏݿɺྉۚΛɺ·ͱΊͯฦ͢API • ͨͿΜ͜ΕAPIԽ͋Δ͋Δͩͱࢥ͏ 2. ങ͍෺͔͝ΛηογϣϯʹೖΕͨ • εςΟοΩʔηογϣϯʹͤ͟ΔΛಘͣɺ
 ࠶σϓϩΠ΍ɺεέʔϧΞ΢τɺεέʔϧΠϯ͕
 ͮ͠Β͍ߏ੒ʹͳͬͯ͠·ͬͨɻ 25
  26. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ࠔͬͨ͜ͱ 1. APIαʔόͷεέʔϧΞ΢τ • APIαʔόΛ૿΍ͨ͢ͼʹɺ • Webαʔό (nginx) ͷઃఆΛ • ॻ͖׵͑ͳͯ͘͸͍͚ͳ͍ɻ
 ɹˠ Webαʔό͸localhostͷAPIαʔόͷΈʹ
 ɹɹసૹ͢ΔܗͰɺWeb + APIͷηοτͰ૿΍͢ɻ 26
  27. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ࠔͬͨ͜ͱ 2. ٸʹʮॲཧΛඇಉظʹ͢Δʯͱ͍͏ཁ͕݅ු্ • ඇಉظʹ͢ΔͨΊͷΞϨίϨ͸༻ҙͯ͠ͳ͍Αʁ
 ɹˠ γϦΞϥΠζͯ͠ϑΝΠϧʹॻ͖ग़ͯ͠ɺ
 ɹɹͦΕΛඇಉظଆͷॲཧͰఆظಡΈࠐΈ͢Δ
 ɹɹͱ͍͏ݪ࢝తͳํ๏Λར༻ɻ 27
  28. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ࣍ʹ޲͚ͯ 1. APIΛը໘ʹಛԽ͗ͨ͢͠ • ϚΠΫϩαʔϏεͱ͍͏ݴ༿͕͋ΔΒ͍͠ɻಋೖ͍ͨ͠ɻ 2. ങ͍෺͔͝ΛηογϣϯʹೖΕͨ • εςʔτϨεߏ੒ʹ͍ͨ͠ 3. APIαʔόͷεέʔϧΞ΢τ • ϩʔυόϥϯγϯάͷपΓΛࣗಈԽ͍ͨ͠ 4. ٸʹʮॲཧΛඇಉظʹ͢Δʯͱ͍͏ཁ͕݅ු্ • ඇಉظॲཧͷ࢓૊ΈΛඪ४Խ͍ͨ͠ 28
  29. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 29 #3 ϚΠΫϩαʔϏε
 τϥΠΞϧୈҰ஄
  30. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ΍ͬͨ͜ͱ 1. όοΫΤϯυͷॲཧΛϚΠΫϩαʔϏεͰ࡞੒ • ঎඼৘ใαʔϏεɺࡏݿαʔϏεɺྉۚαʔϏ εͳͲʹ෼ׂ 2. ٕज़ελοΫ • Spring Bootʢ1.2ܥʣ • Spring Cloudʢޙड़ʣ 30
  31. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ΍ͬͨ͜ͱ 1. όοΫΤϯυͷॲཧΛϚΠΫϩαʔϏεͰ࡞੒ • ঎඼৘ใαʔϏεɺࡏݿαʔϏεɺྉۚαʔϏεͳͲʹ෼ׂ 2. ॲཧͷڞ௨Խ • ಉظ HTTPʢ໭Γ஋͋Γʣ • ඇಉظ AMQPʢ໭Γ஋ͳ͠ʣ • RabbitMQΛ࠾༻ • ඇಉظ AMQPʢ໭Γ஋ or ίʔϧόοΫؔ਺ʣ • ඇಉظ HTTPʢ໭Γ஋ or ίʔϧόοΫؔ਺ʣ • ͜ΕΒ͸ར༻͠ͳ͍ 31
  32. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 1. ಉظॲཧɺඇಉظॲཧͱ΋ʹɺ
 ґଘΛ໌֬Խ͢Δ 32 ItemAccessor
 (Client) ItemController
 (Server) HTTP
 AMQP
  33. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 1. ಉظॲཧɺඇಉظॲཧͱ΋ʹɺ
 ґଘΛ໌֬Խ͢Δ 33 ItemService
 (interface) ItemAccessor
 (Client) ItemController
 (Server) HTTP
 AMQP implements implements
  34. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 1. ಉظॲཧɺඇಉظॲཧͱ΋ʹɺ
 ґଘΛ໌֬Խ͢Δ • ΫϥΠΞϯτଆɺαʔόଆͷίϯτϩʔϥ͕
 ಉ͡ΠϯλϑΣʔεΛ࣮૷͢Δ͜ͱͰɺ
 IDEͷOpen Call HierarchyʹΑΔ
 ݺͼग़͠ͷτϨʔε͕Ͱ͖Δ 34
  35. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ • Netflix͕ࣾOSSͰఏڙ͍ͯ͠Δ
 αʔϏεσΟεΧόϦͷ࢓૊Έ • ಈతʹ࢖͑ΔDNSతͳ΋ͷ 35
  36. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ 36 Eureka
 Server ItemAccessor
 (Client) ItemController
 (Server) ᶃىಈ࣌ʹࣗ਎ͷ
 ɹϗετ໊ͱ
 ɹϙʔτ൪߸Λొ࿥
  37. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ 37 Eureka
 Server ItemAccessor
 (Client) ItemController
 (Server) ᶄhttp://item-service/
 ɹΛ໰͍ձΘͤ
  38. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ 38 Eureka
 Server ItemAccessor
 (Client) ItemController
 (Server) ᶅItemServiceͷ
 ɹϗετ໊ͱ
 ɹϙʔτ൪߸Λ
 ɹฦ͢ʢෳ਺Մʣ
  39. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ 39 Eureka
 Server ItemAccessor
 (Client) ItemController
 (Server) ᶆड͚औͬͨ৘ใͰ
 ɹΞΫηε
  40. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ • αʔϏεΛʮԿ୆ʯʮͲͷαʔόͰʯ
 ʮͲͷϙʔτͰʯىಈͯ͠΋ྑ͍
 ɹˠ εέʔϧͷࣗ༝Խ • Spring Boot + Spring CloudΛ࢖͏͜ͱͰ
 ਺ߦͷઃఆ͚ͩͰར༻Մʢʂʣ 40
  41. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 3. JUnitͷൣғΛ໌֬Խ • ControllerҎ߱ͷςετʢJUnitʣ • αʔϏεͷػೳ୯ମςετ • αʔϏε୯ମͰͷend-to-endͷςετʢJUnit) • Spring BootͳΒJUnitͰ؆୯ʹͰ͖Δ • ओʹม׵ͱόϦσʔγϣϯͷࢼݧ • ֎෦αʔϏεݺͼग़͠෦෼͸ϞοΫԽ 41
  42. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 3. JUnitͷൣғΛ໌֬Խ • ෳ਺αʔϏεͷςετʢJUnitʣ • ֎෦αʔϏε͸௚઀ݺͼग़͢ 42
  43. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ 43 ItemService
 (interface) ItemAccessor
 (Client) ItemController
 (Server) HTTP
 AMQP implements implements LogicΫϥε
  44. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ 44 TestCase ItemController
 (Server) LogicΫϥε ᶃΠϯελϯε
 ɹ࡞੒ ᶄItemServiceͷϞοΫͱͯ͠DI
  45. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ 45 TestCase ItemController
 (Server) LogicΫϥε ᶅ௚઀ݺͼग़͢
  46. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 4. σϓϩΠͷࣗಈԽ • ܰ͘࡞͚ͬͨͩͰ΋ɺे਺ͷαʔϏε͕͋ΔͷͰ
 σϓϩΠͷࣗಈԽ͸ඞਢ • ansibleΛར༻ʢchef͸࠳ંɾɾɾʣ • AWSͰ࢖͍ͬͯΔҎ্͸docker͸
 ͦΜͳʹϝϦοτ͕ͳ͍ͱࢥ͍ͬͯΔ 46
  47. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ྑ͔ͬͨ͜ͱ 1. ࣗ༝ͳεέʔϧΠϯɺεέʔϧΞ΢τ͕Ͱ͖ɺ
 ϩʔυόϥϯγϯά·ͰͰ͖ΔΑ͏ʹͳͬͨɻ 2. αʔϏεͷϗετ໊΍ϙʔτ൪߸Λ
 શ͘؅ཧ͠ͳͯ͘ྑ͘ͳͬͨ 3. ಉظɺඇಉظͷ։ൃͱςετͷ
 ඪ४తͳ΍Γํ͕ܾ·ͬͨ 47
  48. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ࣦഊͨ͜͠ͱ 48
  49. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ࣦഊͨ͜͠ͱ ಛʹͳ͠
 → ׬શʹϚΠΫϩαʔϏεΛϚελʔͨ͠ײ☺️ 49
  50. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ࣦഊͨ͜͠ͱ ಛʹͳ͠
 → ׬શʹϚΠΫϩαʔϏεΛϚελʔͨ͠ײ☺️
 ɾɾɾͱࢥͬͨΒɺ࣍ͷ։ൃͷ࣌ʹ͸
 ࠓճ࡞ͬͨϚΠΫϩαʔϏε͕
 Ζ͘ʹ࠶ར༻Ͱ͖ͳ͔ͬͨ 50
  51. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 51 #4 ϚΠΫϩαʔϏε
 τϥΠΞϧୈೋ஄
  52. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ ΍ͬͨ͜ͱ 1. ؅ཧը໘ͷϚΠΫϩαʔϏεԽ • ঎඼৘ใαʔϏεɺࡏݿαʔϏεɺ
 ྉۚαʔϏεͳͲΛ࠶։ൃ 2. ٕज़ελοΫ • Spring Bootʢ1.3ܥʣ • Spring Cloud 52
  53. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ ࠔͬͨ͜ͱ 1. ୈҰ஄Ͱ࢖͍ٕͬͯͨज़ελοΫͱͷޓ׵ੑ • ୈҰ஄ : Spring Boot 1.2 + Spring Cloud Angel • ୈೋ஄ : Spring Boot 1.3 + Spring Cloud Brixton
 ɹˠ AngelͷEurekaʹ
 ɹɹBrixtonͷαʔϏεΛొ࿥Ͱ͖ͳ͍
 ɹˠ BrixtonͷEurekaʹ
 ɹɹAngelͷαʔϏε͸ొ࿥Ͱ͖ͨ 53
  54. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ ࠔͬͨ͜ͱ 1. ୈҰ஄Ͱ࢖͍ٕͬͯͨज़ελοΫͱͷޓ׵ੑ • pom.xmlͷੈ୅෼͚ • pom.xmlʢ਌ʣ • pom_sb12.xml • pom_sb13.xml – ϙϦάϩοτͷߟ͑ํ͸ແࢹ 54
  55. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ ޻෉ͨ͜͠ͱ 1. ϞχλϦϯάͱΞϥʔτ • αʔόͷ୆਺΍ϓϩηε਺͕૿͑ΔͷͰ
 ؂ࢹ͕ෆՄܽ • ΍ͬͯͳ͔ͬͨΒຊ൪؀ڥͰো֐͕ɾɾɾ 55
  56. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ ޻෉ͨ͜͠ͱ 1. ϞχλϦϯάͱΞϥʔτ • CloudWatch + ΧελϜϝτϦΫεͰऩू • Ϧιʔε৘ใʢCPUɺϝϞϦɺσΟεΫʣ • ϓϩηε৘ใʢࢮ׆ʣ • ϩά͸CloudWatch LogsͱElasticsearchʹू໿ • ϩά؂ࢹ͸CloudWatchͰ࣮ࢪ • ϩά෼ੳΛElasticsearchͰ࣮ࢪ 56
  57. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 57 #5 ϚΠΫϩαʔϏε
 τϥΠΞϧୈࡾ஄
  58. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ΍ͬͨ͜ͱ 1. ߪೖը໘ͷϚΠΫϩαʔϏεԽ • ঎඼৘ใαʔϏεɺࡏݿαʔϏεɺ
 ྉۚαʔϏεͳͲΛ௥Ճ։ൃ 2. ٕज़ελοΫ • Spring Bootʢ1.3ܥʣ • Spring CloudʢBrixtonܥʣ • Spring Session + Hazelcastʢηογϣϯڞ༗ʣ 58
  59. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ࠔͬͨ͜ͱ 1. վΊͯɺը໘ʹAPI͕Ҿ͖ͮΒΕΔ • ϚΠΫϩαʔϏε : ঎඼ϦετAPI • ཉ͍͠αʔϏε : ൢചՄೳͳ঎඼ϦετAPI • αʔϏε = Repository? • ͜ͷลΓͰυϝΠϯ෼ׂͷॏཁੑʹؾͮ͘ 59
  60. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ࠔͬͨ͜ͱ 1. վΊͯɺը໘ʹAPI͕Ҿ͖ͮΒΕΔ • ϑϩϯταʔϏεʢίϯτϩʔϥαʔϏεʣͱ
 υϝΠϯαʔϏεͷ෼཭ • ϑϩϯταʔϏε͕ɺඞཁʹԠͯ͡ɺ
 υϝΠϯαʔϏεΛݺͼग़͢ 60
  61. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ࠔͬͨ͜ͱ 1. վΊͯɺը໘ʹAPI͕Ҿ͖ͮΒΕΔ • υϝΠϯαʔϏεͷAPI͸ɺݪଇͱͯ͠ɺ
 ʮ؅ཧը໘Ͱ࢖͑Δʯ͙Β͍ͷ࠶ར༻ੑΛ࣋ͭ 61
  62. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ࠔͬͨ͜ͱ 2. طଘॲཧʹ͋ΔڊେͳSQL͕෼ׂͰ͖ͳ͍ • ঎඼ɺࡏݿɺྉۚͷςʔϒϧͱɺ
 ͦΕͧͷؔ࿈ςʔϒϧΛ͕ͬͭΓjoinͨ͠SQL 62
  63. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ࠔͬͨ͜ͱ 2. طଘॲཧʹ͋ΔڊେͳSQL͕෼ׂͰ͖ͳ͍ • গͳ͘ͱ΋ɺ঎඼ɺࡏݿɺྉۚͷɺ
 υϝΠϯ͙Β͍ʹ͸෼཭͢Δ͕ɺ
 ؔ࿈ςʔϒϧͷ੾Γ֎͠͸͍ͬͨΜఘΊͨ
 ɹˠ ͜ͷลΓ͸ղܾࡦ͕ݟ͍͑ͯͳ͍ 63
  64. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 64 #6 ࠓޙ
 औΓ૊Έ͍ͨ͜ͱ
  65. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 6. ࠓޙऔΓ૊Έ͍ͨ͜ͱ ো֐ୈҰઃܭ 1. ো֐͕ى͖ΔલఏͰॲཧΛೖΕΔ • Circuit Breakerͱ͍͏֓೦ • ୯Ґ࣌ؒ͋ͨΓͷΤϥʔճ਺͕ᮢ஋Λ௒͑ͨΒ
 ৗʹ୅ସॲཧΛߦ͏ʢҰఆ࣌ؒͰ෮ؼʣ • NetflixͷHystrixͰ༰қʹ࣮ݱͰ͖Δ 2. ͱ͸ݴ͑ɺো֐͕ى͖ͨΒͲ͏͢Δͷʁ • ௨஌͢Δ • ௨৴ΤϥʔΛฦ͢ • ઐ༻ΤϥʔΛฦ͢ • ΩϟογϡΛฦ͢ 65
  66. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 6. ࠓޙऔΓ૊Έ͍ͨ͜ͱ Ωϟογϡ 1. υϝΠϯ͝ͱʹαʔϏεΛ෼͚Ε͹
 υϝΠϯͷಛੑ͝ͱͷΩϟογϡΛ࡞੒Ͱ͖Δ • ঎඼৘ใ΍ྉۚ͸සൟʹมΘΒͳ͍͔Β
 Ωϟογϡ͕ޮ͘ • ࡏݿ͸มಈ͢Δ͔ΒΩϟογϡ͕ޮ͔ͳ͍͠
 τϥϯβΫγϣϯ͸ݫີʹ͠ͳͯ͘͸͍͚ͳ͍ 66
  67. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 6. ࠓޙऔΓ૊Έ͍ͨ͜ͱ ϙϦάϩοτ 1. GoͷΑ͏ͳϝϞϦϑοτϓϦϯτͷখ͞ͳݴޠΛ࢖͍͍ͨ 2. ෳ਺ݴޠͰهࡌ͢Δͱ͖ͷোน͸ϛυϧ΢ΣΞ • EurekaΛଞͷݴޠͰ࢖͍͍ͨ 3. ੜ࢈ੑ΁ͷӨڹ • Spring Boot + Spring Cloud΄Ͳͷ
 ੜ࢈ੑΛग़ͤΔ૊Έ߹Θͤ͸গͳ͍ • IDEͷOpen Call HierarchyͰ΍͍ͬͯͨࣄ͕
 Ͱ͖ͳ͘ͳΔ 67
  68. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 6. ࠓޙऔΓ૊Έ͍ͨ͜ͱ ΠϕϯτυϦϒϯ 1. ϦΫΤετΛΠϕϯτͱଊ͑ͯॲཧ͢Δ 2. ঢ়ଶભҠΛΠϕϯτͱଊ͑ͯॲཧ͢Δ 3. όονͳ͠ɺ͢΂ͯϦΞϧλΠϜͰॲཧ͢Δ 68
  69. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 69 #7 ຊ౰ʹ
 ϚΠΫϩαʔϏε͸
 ࠷ద͔ʁ
  70. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 7. ຊ౰ʹϚΠΫϩαʔϏε͸࠷ద͔ʁ ೔ຊͱԤถͷจԽͷҧ͍ 1. νʔϜϫʔΫͷҧ͍ • ถ : APIΛܖ໿ʹ͢ΔɻAPI͕Ͱ͖ͨΒؼ୐ɻ • ೔ : ΈΜͳͰ্ख͘ߦ͘Α͏ʹؤுΔɻ
 ɹɹશମͷͨΊʹAPIΛม͑Δ͜ͱΛ
 ɹɹ͋·ΓԀΘͳ͍ɻ 70
  71. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 7. ຊ౰ʹϚΠΫϩαʔϏε͸࠷ద͔ʁ ೔ຊͱԤถͷจԽͷҧ͍ 2. DBΞΫηεͷҧ͍ • ถ : JPAɺHibernateɺඞવతʹjoinগͳ͍ • ೔ : MyBatisɺDomaɺʢS2Daoʣ
 ɹɹ௕େͳSQL͕͋ͬͯjoin΋ଟ͍
 → ͜ͷ͍ͤͰطଘͷϞϊϦε͔Β
 ɹɹϚΠΫϩαʔϏε΁ͷҠߦ͕೉͘͠ͳΔɻ 71
  72. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 7. ຊ౰ʹϚΠΫϩαʔϏε͸࠷ద͔ʁ ೔ຊͱԤถͷจԽͷҧ͍ 3. ϚΠΫϩαʔϏε͸ʮ݁Ռ࿦ʯ • ࣗ෼ͷձࣾɺάϧʔϓɺϓϩδΣΫτʹͱͬͯ
 ద੾ͳΞʔΩςΫνϟʹͳΔΑ͏
 ࠷దԽ͢Δඞཁ͕͋Δɻ
 ڭՊॻͷ·ͶΛͯ͠΋μϝ 72
  73. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 73 ·ͱΊ
  74. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ·ͱΊ ϚΠΫϩαʔϏε͸݁Ռ࿦ ಉظɺඇಉظɺςετΛؚΊٕͨज़ղΛ໌֬Խ͢Δ Spring Boot + RabbitMQͰ͍·ͷͱ͜Ζ໰୊ͳ͠ ඞਢٕज़Λ೺Ѳ͢Δ αʔϏεσΟεΧόϦʢEurekaʣ εέʔϧΠϯɺΞ΢τɺLBɺσϓϩΠ σϓϩΠͷࣗಈԽʢChef / Ansibleʣ ϞχλϦϯάʢCloudWatch / Elasticsearchʣ ෼ׂཻ౓Ͱ೰ΜͩΒʮ؅ཧը໘Λ࡞ΕΔAPIʯ͕Ұͭͷ໨҆ ࣗ෼ͨͪͷ૊৫ʹ߹Θͤͨ࠷దԽ͕ඞਢ 74
  75. Copyright © Acroquest Technology Co., Ltd. All rights reserved. 75

    Enjoy your own microservices architecture!