Technical Successes and Failures in the History of Cookpad Development

Technical Successes and Failures in the History of Cookpad Development

2016/01/23 Cookpad TechConf 2016
http://techconf.cookpad.com/

6f8e101c016fa7ebbe58e693dbd86b7d?s=128

Issei Naruta

January 23, 2016
Tweet

Transcript

  1. ΫοΫύουͷܧଓతͳ੒௕ ͷͨΊʹ։ൃͱӡ༻͕
 ԿΛ͖ͯͨ͠ͷ͔ɺ ͦͷࣦഊͱ੒ޭʹ͍ͭͯ $PPLQBE5FDI$POG ΫοΫύουגࣜձࣾΠϯϑϥετϥΫνϟʔ෦ ੒ాҰੜ

  2. ੒ాҰੜ ͳΔͨ ͍͍ͬͤ !NJSBLVJ ΫοΫύουגࣜձࣾ ΠϯϑϥετϥΫνϟʔ෦௕ ೖࣾ೥໨

  3. େલఏ • ࣄۀ͸มԽ͢Δ • ૊৫͸มԽ͢Δ • ϓϩμΫτ΍ίʔυʹ͸ण໋͕͋Δ • ։ൃϦιʔε͸༗ݶͰ͋Δ

  4. ࠓ೔ͷςʔϚ • ݶΒΕͨϦιʔεͰɺͲ͏΍ͬͯ
 ૊৫΍ࣄۀͷมԽʹڧ͍։ൃΛߦ͏͔ • ௕ण໋Խͨ͠ΞϓϦέʔγϣϯͱ
 Ͳ͏޲͖߹͍͔ͬͯ͘

  5. ྺ࢙

  6. ʮΫοΫύουʯ͸ ͍͔ͭΒ͋Δͷʁ

  7. IUUQTJOGPDPPLQBEDPNDPSQPSBUFIJTUPSZ

  8. IUUQTXFCBSDIJWFPSHXFCIUUQXXXDPPLQBEDPN 

  9. IUUQTJOGPDPPLQBEDPNDPSQPSBUFIJTUPSZ

  10.  $PME'VTJPO3BJMT

  11. IUUQTJOGPDPPLQBEDPNDPSQPSBUFIJTUPSZ

  12. IUUQTTQFBLFSEFDLDPNB@NBUTVEBUIFSFDJQFGPSUIFXPSMETMBSHFTUSBJMTNPOPMJUI 

  13. ෆ໊༪

  14. ߃ྫͷSBLFTUBUT ൛ +----------------------+-------+-------+---------+---------+-----+-------+ | Name | Lines | LOC |

    Classes | Methods | M/C | LOC/M | +----------------------+-------+-------+---------+---------+-----+-------+ | Controllers | 53487 | 43106 | 578 | 4326 | 7 | 7 | | Helpers | 16467 | 13482 | 19 | 1544 | 81 | 6 | | Models |109238 | 86118 | 1938 | 9700 | 5 | 6 | | Mailers | 2259 | 1821 | 47 | 209 | 4 | 6 | | Workers | 797 | 678 | 23 | 38 | 1 | 15 | | Chanko units | 12737 | 10967 | 20 | 373 | 18 | 27 | | Libraries | 52295 | 43235 | 649 | 3954 | 6 | 8 | | Feature specs | 56569 | 45583 | 0 | 192 | 0 | 235 | | Request specs | 46276 | 39906 | 0 | 18 | 0 | 2215 | | Routing specs | 614 | 495 | 0 | 0 | 0 | 0 | | Controller specs | 64188 | 53000 | 6 | 128 | 21 | 412 | | Helper specs | 84918 | 70300 | 3 | 71 | 23 | 988 | | Model specs |163524 |135337 | 5 | 130 | 26 | 1039 | | Worker specs | 1156 | 959 | 0 | 1 | 0 | 957 | | Chanko unit specs | 9214 | 7596 | 0 | 11 | 0 | 688 | | Library specs | 26054 | 21809 | 25 | 125 | 5 | 172 | +----------------------+-------+-------+---------+---------+-----+-------+ | Total |699793 |574392 | 3313 | 20820 | 6 | 25 | +----------------------+-------+-------+---------+---------+-----+-------+ Code LOC: 199407 Test LOC: 374985 Code to Test Ratio: 1:1.9
  15. Ͱ͔͍ͱԿ͕ى͜Δͷ͔ ىಈʹ͕͔͔࣌ؒΔ ςετʹ͕͔͔࣌ؒΔ ੩తղੳܥπʔϧ͕ಈ͔ͳ͍ ϥΠϒϥϦ͕ಈ͔ͳ͍ σϓϩΠ͕େม Ϩʔϧʹ৐Εͳ͍

  16. ίʔυ΍؀ڥͷ࿝ٺԽ

  17. ͳͥਓ͸ શ෦ॻ͖௚ͨ͘͠ ͳΔͷ͔

  18. ࠒ શϦχϡʔΞϧܭը

  19. ϦχϡʔΞϧܭը • ΤϯδχΞ10ਓ͘Β͍ • ίʔυ͕ڊେɾෳࡶ͗ͯ͢ɺ৽ػೳͷ࣮૷͕ࠔ೉ • ͦ΋ͦ΋ࠓͷαʔϏε͸͜ΕͰ͍͍ͷͩΖ͏͔ʁ • ίʔυ΋αʔϏε΋ཧ૝తͳঢ়ଶʹͨ͠ɺ
 Զͨͪͷߟ͑ͨ࠷ߴͷΫοΫύουʹ͠Α͏

    w Α͠ϑϧεΫϥονͰॻͧ͘
  20. ϦχϡʔΞϧେࣦഊ

  21. Կ͕ىͬͨ͜ͷ͔ ʮαʔϏεͷίΞόϦϡʔΛநग़͢Δʯ ʮ៉ྷͳίʔυͰΠν͔Βॻ͖௚͢ʯ ͷ྆ํΛಉ࣌ʹ΍Ζ͏ͱͨ͠ ˠ͍ͭ·Ͱܦͬͯ΋࣮૷͕ऴΘΒͳ͍

  22. ࢓༷ͷ੔ཧͱ ϦϑΝΫλϦϯάΛ ಉ࣌ʹ΍Βͳ͍ํ͕͍͍ ֶͼ

  23. ख஗Εʹͳ͔ͬͯΒ ΍Βͳ͍ ֶͼ

  24. ೥ͷ3BJMTҠߦ͸
 ͳͥ͏·͍ͬͨ͘ͷ͔ ΤϯδχΞ5ਓ Rails ʹৄ͍ࣾ͠һ 0ਓ ͦΕ΄Ͳ೔ຊͰྲྀߦͬͯͳ͍

  25. ౰࣌ͷؔ܎ऀͷূݴ • αʔϏεͷػೳ͕·ͩগͳ͔ͬͨ • ͢Ͱʹ΅Ζ΅Ζ͔ͩͬͨΒɺ
 ͦΕҎ্ࣦഊ͠Α͏͕ͳ͔ͬͨ • ͦ΋ͦ΋ͦΜͳʹ੒ޭ͍ͯ͠ͳ͔ͬͨ • ʢҠߦ͸͕ͨ͠ɺ౰ॳ͔ͳΓෆ҆ఆͩͬͨʣ

    • ए͔ͬͨ
  26. Ͱ͸Ͳ͏͢Ε͹͍͍ͷ͔

  27. ຊ౰ʹཉ͍͠΋ͷ͸
 Կͩͬͨͷ͔ʁ

  28. ͳͥॻ͖௚͔ͨͬͨ͠ͷ͔ • αʔϏεͷܧଓతͳվળ͕͔ͨͬͨ͠ • ṖͷෳࡶͳϨΨγʔίʔυ͕ଟ͗ͯ͢
 ػೳͷվળ΍௥Ճ͕ࠔ೉

  29. ϨΨγʔίʔυΛ
 શ෦ॻ͖௚͞ͳͯ͘΋
 ։ൃ଎౓Λམͱͣ͞
 ܧଓతͳվળ͕Ͱ͖ΔΑ͏ʹ ͢Ε͹͍͍ͷͰ͸

  30. ϦχϡʔΞϧࣦഊ͕ੜΈग़ͨ͠ $IBOLP

  31. $IBOLP ຊ൪؀ڥͰͷτϥΠ&ΤϥʔΛࢧԉ͢Δ Rails ༻ gem Unit ͱ͍͏୯ҐͰطଘίʔυ΁ͷύονΛهड़ IUUQTHJUIVCDPNDPPLQBEDIBOLP

  32. " # طଘͷίʔυ A ΛɺελοϑϢʔβͷΈʹରͯ͠ ϕʔλ൛ͷίʔυ B ʹஔ͖׵͍͑ͨ ͨͩ͠ɺB ͸๯ݥతͳ࣮૷ͳͷͰɺྫ֎͕ൃੜ͢Δ͔΋͠Εͳ͍

    طଘͷ$POUSPMMFSͷίʔυ ϕʔλ൛ͷίʔυ
  33. ελοϑͳΒ# #Ͱྫ֎͕ى͖ͨΒ" ελοϑҎ֎ͳΒ" ϑϥάͰ෼ذ͍ͤͯ͘͞ͱίʔυ͕ԚΕ͍ͯ͘

  34. ϕʔλػೳͷ6OJU طଘͷ$POUSPMMFSͷίʔυ " # Chanko Ͱ͸ɺUnit ͱ͍͏ϑΝΠϧʹϕʔλػೳͷϩδοΫΛهड़͢Δ invoke ৚݅Λຬͨͨ͠৔߹ʹɺطଘϩδοΫ (A)

    ͷ୅ΘΓʹ Unit (B) ͕࣮ߦ͞ΕΔ B ͕ྫ֎Λىͨ͜͠৔߹͸ɺݩͷ A ͕࣮ߦ͞ΕΔͨΊɺϢʔβʹ͸Τϥʔ͕ฦΒͳ͍ JOWPLF৚݅
  35. ແࣄʹՁ஋͕ೝΊΒΕͨΒ ຊ൪ͷ඼࣭ͷίʔυʹ࢓্͛Δ طଘίʔυΛॻ͖׵͑ɺUnit ϑΝΠϧΛফ͢
 ʢ௨শ Un-chankoʣ

  36. d ଟαʔϏε࣌୅

  37. None
  38. ΫοΫύου
 ຊମίʔυ ผϓϩδΣΫτ 3BJMT

  39. ϓϩδΣΫτͷ෼͔Εํ • ࠷ॳ͔ΒผϓϩδΣΫτͱͯ͠࡞ΒΕɺ ޙ͔Βຊମͱ࿈ܞͨ͠ύλʔϯ • ࠷ॳ͸ຊମͷҰ෦ͱͯ͠࡞ΒΕɺ
 ޙ͔Β෼཭ͨ͠ύλʔϯ

  40. 8PSME`TMBSHFTU SBJMTNPOPMJUI Λ୤٫͍ͨ͠

  41. ϓϩδΣΫτ෼ׂํ਑ • ৽نαʔϏεΛ࡞Δͱ͖ • ຊମͱີ݁߹ͤ͟ΔΛಘͳ͍΋ͷ͸ຊମͰ࣮૷ • ͦ͏Ͱͳ͍΋ͷ͸࠷ॳ͔ΒผϓϩδΣΫτͰ • طଘαʔϏε •

    ෼ׂՄೳͳ΋ͷ͸ॱ࣍෼ׂ͍ͯ͘͠
  42. ʙ αʔϏεͷ෼ׂ

  43. IUUQUFDIMJGFDPPLQBEDPNFOUSZ ͱͯ΋͍͍هࣄɺ͓͢͢Ί

  44. ʮຊ౰͸Կ͕͍ͨ͠ͷ͔ʯΛݟۃΊΔ • γϯϓϧͳ࡞Γʹม͍͑ͨ • ෆཁͳίʔυ͕ॏͳΓɺಈ࡞͕஗͘ͳͬ ͍ͯΔͱ͜ΖΛղফ͍ͨ͠ • ৽͍͠ϥΠϒϥϦɺ৽͍ٕ͠ज़ΛऔΓ ࠐΊΔΑ͏ʹ͍ͨ͠

  45. େࣄͳ͜ͱ Ұͭͣͭ΍Δ

  46. ೋஈ֊ͷΞϓϦέʔγϣϯ෼཭ 1.ΫοΫύουຊମΛ fork ͠ɺෆཁ෦෼ Λૈํফͯ͠ςετΛ௨͢ 2.rails new ͨ͠৽نϓϩδΣΫτʹ
 ࣸܦͯ͠ςετΛ௨͢

  47.  ຊମίʔυΛGPSL  ෆཁͳ෦෼Λૈํ࡟আ  ςετΛ௨͢ ୈஈ֊

  48. ͜ͷ࣌఺Ͱ͸ • ʮ͓͍͍݈͠߁ʯ͚ͩͷςετ࣮ߦɺ
 σϓϩΠ͕Մೳʹͳͬͨ • ͜Ε͚ͩͰ΋े෼ࣄۀతͳԸܙ͕͋Δ • ফ͖͠Εͳ͔ͬͨґଘϥΠϒϥϦɺ
 ϞϯΩʔύον౳͕ଟ਺࢒͍ͬͯΔঢ়ଶ •

    ςετ࣮ߦ͕஗͔ͬͨΓɺϨʔϧ͔Β
 ͸ͣΕͨΓ͍ͯ͠Δͷ͕໰୊
  49. SBJMTOFXͨ͠৽نίʔυϕʔεʹ ϩδοΫΛҠ২͍͖ͯ͠ɺ طଘͷςετ͕௨Δ͜ͱΛ໨ࢦ͢ ୈஈ֊

  50. ஫ҙ఺ • ϩδοΫ͸Ҡಈ͢Δ͚ͩ • ϦϑΝΫλϦϯάͨ͘͠ͳͬͯ΋
 զຫ͢Δ • ςετΛ௨աͤ͞Δ͜ͱʹूத

  51. ʮ͓͍͍݈͠߁ʯ෼཭੒ޭ͔Βͷֶͼ • ϑϧεΫϥονͰॻ͖௚͞ͳ͔ͬͨ • ࢓༷มߋ΍ϦϑΝΫλϦϯάΛߦΘͣɺ ෼཭͚ͩΛߦͬͨ • খن໛ʹগͣͭ͠ਐΊ͍ͯ͘͜ͱͰɺ ͦΕͧΕͷஈ֊ͰࣄۀతͳϝϦοτΛ ڗडͰ͖ͨ

  52. ෼཭ʹΑΔԸܙ • ΫοΫύουຊମ • ࣄۀͻͱͭ෼ίʔυ͕খ͘͞ͳͬͨ • ͓͍͍݈͠߁ • Ϩʔϧʹ৐ͬͨී௨ͷ
 Rails

    ΞϓϦέʔγϣϯʹͳΕͨ • ܰྔͰϞμϯͳ։ൃ؀ڥʹͳͬͨ
  53. ίʔυ඼࣭

  54. ίʔυ඼࣭͸Ϗδωεʹ Өڹ͢Δ͔ʁ

  55. ΫοΫύουͷ౴͑ :&4

  56. ίʔυͷ඼࣭ • Մಡੑ • ϝϯςφϯεੑ • όάͷ༗ແ • ηΩϡϦςΟ

  57. ίʔυͷ඼࣭͕Өڹ͢Δ΋ͷ • ։ൃޮ཰ • ଐਓੑ wίʔυͷण໋

  58. Ͳ͜·Ͱ΍Δ΂͖͔ʁ ΍Γ͗͢ͳ͍ ʮ៉ྷͳίʔυʯΛॻ͘͜ͱࣗମ͕໨తͰ͸ͳ͍ ࣄۀϑΣʔζʹͱͬͯඞཁͳ඼࣭·ͰΛ໨ࢦ͢

  59. ίʔυϨϏϡʔ • ࣭ͷߴ͍ίʔυϨϏϡʔ͕ίʔυ඼࣭ Λ͋Δఔ౓୲อ͢Δ • ෛͷҨ࢈Λ࢒͠ʹ͘͘ͳΔ

  60. ίʔυϨϏϡʔΞϯνύλʔϯ • ࠣࡉͳจ๏ͷ޷ΈͰᎍΊΔ • ΠϯσϯτɺׅހͳͲ • ͱʹ͔͘ෆໟ

  61. ίʔυن໿͕͋Δͱ ίʔυϨϏϡʔͷޮ཰͕ ྑ͘ͳΔ ֶͼ

  62. IUUQTHJUIVCDPNDPPLQBETUZMFHVJEF

  63. None
  64. ಛ௃ ͦΜͳΜͲͬͪͰ΋͍͍ͩΖͱ ͍͏ͷ΋݁ߏܾΊͯΔ

  65. ೥͘Β͍ӡ༻ͯ͠Έͯ • ࠷ॳ͸൓ରҙݟ΋ଟ͔ͬͨʢ๻΋ʣ • ϏδωεͷίʔυϨϏϡʔͳͷʹจ๏ ͷ͠ΐ͏΋ͳ͍࿦૪͕ల։͞ΕΔɺ
 Έ͍ͨͳͷΛݟ͔͚ͳ͘ͳͬͨ • จ๏ͷ࿦૪͸ελΠϧΨΠυͷํͰ
 ΍Ε͹Α͍

    • ͋ͬͯΑ͔ͬͨελΠϧΨΠυ
  66. Πϯϑϥͷ࿝ٺԽ

  67.  %$"84

  68.  &$$MBTTJD71$

  69. ೋ౓ͷʮશ୆࡞Γ௚͠ʯΛܦͯ • ໾ׂͷΑ͘Θ͔Βͳ͍
 Ṗͷαʔό͕౫ଡ͞Εͨ • શαʔό͕ Infra as Code Խ͞Εͨ

    • Ͳ͘͞͞Ͱ OS ΍֤छύοέʔδ͕ ΞοϓσʔτͰ͖ͨ
  70. Πϯϑϥ࿝ٺԽ໰୊ • ͢Ͱʹଘࡏ͠ͳ͍αʔόͷ Puppet • OS ΍ϛυϧ΢ΣΞ͕ݹ͍·· • ؀ڥ͕ݹͯ͘ੈ͔ؒΒִ཭͞ΕΔ

  71. Πϯϑϥ࿝ٺԽͷಛ௃ • ಈ͍͍ͯ͑͞Ε͹ɺΞϓϦέʔγϣϯ ίʔυ΄Ͳ͸࿝ٺԽ͕໰୊ʹ
 ͳΓʹ͍͘ • େ෯ͳόʔδϣϯΞοϓ͸େม͔ͭ࣌ ͕͔͔ؒΔͷͰɺඞཁʹͳ͔ͬͯΒ
 ಈ͖࢝ΊΔͷͰ͸஗͍

  72. ࣜ೥ભٶ IUUQTKBXJLJQFEJBPSHXJLJਆٶࣜ೥ભٶ

  73. ࣜ೥ભٶ ਆٶࣜ೥ભٶ͸ɺਆٶʢҏ੎ਆٶʣʹ͓͍ͯߦΘΕΔࣜ೥ભ ٶʢఆظతʹߦΘΕΔભٶʣͰ͋Δɻ ਆٶͰ͸ɺݪଇͱͯ͠20೥͝ͱʹɺ಺ٶʢߖେਆٶʣɾ֎ٶ ʢ๛डେਆٶʣͷೋͭͷਖ਼ٶͷਖ਼఼ɺ14ͷผٶͷશͯͷ఼ࣾ Λ଄Γସ͑ͯਆ࠲Λભ͢ɻ IUUQTKBXJLJQFEJBPSHXJLJਆٶࣜ೥ભٶ

  74. ࣜ೥ભٶͷ͕͍͜͜͢͝ • ଱༻೥਺ͷ୹͍ݐஙํࣜͳͷʹ
 ҏ੎ਆٶ͸͓Αͦ1300೥ଘࡏ͍ͯ͠Δ • 7ੈلͷ໻ੜݐஙͷٕज़͕ݱ໾Ͱ
 ఻ঝ͞Ε͍ͯΔ • ભٶͷ༻ࡐͱͳΔ໦ΛҭͯΔͷʹ
 200೥Ҏ্͔͔Δ

  75. ࡞Γ௚͢͜ͱΛ
 લఏʹ͢Δ͜ͱͰ
 ௕ण໋Խ ֶͼ

  76. None
  77. *OGSB*OGSB • CentOS 6.2 -> Ubuntu 14.04 (16.04) • Puppet

    -> Itamae • VPCωοτϫʔΫͷ࠶ઃܭ • ֤छύοέʔδɺϛυϧ΢ΣΞͷ
 όʔδϣϯΞοϓ • ͦͷଞϨΨγʔͷ࡮৽
  78. Πϯϑϥࣜ೥ભٶ • ৽͘͠࡞Δαʔό͸ infra2 Ͱ
 ϓϩϏδϣχϯά͢Δ • طଘͷαʔό΋গͣͭ͠ infra2 Ͱ


    ࡞Γ௚͍ͯ͘͠
  79. ·ͱΊ

  80. େલఏʢ࠶ʣ • ࣄۀ͸มԽ͢Δ • ૊৫͸มԽ͢Δ • ϓϩμΫτ΍ίʔυʹ͸ण໋͕͋Δ • ։ൃϦιʔε͸༗ݶͰ͋Δ

  81. ௕ੜ͖͢ΔࣄۀͷͨΊʹ
 ٕज़͕Ͱ͖Δ͜ͱ • ඼࣭΍৽͠͞Λอͭ͜ͱࣗମΛ
 ࢓૊ΈԽ͢Δ • ख஗ΕʹͳΔલʹগͣͭ͠΍Δ • ࡉ͔͘੒ޭମݧΛ࡞ΓɺΞοϓσʔτ ͷՁ஋Λ૊৫ʹ࣮ײͤ͞Δ