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
410
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
760
Ruby 3.0 JIT on Rails
k0kubun
9
9.1k
Other Decks in Programming
See All in Programming
cmp.Or に感動した
otakakot
3
210
ヤプリ新卒SREの オンボーディング
masaki12
0
130
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
150
RubyLSPのマルチバイト文字対応
notfounds
0
120
Realtime API 入門
riofujimon
0
150
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
5
1.5k
Functional Event Sourcing using Sekiban
tomohisa
0
100
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Agile that works and the tools we love
rasmusluckow
327
21k
Rails Girls Zürich Keynote
gr2m
94
13k
Designing for Performance
lara
604
68k
Git: the NoSQL Database
bkeepers
PRO
427
64k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
It's Worth the Effort
3n
183
27k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Code Review Best Practice
trishagee
64
17k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
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