go in to microservices(wip)

go in to microservices(wip)

17eb0c1a9d70a94ce95401d046375e3c?s=128

Yoshiori SHOJI

September 26, 2015
Tweet

Transcript

  1. ʲੈք࠷େڃʳΫοΫύουͷ .JDSPTFSWJDFTԽʲ8*1ʳ :PTIJPSJ4IPKJ IUUQTXXXqJDLSDPNQIPUPTHVZTJF

  2. None
  3. レベル: じんしゅ: ヨシオリ 40 エンジニア

  4. レベル: じんしゅ: ヨシオリ 40 エンジニア ▶ アカウント

  5. レベル: じんしゅ: ヨシオリ 40 エンジニア ▶ アカウント ギットハブ: ツイッター: yoshiori

    @yoshiori
  6. レベル: じんしゅ: ヨシオリ 40 エンジニア ▶ アカウント ギットハブ: ツイッター: yoshiori

    @yoshiori ▶ コミュニティ
  7. レベル: じんしゅ: ヨシオリ 40 エンジニア ▶ アカウント ギットハブ: ツイッター: yoshiori

    @yoshiori ▶ コミュニティ java-ja: Asakusa.rb: しゅさいしゃ ゆうれいぶいん
  8. None
  9. 

  10. .JDSPTFSWJDFT IUUQNBSUJOGPXMFSDPNBSUJDMFTNJDSPTFSWJDFTIUNM ҰຕؠʢϞϊϦγοΫʣʹ࡞ΔͷͰ͸ͳ͘ ෳ਺ͷܰྔͳαʔϏεΛ૊Έ߹Θͤͯ࡞Δ ͱ͍͏Ξϓϩʔν

  11. .JDSPTFSWJDFT IUUQNBSUJOGPXMFSDPNBSUJDMFTNJDSPTFSWJDFTIUNM ҰຕؠʢϞϊϦγοΫʣʹ࡞ΔͷͰ͸ͳ͘ ෳ਺ͷܰྔͳαʔϏεΛ૊Έ߹Θͤͯ࡞Δ ͱ͍͏Ξϓϩʔν 細かく説明してると 時間無くなるので ググって

  12. None
  13. 

  14. .JDSPTFSWJDF1SFNJVN IUUQNBSUJOGPXMFSDPNCMJLJ.JDSPTFSWJDF1SFNJVNIUNM ຆͲͷγεςϜ͸ɺ ୯ҰͷϞϊϦγοΫΞϓϦέʔγϣϯͱͯ͠ ߏங͞ΕΔ΂͖Ͱ͢ɻ

  15. None
  16. ͭ·Γ΄ͱΜͲ ͷγεςϜ͸ϚΠ ΫϩαʔϏεԽ ͢΂͖Ͱ͸ͳ͍

  17. None
  18. ͪΐͬͱ͚ͩ ໭ͬͯ 

  19. ੈք࠷େڃͷ ϞϊϦγοΫ3BJMT αʔϏε IUUQTTQFBLFSEFDLDPNB@NBUTVEBUIFSFDJQFGPSUIF XPSMETMBSHFTUSBJMTNPOPMJUI

  20. ϑΝ΢ϥʔʹઌۦ͚ͯ ʮ͜Μ͚ͩσΧΠαΠτͰ΋Ϟ ϊϦγοΫʹ͍͚Δͷʹຊ౰ʹ ͓લΒNJDSPTFSWJTFTඞཁ ͳͷʁʯͱ໰͍͔͚Δ

  21. ࣮ࡍ ͲΜͳ΋Μͳͷ͔

  22. 

  23. SBLF TUBUT  +----------------------+-------+-------+---------+---------+-----+-------+ | Name | Lines | LOC

    | Classes | Methods | M/C | LOC/M | +----------------------+-------+-------+---------+---------+-----+-------+ | Controllers | 51762 | 41676 | 554 | 4170 | 7 | 7 | | Helpers | 15863 | 12986 | 18 | 1478 | 82 | 6 | | Models | 104034 | 81971 | 1851 | 9241 | 4 | 6 | | Mailers | 2150 | 1729 | 42 | 203 | 4 | 6 | | Workers | 639 | 540 | 20 | 31 | 1 | 15 | | Chanko units | 10341 | 8587 | 8 | 229 | 28 | 35 | | Libraries | 50661 | 41872 | 626 | 3790 | 6 | 9 | | Feature specs | 49901 | 40916 | 0 | 205 | 0 | 197 | | Request specs | 43437 | 37448 | 0 | 19 | 0 | 1968 | | Routing specs | 627 | 505 | 0 | 0 | 0 | 0 | | Controller specs | 63678 | 52586 | 6 | 128 | 21 | 408 | | Helper specs | 81289 | 67277 | 3 | 69 | 23 | 973 | | Model specs | 156941 | 129837 | 5 | 124 | 24 | 1045 | | Worker specs | 901 | 747 | 0 | 1 | 0 | 745 | | Chanko unit specs | 11476 | 9210 | 0 | 12 | 0 | 765 | | Library specs | 24911 | 20824 | 26 | 116 | 4 | 177 | +----------------------+-------+-------+---------+---------+-----+-------+ | Total | 668611 | 548711 | 3159 | 19816 | 6 | 25 | +----------------------+-------+-------+---------+---------+-----+-------+ Code LOC: 189361 Test LOC: 359350 Code to Test Ratio: 1:1.9
  24. े෼Ͱ͔͍

  25. ͜Ε͚ͩσΧΠ΋ ͷΛ੾Γ෼͚Δͷ ͸ͳ͔ͳ͔ ܦݧͰ͖ͳ͍

  26. ྫDPPLQBEྉཧಈը

  27. Ͳ͏੾Γ෼͚Δ͔ IUUQTXXXqJDLSDPNQIPUPTKF⒎SFZXX

  28. ॎʹ੾Δ PS ԣʹ੾Δ

  29. DPPLQBEDPN ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϞϊϦγοΫͳߏ੒ SFDJQFT VTFS@LPOEBUFT

    LJUDIFOT DBUFHPSZ IPOPS@SFDJQF WJEFPT
  30. DPPLQBEDPN ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ॎʹ੾Δ SFDJQFT VTFS@LPOEBUFT

    LJUDIFOT DBUFHPSZ IPOPS@SFDJQF WJEFPT ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ
  31. DPPLQBEDPN ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ϛυϧ΢ΣΞ ͜͜ SFDJQFT VTFS@LPOEBUFT

    LJUDIFOT DBUFHPSZ IPOPS@SFDJQF WJEFPT ԣʹ੾Δ
  32. Θ͔Γʹ͍͘ͷͰ ۩ମతʹݴ͏ͱ ಈըΤϯίʔυ  ഑৴γεςϜ

  33. IUUQTTQFBLFSEFDLDPNZPTIJPSJIBQQZWJEFPUSBOTDPEJOHXJUIFMBTUJDUSBOTDPEFS Τϯίʔυ഑৴γεςϜͷ ৄ͍͠࿩͸ίνϥ

  34. ੾Γ෼͚Δ w ॎʹ੾Δ w ϏδωεྖҬʹΑͬͯ੾Γ෼͚Δ w جຊ͸͜ͷܗ w ԣʹ੾Δ w

    ػೳͰ੾Γ෼͚Δ w ಛఆͷྖҬʹಛԽͨ͠&WFSZUIJOHBTB4FSWJDFతͳ΋ͷ
  35. ڞ௨ݴޠ IUUQTXXXqJDLSDPNQIPUPT!/

  36. (BSBHF w 3BJMTHFNJpFEQMVHJOT w 3&45GVM)ZQFSNFEJB"1* w 3&45GVMͰ͋Γɺ)ZQFSNFEJBʹݱ࣮తͳϨϕϧͰରԠ w $PPLQBEͷαʔϏεؒ࿈ܞ͸͜ΕΛϕʔεʹ΍ΓऔΓͯ͠Δ w

    αʔόಉ࢜΋ɺJ04ɺ"OESPJEͳͲͷΞϓϦͱͷ࿈ܞ΋ w 044ͱͯ͠ެ։ͯ͋͠Δʢ3VCZͷΫϥΠΞϯτ΋ʣ w IUUQTHJUIVCDPNDPPLQBEHBSBHF w IUUQTHJUIVCDPNDPPLQBEHBSBHF@DMJFOU
  37. IUUQTXXXqJDLSDPNQIPUPTDISJTUJBOIBVHFO ԣʹ੾Δ

  38. &WFSZUIJOHBTB4FSWJDF w ଞͷαʔϏεͰ΋࢖͑ΔΑ͏ʹ࠷ॳ͔Βߟ͓͑ͯ͘ w ͨͱ͑͹ಈը഑৴γεςϜ͸DPPLQBE΋͘Β͠ͷ͖΄Μ΋ ಉ͡ΤϯυϙΠϯτΛୟ͍͍ͯΔ w αʔϏε͝ͱʹཱͯΔΑ͏ʹ͸͠ͳ͍ w εέʔϧͤ͞΍͍͢

    w σϓϩΠ΍։ൃ؀ڥ΋γϯϓϧʹอͯΔ
  39. IUUQTXXXqJDLSDPNQIPUPTSPCCO ॎʹ੾Δ

  40. IUUQTDPPLQBEWJEFPKQ

  41. ࣮ࡍ΍ͬͯΈΔͱ݁ߏେมͩͬͨ wυϝΠϯͱΫοΩʔͷ໰୊ wΩϟογϡઓུͷ໰୊

  42. υϝΠϯͱΫοΩʔͷ໰୊ w ׬શಉҰυϝΠϯ w DPPLQBEDPNWJEFPT w αϒυϝΠϯ w WJEFPTDPPLQBEDPN w

    ׬શผυϝΠϯ w DPPLQBEWJEFPKQ
  43. ׬શಉҰυϝΠϯ w ΫοΩʔ׬શʹڞ௨ w ͳͷͰͦΕͧΕผͷΞϓϦέʔγϣϯͰ
 ಉ͡ηογϣϯΫοΩʔΛ࢖͏Α͏ͳ͜ͱʹͳΓ͔Ͷͳ͍ ͷͰ஫ҙ͕ඞཁ w DTT΍JNBHFͷ1BUI΋஫ҙ w

    DPPLQBEຊମͷΞϓϦ͕࢖͏JNBHFTMPHPQOH ͱWJEFP͕࢖͏JNBHFTMPHPQOH͕ಉ͡΋ͷʹͳ Δ
  44. αϒυϝΠϯ w ΫοΩʔҰ෦ڞ༗ w DPPLQBEDPNͳͲʹ͠ͳ͚Ε͹جຊDPPLJF͕ಉ ҰʹͳΔ͜ͱ͸ͳ͍ w ্هΛར༻͢Ε͹ϩάΠϯঢ়ଶͷҾ͖ܧ͗ͳͲ΋ൺֱతʹ ؆୯ DPPLQBEDPNʹ࣋ͨͤΕ͹ྑ͍ʣ

    w DTT΍JNBHFͷ1BUI΋ผʹͳΔ
  45. ׬શผυϝΠϯ w ΫοΩʔ׬શผ w ڞ༗Խ͢Δ͢΂͕ͳ͍ w ϩάΠϯͷҾ͖ܧ͗ͱ͔ग़དྷͳ͍ w DTT΍JNBHFͷ1BUI΋׬શʹผʹͳΔ

  46. υϝΠϯͱΫοΩʔͷ໰୊ ͜ΕΒٕज़తͳ΍ΕΔ͜ͱɺ ΍Εͳ͍͜ͱΛ౿·͑ͯɺ 4&0ͳͲ΋ߟ͑ ͲͷܗࣜͰߦ͔͘ΛܾΊΔ

  47. Ωϟογϡઓུͷ໰୊ େલఏͱͯ͠ "1*ͷΤϯυϙΠϯτ͸ ͳΔ΂͘γϯϓϧʹ ͓͖͍ͯͨ͠

  48. Ωϟογϡઓུͷ໰୊ w ୯ҰϦιʔε"1*ʹ͓ͯ͘͠ͱ w NTͰฦ͢ͱͯ͠΋ݸͰNT w )551ͷίωΫγϣϯίετߴ͍ w ͦͷ··NFNDBDIFEʹΩϟογϡͯ͠΋ճ໰͍ ߹Θͤ͸มΘΒͳ͍

    ྫ͑͹ಈըτοϓϖʔδͰݸͷϨγϐΛ঺հ͍ͯͨ͠৔߹
  49. Ωϟογϡઓུͷ໰୊ w ෳ਺ಉ࣌໰͍߹Θͤ 42-ͷJO۟ͷΑ͏ʹJEෳ਺౉ͤΔ Ͱ͖ΔΑ͏ʹ͢Δͱ w ݸ໰͍߹Θͤͯݸ͔͠Ұக͠ͳ͔ͬͨ৔߹ɺΤϥʔ Λฦ͢΂͖͔औಘͰ͖ͨ෼͚ͩฦ͢΂͖͔ w ໰͍߹Θͤଆ΋ݸʹͳΔ·Ͱ܁Γฦ͠໰͍߹ΘͤΔ΂

    ͖͔ w ͦͷෳ਺ΛҰؾʹΩϟογϡ͢΂͖͔ w ॲཧ͕ෳࡶʹͳΔ
  50. Ωϟογϡઓུͷ໰୊ ͔͠΋͜Ε͕ଟஈʹͳΔ͜ͱ΋͋Δ DPPLQBEDPN DPPLQBEWJEFPKQ ಈը഑৴αʔό τοϓʹදࣔ͢ΔҰཡ௖ଷ Ұཡͷಈըϝλσʔλ௖ଷ

  51. Ωϟογϡઓུͷ໰୊ ࠓͷͱ͜Ζ7BSOJTIͰ ͦ΋ͦ΋ΞϓϦέʔγϣϯαʔόʹདྷΔલʹฦ͢ ͔ ୯ҰϦιʔε"1*ΛNFNDBDIFEʹೖΕΔ ͷΛ࢖͍෼͚͍ͯΔ͕ ·ͩ·ͩߟ͑Δ༨஍͸͋Δ

  52. IUUQTXXXqJDLSDPNQIPUPTKBLFSVTU (BSBHFͷଞʹࣾ಺Ͱ ϥΠϒϥϦԽ͞ΕͨΓ ͯ͠ڞ༗͞ΕͯΔ΋ͷ

  53. w 17΍BVEJUܥ ͷϩάऩू w ΧελϜͳ਺஋ औಘγεςϜ w ϩάΠϯपΓ w ϔομϑομ

    w ޿ࠂ w σϓϩΠपΓ w $*पΓ w Τϥʔूܭ ڞ༗
  54. ࣮ࡍ੾Γ෼͚ͯΈͯ

  55. ΍ͬͯΈͯΑ͔ͬͨ w ߏ଄ͳͲ͕γϯϓϧʹͳͬͨ w ୯७ʹؾ͍͍࣋ͪ w WJFXͷϨϯμϦϯά͕ૣ͘ͳͬͨ w ࢥ͍੾ͬͨࢪࡦΛೖΕ΍͍͢ w

    ࣮ࡍʹ਺ࣈʹ΋ݱΕ͍ͯΔ
  56. ͨͱ͑͹QKBY

  57. ͨͱ͑͹QKBY

  58. IUUQTEFWFMPQFSBQQMFDPNMJCSBSZTBGBSJEPDVNFOUBUJPO"VEJP7JEFP$PODFQUVBM 6TJOH@)5.-@"VEJP@7JEFP%FWJDF4QFDJpD$POTJEFSBUJPOT%FWJDF4QFDJpD$POTJEFSBUJPOTIUNM εϚϑΥͷϒϥ΢β͸ϢʔβʔΠϕϯτ ʢUPVDI΍DMJDLʣҎ֎Ͱ ϝσΟΞΛ࠶ੜ͢Δ͜ͱ͸ग़དྷͳ͍ POMPBEͱ͔ͷΠϕϯτͰࣗಈ࠶ੜΛ͢Δ͜ͱ͸ ग़དྷͳ͍

  59. ࣮͸ී௨ͷϦϯΫͰ͸ͳ͍ λοϓ͢Δͱ QKBYͰը໘Λॻ͖׵͑ͳ ͕ΒಈըΛ࠶ੜͯ͠Δ ը໘ભҠ͸͍ͯ͠ͳ͍

  60. ੾Γ෼͚ͯWJFX ͷ؅ཧΛࣗ෼ͨͪ ͚ͩͰͰ͖ΔΑ͏ ʹͳͬͨͷͰ࣮ݱ Ͱ͖ͨ

  61. ੾Γ෼͚ͯWJFX ͷ؅ཧΛࣗ෼ͨͪ ͚ͩͰͰ͖ΔΑ͏ ʹͳͬͨͷͰ࣮ݱ Ͱ͖ͨ

  62. Τϥʔ͕ൃੜͨ͠ΒࣗಈతʹJTTVFT੾ͬͯ ͘Εͯϝϯόʔͷ୭͔ʹΞαΠϯͯ͘͠ΕΔ

  63. Τϥʔूܭ͸4FOUSZͰ΍͍ͬͯ ΔͷͰQMVHJOॻ͍ͯެ։ͯ͋͠Δ IUUQTHJUIVCDPNZPTIJPSJTFOUSZOPUJGZHJUIVCJTTVFT

  64. ΫοΫύουͷ044ͱͷؔ܎ ࡞ͬͨ΋ͷ͸جຊ044Ͱυϯυϯެ։ͯ͠Δ w DPPLQBEDIBOLP w ϓϩτλΠϓ։ൃ༻ͷϓϥάΠϯ w DPPLQBESSSTQFD w ෼ࢄςετ

    w DPPLQBELBHF w TIBEPXQSPYZTFSWF
  65. w FBHMFUNUTXJUDI@QPJOU w 3%#38TQMJUUJOH w XJOFCBSSFMSJEHFQPM w εΩʔϚ؅ཧπʔϧ w TPSBINBNJZB

    w ߴ଎σϓϩΠ w FBHMFUNUGBNM w IBNߴ଎൛ w ࡉ͔͍΋ͷ͸਺͑ΒΕͣʜʜ
  66. ΋ͪΖΜ3VCZ΍3BJMTʹ΋ ίϯτϦϏϡʔτͯ͠Δ ๻΋ͪΐͬ͜ͱͯͨ͠Γ͢Δ

  67. Ͱ

  68. +----------------------+-------+-------+---------+---------+-----+-------+ | Name | Lines | LOC | Classes |

    Methods | M/C | LOC/M | +----------------------+-------+-------+---------+---------+-----+-------+ | Controllers | 51762 | 41676 | 554 | 4170 | 7 | 7 | | Helpers | 15863 | 12986 | 18 | 1478 | 82 | 6 | | Models | 104034 | 81971 | 1851 | 9241 | 4 | 6 | | Mailers | 2150 | 1729 | 42 | 203 | 4 | 6 | | Workers | 639 | 540 | 20 | 31 | 1 | 15 | | Chanko units | 10341 | 8587 | 8 | 229 | 28 | 35 | | Libraries | 50661 | 41872 | 626 | 3790 | 6 | 9 | | Feature specs | 49901 | 40916 | 0 | 205 | 0 | 197 | | Request specs | 43437 | 37448 | 0 | 19 | 0 | 1968 | | Routing specs | 627 | 505 | 0 | 0 | 0 | 0 | | Controller specs | 63678 | 52586 | 6 | 128 | 21 | 408 | | Helper specs | 81289 | 67277 | 3 | 69 | 23 | 973 | | Model specs | 156941 | 129837 | 5 | 124 | 24 | 1045 | | Worker specs | 901 | 747 | 0 | 1 | 0 | 745 | | Chanko unit specs | 11476 | 9210 | 0 | 12 | 0 | 765 | | Library specs | 24911 | 20824 | 26 | 116 | 4 | 177 | +----------------------+-------+-------+---------+---------+-----+-------+ | Total | 668611 | 548711 | 3159 | 19816 | 6 | 25 | +----------------------+-------+-------+---------+---------+-----+-------+ Code LOC: 189361 Test LOC: 359350 Code to Test Ratio: 1:1.9 .PEFMTDMBTT਺ 
  69. +----------------------+-------+-------+---------+---------+-----+-------+ | Name | Lines | LOC | Classes |

    Methods | M/C | LOC/M | +----------------------+-------+-------+---------+---------+-----+-------+ | Controllers | 51762 | 41676 | 554 | 4170 | 7 | 7 | | Helpers | 15863 | 12986 | 18 | 1478 | 82 | 6 | | Models | 104034 | 81971 | 1851 | 9241 | 4 | 6 | | Mailers | 2150 | 1729 | 42 | 203 | 4 | 6 | | Workers | 639 | 540 | 20 | 31 | 1 | 15 | | Chanko units | 10341 | 8587 | 8 | 229 | 28 | 35 | | Libraries | 50661 | 41872 | 626 | 3790 | 6 | 9 | | Feature specs | 49901 | 40916 | 0 | 205 | 0 | 197 | | Request specs | 43437 | 37448 | 0 | 19 | 0 | 1968 | | Routing specs | 627 | 505 | 0 | 0 | 0 | 0 | | Controller specs | 63678 | 52586 | 6 | 128 | 21 | 408 | | Helper specs | 81289 | 67277 | 3 | 69 | 23 | 973 | | Model specs | 156941 | 129837 | 5 | 124 | 24 | 1045 | | Worker specs | 901 | 747 | 0 | 1 | 0 | 745 | | Chanko unit specs | 11476 | 9210 | 0 | 12 | 0 | 765 | | Library specs | 24911 | 20824 | 26 | 116 | 4 | 177 | +----------------------+-------+-------+---------+---------+-----+-------+ | Total | 668611 | 548711 | 3159 | 19816 | 6 | 25 | +----------------------+-------+-------+---------+---------+-----+-------+ Code LOC: 189361 Test LOC: 359350 Code to Test Ratio: 1:1.9 .PEFMTDMBTT਺   ݮΒͤͨ
  70. None
  71. IUUQTSFDSVJUDPPLQBEDPN ͍ͬ͠ΐʹΨγΨγ044ʹίϯτϦϏϡʔτ͠ͳ͕Β ։ൃͯ͘͠ΕΔਓืूͯ͠·͢ʂ