Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ruby製社内ツールのGo移行
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Atsushi Tanaka
March 25, 2024
Programming
900
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby製社内ツールのGo移行
golang.tokyo #34 で発表
https://golangtokyo.connpass.com/event/310844/
Atsushi Tanaka
March 25, 2024
More Decks by Atsushi Tanaka
See All by Atsushi Tanaka
プロダクト専任SREを置かずに 信頼性を追求する
bgpat
1
140
OpenCensusと歩んだ7年間
bgpat
0
770
SREだけど社内営業組織の業務改善をしてみた
bgpat
0
990
ウォンテッドリーにおける Platform Engineering
bgpat
0
900
Wantedly での Datadog 活用事例
bgpat
2
6.5k
KubernetesでDatadogを飼うならオートディスカバリーを使わないと損
bgpat
2
1.1k
マイクロサービス基盤にフルマネージドサービスではなくKubernetesを選択する理由
bgpat
12
4.7k
400万ユーザーに価値を届けるエンジニアを を支えるインフラ基盤
bgpat
3
580
導入から5年が経って見えた Datadog APM 運用の課題
bgpat
4
1.5k
Other Decks in Programming
See All in Programming
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
600
wkhtmltopdfの次どうするか問題2026
willnet
2
1.8k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
470
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.3k
App Intentsのビルドプロセスを支える技術
kntkymt
0
500
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
220
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
760
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
120
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5.3k
AWSに止められる覚悟してますか?
morizo_1984
2
500
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
260
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Optimizing for Happiness
mojombo
378
71k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
240
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
KATA
mclloyd
PRO
35
16k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
960
How to Talk to Developers About Accessibility
jct
2
560
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
330
Transcript
© 2024 Wantedly, Inc. Ruby製社内ツールのGo移⾏ golang.tokyo #34 Mar. 25 2024
- Atsushi Tanaka @bgpat
© 2024 Wantedly, Inc. $ whoami @bgpat / Atsushi Tanaka
ウォンテッドリー株式会社 Infrastructure Engineer Kubernetes / Terraform SRE / Platform Engineering 好きなパッケージ golang.org/x/sync/singleflight
© 2024 Wantedly, Inc. 究極の適材適所により、 シゴトでココロオドルひとを ふやすために Wantedlyはパーパス‧共感を軸にした、⼈と会社との出会いを2012 年から創出。 はたらくすべての⼈が共感を通じて「であい」「つながり」「つなが
りを深める」ためのビジネスSNS「Wantedly」を提供しています。 1⼈でも多くの⼈がワクワクしたり、熱中してシゴトと向き合えるよ うな世界を実現するために、国境を超えて「はたらくすべての⼈のイ ンフラ」を創っていきます。 ウォンテッドリーについて
© 2024 Wantedly, Inc. ウォンテッドリーについて
© 2024 Wantedly, Inc. ウォンテッドリーについて ウォンテッドリーのバックエンド領域を⽀える⾔語の歴史を読み解く https://www.wantedly.com/companies/wantedly/post_articles/886087
© 2024 Wantedly, Inc. ウォンテッドリーについて • (Goも使われているが) Rubyの利⽤が多い • マイクロサービス構成
• Kubernetes上で運⽤
© 2024 Wantedly, Inc. Infrastructure Squad (インフラチーム) の取り組み インフラや開発運⽤に関わる機能とプラクティスをプラットフォームとして提供していく
© 2024 Wantedly, Inc. Infrastructure Squad (インフラチーム) の取り組み インフラや開発運⽤に関わる機能とプラクティスをプラットフォームとして提供していく 今⽇話す部分
© 2024 Wantedly, Inc. 内製ツール “kube” kube | Wantedly Engineering
Handbook https://docs.wantedly.dev/fields/dev-tools/kube
© 2024 Wantedly, Inc. 内製ツール “kube” • エンジニアがデプロイ等の操作をするためのツール • kubectlのラッパーコマンド
• はじめはRubyで書かれていた ◦ Rubyを扱えるエンジニアが多かった ◦ 参考にしたCapistranoがRubyで書かれていた
© 2024 Wantedly, Inc. Ruby製kubeのつらみ • 環境によって動作しない ◦ ランタイムのバージョン ◦
パッケージや共有ライブラリへの依存 ◦ OSによる環境差異 • Kubernetesとの相性が良くない ◦ パッケージが少ない • 実⾏速度が遅い ◦ Rubyで並列処理を書くのは⼤変
© 2024 Wantedly, Inc. Goへのリプレース • 環境によって動作しない ◦ ランタイムのバージョン →
コンパイラ⾔語なのでランタイム依存しない ◦ パッケージや共有ライブラリへの依存 → static linkで考慮不要 ◦ OSによる環境差異 → クロスコンパイルが容易 • Kubernetesとの相性が良くない ◦ パッケージが少ない → 既存の資産を利⽤可能に • 実⾏速度が遅い ◦ Rubyで並列処理を書くのは⼤変 → goroutine で簡単に並列処理が書ける
© 2024 Wantedly, Inc. 移⾏後しばらく経って - 良かった点 • CIOpsでも利⽤ ◦
エンジニアのPCから⼿動デプロイ→CIで⾃動デプロイに変更 ◦ エンジニアのPCはmacOSだったがCIのLinux環境でも問題なく動作 • Goや依存パッケージのアップデートで壊れにくい ◦ 型があるおかげで go build が成功すればだいたい動く ◦ 他の⾔語に⽐べて破壊的変更が少ない (発表者の印象)
© 2024 Wantedly, Inc. 移⾏後しばらく経って - 困った点 • テストが書きづらい ◦
処理を後から書き換えることができない ◦ mockしやすい構成にする必要がある ▪ かなりの量のコードを書き直した • ツールチェインが充実していなかった→時間経過で改善 ◦ パッケージマネージャー: 当時は go mod がなかった ◦ ファイル埋め込み: go:embed がなかったので jessevdk/go-assets や rakyll/statik を使っていた
© 2024 Wantedly, Inc. まとめ Goに移⾏したことで • 環境依存を限りなくなり多様なニーズに応えやすく • 安全にバージョンアップでき容易にメンテナンス可能に
• テストの考慮をせず書いてほとんどを書き直すことに
© 2024 Wantedly, Inc. We are hiring! https://www.wantedly.com/projects/522096