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
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
3
2.8k
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
180
.NETでOBS Studio操作してみたけど…… / Operating OBS Studio by .NET
skasweb
0
120
HTML/CSS超絶浅い説明
yuki0329
0
190
テストコード書いてみませんか?
onopon
2
340
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
150
DMMオンラインサロンアプリのSwift化
hayatan
0
190
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
php-conference-japan-2024
tasuku43
0
430
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
180
AWS re:Invent 2024個人的まとめ
satoshi256kbyte
0
110
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
600
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Navigating Team Friction
lara
183
15k
Facilitating Awesome Meetings
lara
51
6.2k
Faster Mobile Websites
deanohume
305
30k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
960
RailsConf 2023
tenderlove
29
970
It's Worth the Effort
3n
183
28k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
500
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
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