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
巨大化したモノリスApplicationの安全なRubyバージョンアップ🚀
Search
Takashi Miyahara
October 30, 2019
Programming
4
8k
巨大化したモノリスApplicationの安全なRubyバージョンアップ🚀
Meetup for Rails engineers -メドピア×リンカーズ×Classi開発事例-にて発表した資料です。
https://connpass.com/event/150554/
Takashi Miyahara
October 30, 2019
Tweet
Share
More Decks by Takashi Miyahara
See All by Takashi Miyahara
プルリク毎の検証環境を建てよう
takashimiyahara
0
5k
Image processing tips using ruby-vips
takashimiyahara
0
10k
Other Decks in Programming
See All in Programming
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
4
490
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
130
103 Early Hints
sugi_0000
1
230
MCP with Cloudflare Workers
yusukebe
2
220
Go の GC の不得意な部分を克服したい
taiyow
3
790
Haze - Real time background blurring
chrisbanes
1
510
fs2-io を試してたらバグを見つけて直した話
chencmd
0
230
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
890
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
250
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
42 best practices for Symfony, a decade later
tucksaun
1
180
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
220
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
137
6.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Facilitating Awesome Meetings
lara
50
6.1k
Become a Pro
speakerdeck
PRO
26
5k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
A Tale of Four Properties
chriscoyier
157
23k
Designing for humans not robots
tammielis
250
25k
Rails Girls Zürich Keynote
gr2m
94
13k
Designing for Performance
lara
604
68k
Six Lessons from altMBA
skipperchong
27
3.5k
4 Signs Your Business is Dying
shpigford
181
21k
Transcript
ڊେԽͨ͠ϞϊϦε Applicationͷ҆શͳRuby όʔδϣϯΞοϓ Takashi, Miyahara MedPeer, Inc. DCP Division, Platform
Development Group. 2019/10/30 Meetup for Rails engineers
ࣗݾհ Nameɿٶݪ ਸࢤ(@TakashiMiyahara) Jobɿҩࢣઐ༻ίϛϡχςΟαΠτ ʮMedPeerʯͷ։ൃ Hobbyɿࣗ࡞ΩʔϘʔυ One ThingɿॳొஃͰ͢ʂʂ
ձࣾհ
ձࣾհ
ձࣾհ
ձࣾհ
None
None
! όʔδϣϯΞοϓͷखॱ 1. ։ൃڥΛRuby2.6Խɺ֤छهड़Λमਖ਼ 2. ECSͷΠϝʔδΛϏϧυˍΞοϓϩʔυ 3. खݩɾCIʹͯಈ࡞֬ೝˍςετ 4. stagingڥʹө͠ɺಈ࡞ݕূ
5. productionڥʹө
! όʔδϣϯΞοϓ։࢝ ʮRubyͷόʔδϣϯΞοϓؤுΔͧͬ ! ʯ
! खݩɾCIʹͯಈ࡞֬ೝˍςετ ʮϩʔΧϧɾCIڥͰςετશ෦ύε͠ ͨͧʂ ! ʯ
! 8݄ CI͕ίέͨʂʂ
None
! 8݄ ʮͨ·ʹམͪΔςετ͔ͳʁʯ CIʮReceived 'killed' signalʯ ʮ....ʯ
! 8݄
None
! 8݄ ݪҼͷίʔυΛൃݟ
! Durationͷόά Range#stepʹ ActiveSupport::DurationΛ͍ͯ͠Δ ෦Ͱɺੑೳ͕ेഒʙඦഒʹѱԽ Rubyɿ2.6.3, 2.6.4, 2.6.5 Railsɿ5.2.3 ActiveSupportɿ5.2.3
! ࠶ݱͤ͞ΔͨΊͷ࠷খͷίʔυ
! Rubyຖͷ࣮ߦͷ֬ೝ Ruby 2.5.3 Ruby 2.6.3 2.1e-05 s 11.550944 s
ʮRuby 2.6Λ͏ͱѹతʹ͘ͳΔ ͳ͊...ʯ
! Range#stepͷݕূ
None
! ࣮ߦ݁Ռ Ruby2.6ܥͱRails5.2ܥͷΈ߹ΘͤͰɺ ύϑΥʔϚϯε͕ѹతʹѱԽ͠·͢
! όάͷݪҼ Ruby 2.6͔Βrange.step(n)͕ Enumerator::ArithmeticSequenceΛ ฦ͢Α͏ʹͳͬͨ → ҙਤ͠ͳ͍σʔλߏʹมԽ → DurationͷՃࢉܭࢉྔ͕ϧʔϓؔʹ
ରͯ͠ࢦؔతʹ૿Ճ
! όάͷݱঢ় Rails6Ͱमਖ਼͞Ε͍ͯΔΑ͏Ͱ͢
! όάͷमਖ਼ํ๏
! ͬͨʂ
None
! 9݄
! 9݄
None
! 9݄ ʮBatchαʔόʔΛ҆શʹ࠶ىಈ͠ͳ͍ ͱɺJobΛਖ਼࣮͘͠ߦͰ͖ͳ͍ͧ...ʯ
! Sidekiq Jobͷ҆શͳ࠶ىಈ 1. ࣮ߦதͷJobΛ࣮ͯ͢ߦ͖ͤ͞Δ 2. Sidekiqͷleaderϓϩηε্ཱ͕͕ͪΒͳ ͤ͘͞Δ 3. SidekiqͷleaderϓϩηεΛఀࢭ
4. Masterϓϩηε͔ΒleaderϓϩηεΛى ಈ
! ಈ͍͍ͯΔJobΛ֬ೝ
! Sidekiqͷleaderϓϩηε্ཱ͕͕ͪΒͳ ͤ͘͞Δ
! Sidekiq Jobͷঢ়ଶΛࢹ
! SidekiqͷleaderϓϩηεΛఀࢭ
! SidekiqͷleaderϓϩηεΛఀࢭˠىಈ
! Sidekiqͷঢ়ଶΛ֬ೝ
! Batchαʔόʔͷ҆શͳ࠶ىಈ͕֬ೝͰ͖ ͨʂ
None
! productionڥʹө
! medpeer.jpͷRubyόʔδϣϯΞοϓΛ࣮ ࢪʂ 201910݄15ʢՐʣʹόʔδϣϯΞοϓ ྃ
None