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
12k
Ruby JIT Hacking Guide / RubyKaigi 2023
k0kubun
2
9.4k
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
400
Why Ruby's JIT was slow / RubyKaigi Takeout 2021
k0kubun
3
1.8k
数時間かかる週一リリースを毎日何度も爆速でできるようにするまで / CI/CD Conference 2021
k0kubun
21
14k
Ruby 3 JIT's roadmap / RubyConf China 2020
k0kubun
0
750
Ruby 3.0 JIT on Rails
k0kubun
9
9.1k
Other Decks in Programming
See All in Programming
プロジェクト新規参入者のリードタイム短縮の観点から見る、品質の高いコードとアーキテクチャを保つメリット
d_endo
1
1k
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
140
Kotlin2でdataクラスの copyメソッドを禁止する/Data class copy function to have the same visibility as constructor
eichisanden
1
130
Outline View in SwiftUI
1024jp
1
120
VR HMDとしてのVision Pro+ゲーム開発について
yasei_no_otoko
0
100
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
130
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
210
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
7
2.8k
Macとオーディオ再生 2024/11/02
yusukeito
0
160
CSC509 Lecture 09
javiergs
PRO
0
110
OpenTelemetryでRailsのパフォーマンス分析を始めてみよう(KoR2024)
ymtdzzz
4
1.6k
Universal Linksの実装方法と陥りがちな罠
kaitokudou
1
220
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Testing 201, or: Great Expectations
jmmastey
38
7k
How STYLIGHT went responsive
nonsquared
95
5.2k
Unsuck your backbone
ammeep
668
57k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
14
1.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
790
Fontdeck: Realign not Redesign
paulrobertlloyd
81
5.2k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
Into the Great Unknown - MozCon
thekraken
31
1.5k
BBQ
matthewcrist
85
9.3k
Visualization
eitanlees
144
15k
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