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
7.9k
巨大化したモノリス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
4.9k
Image processing tips using ruby-vips
takashimiyahara
0
10k
Other Decks in Programming
See All in Programming
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
420
RailsのPull requestsのレビューの時に私が考えていること
yahonda
5
1.7k
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
150
Vaporモードを大規模サービスに最速導入して学びを共有する
kazukishimamoto
4
4.3k
Identifying User Idenity
moro
6
7.7k
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
530
Universal Linksの実装方法と陥りがちな罠
kaitokudou
1
220
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
480
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
1
290
CSC305 Lecture 13
javiergs
PRO
0
130
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
270
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
190
Featured
See All Featured
Music & Morning Musume
bryan
46
6.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
How STYLIGHT went responsive
nonsquared
95
5.2k
What's new in Ruby 2.0
geeforr
342
31k
Designing the Hi-DPI Web
ddemaree
280
34k
Building Your Own Lightsaber
phodgson
102
6k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Unsuck your backbone
ammeep
668
57k
Measuring & Analyzing Core Web Vitals
bluesmoon
1
39
The Cost Of JavaScript in 2023
addyosmani
45
6.6k
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