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

インフラエンジニアとアプリ開発

 インフラエンジニアとアプリ開発

Ruby on Rails を使ったサービス開発と組織(ブラケット × みんなのウェディング)
https://mwed.connpass.com/event/64633/

Yokoyama Tatsuo

September 12, 2017
Tweet

More Decks by Yokoyama Tatsuo

Other Decks in Technology

Transcript

  1. ΠϯϑϥΤϯδχΞͱ
    ΞϓϦ։ൃ
    גࣜձࣾΈΜͳͷ΢ΣσΟϯά Πϯϑϥάϧʔϓ
    ԣࢁ ୡஉ

    View full-size slide

  2. ࣗݾ঺հ
    • ԣࢁୡஉ(@Yokoyama_tto)
    • ΈΜͳͷ΢ΣσΟϯάʹೖࣾͯͪ͠ΐ͏Ͳ1೥
    • લ৬͸SIerͷαϙʔτσεΫ(2014/04~2016/08)
    • झຯɿόϯυɺεϊʔϘʔυ

    View full-size slide

  3. 1೥લͷࢲ

    View full-size slide

  4. 1೥લͷࢲ
    • ࣗࣾαʔϏεॳΊͯ
    • RailsॳΊͯ
    • ԿΛ࣭໰͢Δ΂͖͔΋Θ͔Βͳ͍
    • AWSʹ͍ͭͯ͸ͪΐͬͱ஌ͬͯΔ

    View full-size slide

  5. ΠϯϑϥΤϯδχΞͷ࢓ࣄ

    View full-size slide

  6. ΠϯϑϥΤϯδχΞͷ࢓ࣄ(ੲ)
    • ωοτϫʔΫߏங
    • αʔόߏங
    • ߏஙͨ͠γεςϜͷӡ༻ɾ؂ࢹ

    View full-size slide

  7. • ຊ൪ɺ։ൃ؀ڥͷߏ੒؅ཧ
    • ϩάऩूɺ෼ੳ
    ΠϯϑϥΤϯδχΞͷ࢓ࣄ(ࠓ)

    View full-size slide

  8. ฐࣾͷ৔߹

    View full-size slide

  9. ͍Ζ͍Ζ΍Δ
    • جຊ͸Πϯϑϥج൫ͷվળ׆ಈ
    • mobasif(چ)͔ΒRails(৽)΁ͷҠߦظؒ
    • چΞʔΩςΫνϟ͔Βͷ୤٫΋࢓ࣄͷ͏ͪ
    • σʔλ෼ੳج൫ӡ༻(fluentdɺRedShift)
    • CI࣮ݱͷͨΊͷج൫ߏஙӡ༻(ChatBot,CircleCI,CodeDeploy)

    View full-size slide

  10. mobasif
    • DeNAͰ࢖ΘΕ͍ͯͨΨϥέʔରԠͷϑϨʔϜϫʔΫ
    • 3ΩϟϦΞͦΕͧΕͷҟͳΔϒϥ΢β࢓༷ʹ߹ΘͤΒΕΔ
    • PerlͰॻ͔Ε͍ͯΔ
    • ݟ௨͠ͷྑ͍ബ͍ϑϨʔϜϫʔΫ
    • ฐࣾ͸΋ͱ΋ͱDeNAͷࣾ಺ϓϩδΣΫτͩͬͨͷͰར༻

    View full-size slide

  11. ৺͕͚͍ͯΔ͜ͱ
    • ಥൃతͳґཔɾτϥϒϧ͕ଟ͍ɻ
    • ৗʹ͋Δఔ౓ͷόοϑΝʔΛ࣋ͬͯ࢓ࣄ͢Δɻ
    • ΞϓϦέʔγϣϯΤϯδχΞʹ૬ஊ͞ΕͨΒɺΠϯϑ
    ϥΤϯδχΞͱͯ͠΍ΓํͷےಓΛ఻͑Δɻ(AWSͷ
    ͜ΜͳαʔϏε࢖͏ͱΑͦ͞͏ͱ͔)
    • ͦͷͨΊʹ΋ৗʹ৘ใऩू

    View full-size slide

  12. ΠϯϑϥΤϯδχΞͷ೰Έ

    View full-size slide

  13. ΠϯϑϥΤϯδχΞͷ೰Έ
    • ໨ʹݟ͑ΔܗͰαʔϏεʹӨڹ͢Δ͜ͱ͕ͳ͍
    • ͳʹ΍͍ͬͯΔ͔ཧղ͞Ε͍ͯͳͦ͞͏
    • Πϯϑϥ͸ίετηϯλʔ
    • ಈ͍ͯ౰ͨΓલɻࢭΊͨΒΊͬͪΌౖΒΕΔɻ

    View full-size slide

  14. ͦΜͳঢ়گΛଧഁ͢ΔͨΊʹ

    View full-size slide

  15. ΞϓϦଆʹ΋खΛग़͍ͯ͜͠͏

    View full-size slide

  16. ΞϓϦଆʹ΋खΛग़͍ͯ͜͠͏
    • ΞϓϦͷੑೳվળ(εϩʔΫΤϦղফ)
    • ΞʔΩςΫνϟͷվળ(σʔϞϯͷsupervisor؅ཧ)
    • RailsΛֶͿ(RailsνϡʔτϦΞϧ΍ͬͯΈΔ)

    View full-size slide

  17. ΞϓϦͷੑೳվળ
    • εϩʔΫΤϦͷղফ
    • EXPLAIN͑͞஌Βͳ͍ঢ়گ͔Βελʔτ
    • ͱʹ͔͘ௐ΂ͯ৭ʑ΍ͬͯΈͨɻ
    • ݁Ռɺɺɺ

    View full-size slide

  18. Before
    After
    ࣮ߦ͕࣌ؒ1/60

    View full-size slide

  19. ΞʔΩςΫνϟͷվળ
    • mobasifͰ͸ࣗ࡞ͷϓϩάϥϜΛσʔϞϯԽͯ͠
    ར༻
    • αʔό࠶ىಈ࣌ʹࣗಈىಈ͠ͳ͍&མͪͨΒख
    ಈͰىಈ͠ͳ͖Ό͍͚ͳ͍ɻ
    • supervisorΛར༻Ͱ͖ΔΑ͏ʹվमɻsupervisor
    ͰσʔϞϯԽ͢ΔΑ͏ʹͨ͠ɻ

    View full-size slide

  20. Supervisorͱ͸
    • http://supervisord.org/
    • PythonͰॻ͔Ε͍ͯΔσʔϞϯԽπʔϧ
    • foregroundͰಈ͍͍ͯΔඞཁ͕͋Δ
    • ΋ͱ΋ͱσʔϞϯԽ͞Ε͍ͯΔϓϩάϥϜͳ
    ͷͰforegroundͰಈ͔ͤΔΑ͏վम

    View full-size slide

  21. RailsΛֶͿ
    • RailsνϡʔτϦΞϧ΍ͬͯΈΔ
    • ΞϓϦͷ࢓૊Έ͕Θ͔Δ͜ͱͰCIपΓʹ΋ख
    Λग़ͤΔΑ͏ʹͳͬͨ

    View full-size slide

  22. Πϯϑϥ͸ΞϓϦΛֶͼ࢝Ίͨ

    View full-size slide

  23. ΞϓϦ͕ΠϯϑϥΛֶͿ൪

    View full-size slide

  24. Ͱ΋Ͳ͏΍ͬͯʁ

    View full-size slide

  25. ΠϯϑϥΛֶͿ
    • ݕূ༻ʹAWSͷΞΧ΢ϯτΛ࡞੒
    • ݄ͷར༻ֹۚΛઃఆ͓ͯ͘͠($500͘Β͍)
    • AssumeRoleΛར༻͢Δ͜ͱͰ௨ৗͷΞΧ΢ϯ
    τ͔ΒγʔϜϨεʹར༻Մೳ

    View full-size slide

  26. ·ͱΊ
    • DevͱOpsͷ૬ޓཧղ͕େ੾ɻ
    • ΠϯϑϥΤϯδχΞ͸ΞϓϦͷ͜ͱΛֶͿɻ
    • ΞϓϦέʔγϣϯΤϯδχΞ͸Πϯϑϥͷ͜ͱΛֶͿɻ
    • ͦͷઌʹ͋Δͷ͸SREͱ͔ϑϧελοΫΤϯδχΞͱ͔
    ͳͷͰ͸ʁ
    • ΈΜͳӽڥ͍ͯ͜͠͏ɻ৭ʑग़དྷͨํָ͕͍͠ɻ

    View full-size slide

  27. ͝੩ௌ
    ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View full-size slide