Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
安全かつ高速に進めるマイクロサービス化 / railsdm2018
Search
Takashi Kokubun
March 24, 2018
Programming
23
16k
安全かつ高速に進めるマイクロサービス化 / railsdm2018
Rails Developers Meetup 2018
https://railsdm.github.io/
Takashi Kokubun
March 24, 2018
Tweet
Share
More Decks by Takashi Kokubun
See All by Takashi Kokubun
YJIT Makes Rails 1.7x faster / RubyKaigi 2024
k0kubun
7
13k
Ruby JIT Hacking Guide / RubyKaigi 2023
k0kubun
2
9.6k
YJIT: Dive into Ruby's JIT compiler written in Rust / Rust.Tokyo 2022
k0kubun
1
2k
Towards Ruby 4 JIT / RubyKaigi 2022
k0kubun
3
11k
Optimizing Production Performance with MRI JIT / RubyConf 2021
k0kubun
1
420
Why Ruby's JIT was slow / RubyKaigi Takeout 2021
k0kubun
3
1.9k
数時間かかる週一リリースを毎日何度も爆速でできるようにするまで / CI/CD Conference 2021
k0kubun
21
14k
Ruby 3 JIT's roadmap / RubyConf China 2020
k0kubun
0
780
Ruby 3.0 JIT on Rails
k0kubun
9
9.2k
Other Decks in Programming
See All in Programming
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
870
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.3k
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1.1k
AIレシート読み取り機能をRuby on Rails on AWSで実現するLLMにまつわるアレコレ / AI-based receipt reading function powered by LLM on Ruby on Rails on AWS
moznion
3
130
Azure AI Foundryのご紹介
qt_luigi
1
160
Package Traits
ikesyo
1
210
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
940
Androidアプリの One Experience リリース
nein37
0
1.1k
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
28
4k
AHC041解説
terryu16
0
340
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
580
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
6
700
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
13k
Faster Mobile Websites
deanohume
305
30k
Automating Front-end Workflow
addyosmani
1366
200k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Become a Pro
speakerdeck
PRO
26
5.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Agile that works and the tools we love
rasmusluckow
328
21k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
350
Navigating Team Friction
lara
183
15k
How to Ace a Technical Interview
jacobian
276
23k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Designing for Performance
lara
604
68k
Transcript
҆શ͔ͭߴʹਐΊΔ ϚΠΫϩαʔϏεԽ 3BJMT%FWFMPQFST.FFUVQ !LLVCVO
ࣗݾհ • GitHub, Twitter: @k0kubun • Treasure Data ॴଐ •
Site Reliability Engineer • Ruby 2.6ͷJITίϯύΠϥ։ൃத
Treasure Data Ͱͷ1ؒ • 2017 1Q: TD APIͷ։ൃ • 2017
2Q: bigdam-queue • 2017 3Q: Fluentd Enterprise • 2017 4Q: Embulk Config Microservice • 2018 1Q: SRE: AutoScaling, Deployment
ࠓ͢͜ͱ 1. αʔϏεׂͷલʹߟ͑Δ͖͜ͱ 2. ҆શ͔ͭߴʹׂ͢ΔͨΊͷςετख๏ 3. Railsʹ͓͚ΔϦτϥΠͷ࣮ύλʔϯ 4. RailsΞϓϦͷΓग़͠Ͱࠔͳ 5.
҆શʹσϓϩΠڥΛվળ͍ͯ͘͠
1. αʔϏεׂͷલʹߟ͑Δ͖͜ͱ
ϚΠΫϩαʔϏεԽͰ ԿΛղܾ͠·͔͢? Q1.
ฐࣾͷࠓճͷαʔϏεׂͷܦҢ : ࠓճͷΓग़͠ͰͲΕطʹେମղܾࡁͰ͢!!!
Ϟσϧͷ࣮ͷఆ͕ٛYAMLͱͯ͠ ผϦϙδτϦʹΓग़͞Ε͍ͯΔ
ຊମͷRailsΞϓϦͱผʹϦϦʔε͢ΔͨΊɺ ͦͷYAMLΛDBʹͭͬ͜ΜͰಈతʹڍಈΛมߋ + APIͰͦΕ͕ϦϦʔεͰ͖Δঢ়ଶ
APIʹΑΔYAMLͷϦϦʔεͰϝιουͷఆ͕ٛ ಈతʹมΘΔͷͰɺϝιουΛݺͼग़͢ʹΫ ΤϦ͕ඞཁʹͳΓ͍
ͦͦΓग़͞Ε͍ͯͳ͍Railsͷίʔυ ͱYAML͕ڧ݁߹ͳ͜ͱʹΑΔϦϦʔεॱং ґଘͷൃੜͱͦΕʹΑΔো
ຊ1ͭͷϦϙδτϦʹͨ͠ํ͕͍͍ʹܾ·͍ͬͯΔ͕ɺ Ͱ͖ΕΛ໌֬ʹͯ͠νʔϜؒͷίϛϡχέʔγϣ ϯίετΛԼ͛ͨΓಠཱʹϦϦʔεͨ͠Γ͍ͨ͠
=> YAML͡Όͳͯͪ͘ΌΜͱαʔϏεͱͯ͠͠Α͏
ϚΠΫϩαʔϏεԽͰൃੜ͢Δ શͯڐ༰Ͱ͖·͔͢? Q2.
ڥքΛލ͍ͰJOIN͕Ͱ͖ͳ͍
DBΛ͢ΔͱɺͦΕΛލ͙τϥ ϯβΫγϣϯ͕͔͚ΒΕͣҰ؏ੑ͕ ୲อͰ͖ͳ͘ͳΔ
ϦιʔεΛऔΔͨΊʹී௨ͷ ActiveRecordͷίʔυ͕͑ͳ͍
োൃੜݯͷ૿Ճ
αʔϏε͕૿͑Δ͜ͱʹΑΔ Πϯϑϥཧ/ӡ༻ίετͷ૿େ
ΤϯυϙΠϯτؙ͝ͱ͢Δ? ෦APIʹ͍ͯ͠ΖΜͳॴ͔Βୟ͘? Q3.
ࠓճ෦APIدΓͷɺ͔͠ ࠷ॳ͔Βͦ͏࡞ΔͷͰͳ్͘ தͰΓग़࣌͢ͷΛ͠·͢
2. ҆શ͔ͭߴʹׂ͢ΔͨΊͷςετख๏
ϚΠΫϩαʔϏεԽͷ࠷த ͲͷΑ͏ʹςετ͠·͔͢?
ओͳςετͷબࢶ • ϝιουݺͼग़͠୯ҐͰڥքΛશͯελϒ͢Δ • VCRͰ֎෦ͷϦΫΤετΛશͯελϒ͢Δ • ಈ͔͢ίϯϙʔωϯτΛશͯ༻ҙͯ݁͠߹ςετ • Pact Ͱ
Consumer Driven Contract Testing ࢀߟ: https://medium.com/@copyconstruct/testing-microservices-the-sane-way-9bb31d158c16
ςετͰ۩ମతʹԿΛୡ͍ͨ͠ͷ͔ • ୯ͳΔίϐϖͰࡁΈͦ͏ʹͳ͘ɺΓग़͢ॠ͕ؒҰ൪Ϧε Ϋ͕ߴ͍ͷͰɺͲ͏ʹ͔͚ͯͦͩ҆͜͠શʹࡁ·͍ͤͨ • ͔ͱ͍ͬͯઐ༻ͷςετΛҰ͔Βॻ͖·͘Δ΄ͲՋͰͳ ͍ͷͰɺۃྗطଘͷςετࢿ࢈Λྲྀ༻͍ͨ͠ • ͦͯ͠ଞͷ։ൃΛશ͘ࢭΊͨ͘ͳ͍ͷͰςετ͕ৗʹ༷ ͷมߋʹैͰ͖ͳ͍ͱ͍͚ͳ͍
ओͳςετͷબࢶ • ϝιουݺͼग़͠୯ҐͰڥքΛશͯελϒ͢Δ • VCRͰ֎෦ͷϦΫΤετΛશͯελϒ͢Δ • ಈ͔͢ίϯϙʔωϯτΛશͯ༻ҙͯ݁͠߹ςετ • Pact Ͱ
Consumer Driven Contract Testing ༷มߋʹର͢Δ ελϒͷैΛΕͦ͏
ओͳςετͷબࢶ • ϝιουݺͼग़͠୯ҐͰڥքΛશͯελϒ͢Δ • VCRͰ֎෦ͷϦΫΤετΛશͯελϒ͢Δ • ಈ͔͢ίϯϙʔωϯτΛશͯ༻ҙͯ݁͠߹ςετ • Pact Ͱ
Consumer Driven Contract Testing ୭͕Χηοτߋ৽͢Δͷ? ࣗಈͰߋ৽͢Δ ͳΒΧηοτʹͯ͠Δҙຯͳ͘ͳ͍?
ओͳςετͷબࢶ • ϝιουݺͼग़͠୯ҐͰڥքΛશͯελϒ͢Δ • VCRͰ֎෦ͷϦΫΤετΛશͯελϒ͢Δ • ಈ͔͢ίϯϙʔωϯτΛશͯ༻ҙͯ݁͠߹ςετ • Pact Ͱ
Consumer Driven Contract Testing ͜Εݩ͔Β͋ͬͯɺϝϯςίετ ߴ͍͕ҰԠͦͷ··͑Δ
ओͳςετͷબࢶ • ϝιουݺͼग़͠୯ҐͰڥքΛશͯελϒ͢Δ • VCRͰ֎෦ͷϦΫΤετΛશͯελϒ͢Δ • ಈ͔͢ίϯϙʔωϯτΛશͯ༻ҙͯ݁͠߹ςετ • Pact Ͱ
Consumer Driven Contract Testing ༷มߋΛ͢Δਓͨͪʹ͜ΕΛֶशͯ͠Β͏ίετ͕ߴ ͗͢Δ + Pact Brokerͷ༻ҙӡ༻ඞཁͳͷͰɺҰճͷ Γग़͠Ͱಋೖ͢ΔʹΦʔόʔΩϧ (ظతʹཉ͍͠)
͡Ό͋݁߹ςετ͚ͩΛཔΓʹͰ͖Δͷ͔? • ݱঢ়ɺ݁߹ςετओʹΫϦςΟΧϧͳڍಈʹରͯ͠ͷΈ ॻ͔Ε͓ͯΓɺͦΕ͚ͩͩͱखബ͍ • ͔ͱ͍ͬͯແҋʹ݁߹ςετΛ૿͢ͱอक͕͠ΜͲ͍ • ςετࣗମͷอक͕νʔϜʹด͡ͳ͘ͳΔͷͰίϛϡχ έʔγϣϯίετ͕ൃੜ •
ނো͕ଟͯ͘ෆ҆ఆʹͳΓ͕ͪ (ಛʹCapybaraͱ͔)
Γग़͠ݩΞϓϦͷrspecϓϩηε spec_helper.rb ࠓճ༻ͨ͠ςετख๏: Γग़ͨ͠ΞϓϦ Λىಈͯ͠ϢχοτςετΛΒͤΔ
Γग़͠ݩΞϓϦͷrspecϓϩηε spec_helper.rb Γग़ͨ͠RailsΞϓϦ ͷϓϩηε at_exit ࠓճ༻ͨ͠ςετख๏: Γग़ͨ͠ΞϓϦ Λىಈͯ͠ϢχοτςετΛΒͤΔ Spawn Kill
Γग़͠ݩΞϓϦͷrspecϓϩηε spec_helper.rb at_exit ڞ༗DB (ޙͰΓ͢) ࠓճ༻ͨ͠ςετख๏: Γग़ͨ͠ΞϓϦ Λىಈͯ͠ϢχοτςετΛΒͤΔ *_spec.rb FactoryBot
Γग़͢࠷த·ͩDB͕ڞ༗͞ΕͯΔ ͜ͱΛҰ࣌తʹ׆͔ͯ͠ςετΛಈ͔͢ Γग़ͨ͠RailsΞϓϦ ͷϓϩηε
Γग़͠ݩΞϓϦͷrspecϓϩηε spec_helper.rb at_exit ڞ༗DB (ޙͰΓ͢) ࠓճ༻ͨ͠ςετख๏: Γग़ͨ͠ΞϓϦ Λىಈͯ͠ϢχοτςετΛΒͤΔ *_spec.rb FactoryBot
Γग़ͨ͠RailsΞϓϦ ͷϓϩηε Γग़͠ݩ RailsΞϓϦ ԿελϒͤͣϦΫΤετ
Γग़͠ݩΞϓϦͷrspecϓϩηε spec_helper.rb at_exit ڞ༗DB (ޙͰΓ͢) ࠓճ༻ͨ͠ςετख๏: Γग़ͨ͠ΞϓϦ Λىಈͯ͠ϢχοτςετΛΒͤΔ *_spec.rb FactoryBot
Γग़ͨ͠RailsΞϓϦ ͷϓϩηε Γग़͠ݩ RailsΞϓϦ Γग़ͨ͠DB DBͷΓ͠ʹ͍FactoryBotΛଔۀ ͔ΘΓʹAPIͰϦιʔεΛ࡞Δ
͜ͷख๏ͷྑ͍ͱ͜Ζɺѱ͍ͱ͜Ζ • ྑ͍ͱ͜Ζ • ଞͷਓ͕มߋͨ͠ςετΛ΄΅ͦͷ··͑ɺͱʹ͔༷͘มߋʹڧ͍ • Կελϒ͠ͳ͍͍ͯ͘ͷͰςετΛॻ͘ͷָ͕ • ѱ͍ͱ͜Ζ •
Γग़͠ݩͷCIͷ͕࣌ؒ৳ͼΔ • Γग़ͨ͠ΞϓϦΛىಈ͢ΔखஈΛϝϯς͢Δίετ͕͔͔Δ • Γग़ͨ͠ΞϓϦͰյΕͨ࣌ͷσόοάํ๏͕গ͠มΘΔͷͰ໘
ۜͷؙͳ͍ͷͰࣗͨͪͷϑΣʔζཁ݅ ʹ߹ΘͤͯॊೈʹղܾࡦΛม͑ଓ͚·͠ΐ͏
3. Railsʹ͓͚ΔϦτϥΠͷ࣮ύλʔϯ
ΤϥʔϋϯυϦϯάͷ؍Ͱ ҙͷAPIΫϥΠΞϯτʹٻΊΒΕΔཁ݅ • ඇܾఆతͳΤϥʔʹରͯ͠exponential backoff͖ͭͰϦτ ϥΠͰ͖Δ • λΠϜΞτΛઃ͚͍ͯΔ (ແݶʹϋϯά͠ͳ͍) •
αʔϏε͕མ͍ͪͯΔ͜ͱ͕໌Β͔ͳ߹ɺҰఆظؒϦ ΫΤετΛεΩοϓͰ͖Δ (Circuit Breaker)
Circuit BreakerύλʔϯͷͨΊͷϥΠϒϥϦ • circuit_breaker.gem • γϯϓϧɺ͚ͩͲmix-inͳͷͰݸਓతʹ͋·Γ͍ͨ͘ͳ͍ • expeditor.gem • Circuit
Breaker͚ͩͰͳ͘ɺϦτϥΠɺλΠϜΞτɺࣦഊ࣌ ͷϑΥʔϧόοΫɺඇಉظԽͳͲ࣮ • ਖ਼expeditorʹඇಉظԽ͍Βͳ͔ͬͨΜ͡Όͳ͍͔ͱࢥͬͯ Δ͚ͲɺฐࣾͰmakimoto͞Μͱ͕ৄ͍͠ͷͰ͜ΕΛ࠾༻
࣮ࡍͷAPIΫϥΠΞϯτͷྫ (GET)
ϦτϥΠઓུ • exponential backoffΛ͚ͭɺແཧʹෛՙΛ͔͚ͳ͍Α͏ʹ • 5XXͰɺϦτϥΠՄೳͳ͜ͱ͕໌Β͔Ͱͳ͍ΤϥʔઈରϦτϥΠ͠ͳ͍ • ΫϥΠΞϯτଆͷϫʔΧʔΛແବʹϒϩοΫͨ͠Γɺαʔόʔଆͷো࣌ʹෛՙΛ͔͚Α Γঢ়گΛѱԽͤͨ͞Γ͢ΔͨΊ •
ྫ͑500NoMethodErrorͱ͔ͩͬͨΓ͢ΔͷͰϦτϥΠ͖͢Ͱͳ͍ • ϦτϥΠࠐΈͷશମͷλΠϜΞτͱɺ֤ϦτϥΠͷλΠϜΞτΛઃ͚Δ • ҰॠͰࢮ͵ΤϥʔΛΑΓଟΊʹϦτϥΠ͢ΔͨΊ • ͲͷΤϥʔ͕ϦτϥΠՄೳ͔APIʹΑͬͯҟͳΔ • ֤HTTPϝιου͝ͱʹੑʹؔ͢ΔڍಈΛαʔόʔଆͰ౷Ұ͓ͯ͘͠ͱָ
RailsͰසൟʹ࡞ΒΕͦ͏ͳҎԼͷύλʔϯͰ APIαʔόʔ/ΫϥΠΞϯτΛͲ͏࣮͢Δ͔ • GET /embulk_configs (index) • GET /embulk_configs/:id (show)
• POST /embulk_configs (create) • PATCH /embulk_configs/:id (update) • DELETE /embulk_configs/:id (destroy) APIͩͱ #new, #edit ࡞Γ·ͤΜΑͶ?
GET /embulk_configs (index) • αʔόʔ • ͨΓલ͚ͩͲGETશͯϩάҎ֎ͷ෭࡞༻͕ͳ͍Α͏ʹ͢Δ • ΫϥΠΞϯτ •
΄΅ϦτϥΠ͠์͚ͩͲɺલड़ͷཧ༝ʹΑΓ404, 422, 500 ͱ͔Ί͓͖ͯ·͠ΐ͏ • αʔόʔ͕མͪͯΔܥ(502, 503)ͱΫϥΠΞϯτͰλΠϜΞ τͨ͠ܥΛϦτϥΠ͢Δ
GET /embulk_configs/:id (show) • GETͳͷͰ#indexͱಉ͡ঢ়ଶʹ͓ͯ͘͠
POST /embulk_configs (create) • αʔόʔ • ࡞ରͷϦιʔεʹunique index͕͋Δ: RecordNotUnique࣌ͷϨεϙϯεΛ ۠ผՄೳʹ͢Δ
(409ฦ͢ͱ͔) • ͳ͍: ϦΫΤετIDΈ͍ͨͳͷΛΫϥΠΞϯτʹ༻ҙͤ͞ɺͦΕΛ͚࣋ͭͩͷ ςʔϒϧͷϨίʔυͱ࡞ରͷϦιʔεΛτϥϯβΫγϣϯͰίϛοτ͢Δ • ΫϥΠΞϯτ • 409 Conflictͷ߹ϦτϥΠ͠ͳ͍ • ϦΫΤετIDΛ༻ҙ͢Δ߹SecureRandom.uuidͱ͔Λ༻ҙ͠ɺϦτϥΠͷ ؒͰಉ͕͡ΔΑ͏ʹ͢Δ 409ͷͷݩωλ: http://frsyuki.hatenablog.com/entry/2014/06/09/164559
PATCH /embulk_configs/:id (update) • αʔόʔ • ؾ߹Ͱʹ͢Δ • ΞϓϦέʔγϣϯ࣍ୈ͕ͩɺ͘͝γϯϓϧͳཁ݅Ͱ͋Ε ʹͳΔΑ͏ʹ࣮͢Δͷ͘͠ͳ͍
• ΫϥΠΞϯτ • ʹ͑͞ͳ͍ͬͯΕɺGETͱ͔ͱϦτϥΠ͖͢Τ ϥʔมΘΒͳ͍ (ͳͬͯͳ͍ͳΒৗʹϦτϥΠ͠ͳ͍) UPDATEͷੑʹؔͯͪ͜͠Βࢀߟʹ: http://frsyuki.hatenablog.com/entry/2017/08/10/140416
DELETE /embulk_configs/:id (destroy) • αʔόʔ • ඞͣ͠ϦτϥΠͰਖ਼ৗͳϨεϙϯε͕ظͰ͖Δํ๏Ͱͳ͍͕ɺී௨ʹfind͠ ͯdestroyͨ͠ΒϦιʔεʹର͢Δૢ࡞গͳ͘ͱʹͳΔ • Ͳ͏ͯ͠ʹ͍ͨ͠ͳΒɺཧআ͔ͭաڈʹϨίʔυଘࡏ͚ͨ͠Ͳআ
ࡁͰ͋Δ͜ͱ͕Θ͔Δ߹ɺޭΛฦ͍͍͔ͯ͠ • ཧআͷ߹ͦͦ࡞ΒΕ͍ͯͳ͔ͬͨ߹ͱผͰ͖ͳ͍ͷͰ404 • ΫϥΠΞϯτ • ্هͷڍಈͰ͋ΕGETͱಉ͡ΤϥʔΛϦτϥΠͯ͠Ε͋·ΓࠔΒͳ͍ͣ • طʹআࡁͷ߹(404)ϦτϥΠ͠ͳ͍
4. RailsΞϓϦͷΓग़͠Ͱࠔͳ
Γग़͠ઌʹ͍͚࣋ͬͯͳ͍ ΞιγΤʔγϣϯ • ྫ͑Γग़ͦ͏ͱ͍ͯ͠ΔϞσϧ͕ belongs_to :user Λ࣋ͭ ߹ • ֎෦ʹݟ͑Δܗͱͯ͠αʔϏε͕͔Ε͍ͯΔ߹usersςʔ
ϒϧͷߋ৽ΛPubSubͰ௨ͯ͠Γग़͠ઌʹίϐʔΛ࣋ͭͱ͔ • ͋Δ͍ɺDBΛ͢Δ߹Ͳ͏ͬͯҰ؏ੑଛͳΘΕΔ ͷͰɺׂΓͬͯuser_id͚ͩΓऔΓ͢Δ • JOINͰ͖ͳ͍͠ΧϥϜͷͷҙຯෆ໌ʹͳΔ͕ɺߏ γϯϓϧʹอͯΔ
JOINͷඞཁͳιʔτ • A.belongs_to :b ͰBΛผαʔϏεʹΓग़͍͕ͨ͠ɺb.nameͰAΛ ιʔτ͢ΔAPI͕͋Δ߹ • ࢮ͋ΔͷΈ • ͦͦͦΜͳΠϯλʔϑΣʔεΛ࡞ΔͷΛΊΖ
• DBͷͷҰ؏ੑΛ͋Δఔ͖͋ΒΊɺb.nameͷίϐʔͰ͋Δ a.b_nameΛੜͯ͠ϝϯς͢Δ͔͠ͳ͍ • ྫ͑ιʔτʹa.b_nameΛ͏͕b.nameΛฦ͢ͳͲ͢Δɻ ͨ·ʹॱং͕͓͔͍͠ͷΛڐ༰Ͱ͖ͳ͍ͳΒΓग़͠ఘΊΔ
ؾܰʹղܾͰ͖ͳ͘ͳΔN+1 • ActiveRecordͷΫΤϦΛAPIݺͼग़͠ʹͨ͠ॠؒ includes/preload/eager_load ͕͑ͣਏ͍ • ઈରʹΊΑ͏: ࢥߟఀࢭΩϟογϡ • ී௨ʹidͷϦετΛऔͬͯฦ͢APIΛੜ͠ɺฦ͖ͬͯͨ
ࢠϦιʔεΛϦιʔεͷΠϯελϯεมʹ২͑Δ͔ɺ { Ϧιʔε => ࢠϦιʔε } ͳHashΛ࡞Δ • ͍͔ͬͯ͘͠ͳ͍͕ɺ͜ͷൺֱత؆୯ͳํ
ೝূೝՄͲ͏͢Δͷ • ී௨ʹ֎෦ʹݟ͑ͯΔ߹ී௨ʹೝূΛ࣮͢Ε͍͍ ͚ͩ • ෦Ͱୟ͘APIɺ֎෦͔Βୟ͚ͳ͍Α͏ʹ্ͨ͠Ͱɺཁ ݅ʹΑͬͯϕʔγοΫͳೝূೝՄΛεΩοϓͰ͖Δ • ͕ɺΓग़͠ઌͷೝՄʹΓग़͠ݩͷϦιʔε͕ඞཁ ͳ߹ɺ͕Μͬͯ୲͠Γ͍͔ͯ͘͠͠ͳ͍
• ʮେมͰ͢ΑͶɺ͜ΕʯҎ্ͷؾ࣋ͪಛʹͳ͍
࠷ߴͷղܾࡦ: ΈΜͳͰҰͭͷνʔϜʹͳΓ શһ͕શͯΛϝϯςͰ͖ΔΑ͏ʹͳΓ ͦͦϚΠΫϩαʔϏεԽΛෆཁʹ͢Δ ·͋ͦΕ͕Ͱ͖ͳ͍͔Β͜Μͳ໘ͳΛղܾ͠ͳ͍ͱ͍͚ͳ͍Θ͚Ͱ͢
5. ҆શʹσϓϩΠڥΛվળ͍ͯ͘͠
ةݥͳσϓϩΠڥΛվળ͠ ͍ͯͬͨ • ϚΠΫϩαʔϏεಛʹؔͳ͍͚Ͳʮ҆શ͔ͭߴʯʹ ॏཁͳ෦ • ͲΜͳʹஸೡʹ࣮ͯ͠σϓϩΠڥ͕μϝͩͱ҆શ ʹߴʹਐΊΒΕͳ͍
ਓྨͷσϓϩΠͷจ໌ͷൃల • ssh + git pull σϓϩΠ (capistrano) • ΞʔΧΠϒΛpull͢ΔλΠϓͷσϓϩΠ
• DockerίϯςφͷσϓϩΠ • ίϯςφΫϥελͷσϓϩΠ (ECS, k8s)
ਓྨͷσϓϩΠͷจ໌ͷൃల • ssh + git pull σϓϩΠ (capistrano) • ΞʔΧΠϒΛpull͢ΔλΠϓͷσϓϩΠ
• DockerίϯςφͷσϓϩΠ • ίϯςφΫϥελͷσϓϩΠ (ECS, k8s) զʑݱࡏͲ͔ͬͪΛ ਐΊͯΔঢ়ଶ
ϚϧνΫϥυɺ DockerԽʹੑೳͷ͋ΔHadoop => CodeDeploy
ਓࡐ͕ෆ͍ͯ͠Δ͕ͣԿ ނ͔ཚཱ͢ΔσϓϩΠڥ
CI͕௨͍ͬͯͳͯ͘30ʹҰճ ChefͰσϓϩΠ͕Δ
CI͕௨͍ͬͯͳͯ͘30ʹҰճ ChefͰσϓϩΠ͕Δ => CodeDeploy͔ΒmitamaeΛୟ͘ k0kubun/mitamae-plugin-resource-deploy_revision k0kubun/mitamae-plugin-resource-runit k0kubun/mitamae-plugin-recipe-buildpack
Ͳ͏ͬͯಈ͍ͯΔ͔શ͘ Θ͔Βͳ͍heroku-buildpack
खಈͷఀࢭΦϖϨʔγϣϯ Կ͕Ͳ͜ʹ͋Δ͔͙͢ࢥ͍ग़ͤͳ͘ͳΔrunit
खಈͷఀࢭΦϖϨʔγϣϯ Կ͕Ͳ͜ʹ͋Δ͔͙͢ࢥ͍ग़ͤͳ͘ͳΔrunit => ࣗಈఀࢭͰ͖Δsystemd service
gemͷόʔδϣϯΛ্͛ΔͱյΕΔ
gemͷόʔδϣϯΛ্͛ΔͱյΕΔ => αʔϏεΠϯ/αʔϏεΞτԽ
We’re hiring
·ͱΊ • ͦ͜ͰΓग़͢ͷ͕ຊʹྑ͍ͷ͔Α͘ߟ͑·͠ΐ͏ • ҠߦதϩʔΧϧͰΞϓϦΛ্ཱͪ͛ͯςετ͢Δͱ͍͏ બࢶ༗ޮ • APIʹͳΔΑ͏ઃܭɺແҙຯͳϦτϥΠආ͚Δ • Γग़͠ʹ͓͚Δਏ͍ͱͦͷରԠํΛհ͠·ͨ͠
• We’re hiring