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
トランクベース開発のすすめ
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Taiga Sakaguchi
January 30, 2023
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
トランクベース開発のすすめ
Taiga Sakaguchi
January 30, 2023
More Decks by Taiga Sakaguchi
See All by Taiga Sakaguchi
gRPC入門
taigaskg
0
290
クリーンアーキテクチャのすすめ
taigaskg
0
350
Other Decks in Programming
See All in Programming
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
110
Foundation Models frameworkで画像分析
ryodeveloper
1
120
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
260
霧の中の代数的エフェクト
funnyycat
1
410
えっ!!コードを読まずに開発を!?
hananouchi
0
220
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.1k
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
2
580
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
360
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
510
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
200
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
130
継続モナドとリアクティブプログラミング
yukikurage
3
610
Featured
See All Featured
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
420
Ethics towards AI in product and experience design
skipperchong
2
330
sira's awesome portfolio website redesign presentation
elsirapls
0
300
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
150
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
Building Adaptive Systems
keathley
44
3.1k
Tell your own story through comics
letsgokoyo
1
1k
A Modern Web Designer's Workflow
chriscoyier
698
190k
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Transcript
トランクベース開発のすすめ Taiga Sakaguchi 1
Taiga 教員→Web エンジニア 歴3 年 バックエンドエンジニア 都内メガベンチャーに勤務 2
みなさん爆速開発できていますか? 3
テーマ : 『変更点を小さくする』 4
こんな辛みありませんか? PR の差分が大きくコンフリクトしてしまう 変更点が多くレビューアーの負担が大きい main ブランチへのマージの変更が大きくリリースが怖い ブランチのパターンが複雑で運用が辛い バグが起きた際の原因特定に時間がかかってしまう レビュー待ちが長い 5
そう、「トランクベース開発」ならね 6
トランクベース開発とは、変更点を小 さくすることで生産性を高める手法 7
機能ブランチを使った手法 機能ごとにブランチを作成し実装完了後トランク (*1) にマージする手 法 例えば、 git-flow github-flow 実装完了しマージできるまでに数日から数週間かかる *(1)
トランクとは、いわゆるmain ブランチのことです 8
機能ブランチの例 出典: https://trunkbaseddevelopment.com 9
トランクベース開発 小さな単位に分割して実装し、1 日に1 回以上トランクにマージする 手法 実装は数時間から数日以内で完了し個々の変更を頻繁にトランクに マージする。 1 日に複数回のリリース 10
トランクベース開発のブランチ 11
Four Keys ソフトウェア開発チームのパフォーマンスを示す4 つの指標 デプロイの頻度 組織による正常な本番環境へのリリースの頻度 変更のリードタイム commit から本番環境稼働までの所要時間 変更障害率
デプロイが原因で本番環境で障害が発生する割合(% ) サービス復元時間 組織が本番環境での障害から回復するのにかかる時間 12
出典: https://cloud.google.com/blog/ja/products/gcp/using-the-four-keys-to-measure-your-devops-performance 13
実現するためのポイント コードレビュー プロセスを簡略化 同期的なレビュー コーディングルール テスト&ビルド 自動テストの実行 ビルドを迅速に行う 14
トランクベース開発の Pros & Cons Pros 新機能をいち早く提供できる レビュアーの負担が軽くなる コンフリクトを抑えられる コードフリーズのような統合期 間が不要
バグの原因を特定しやすい Cons デプロイ可能な単位に作業を分 割する必要がある CI/CD 環境の整備が必要(自動 テスト・ビルド) 15
生産性 vs. 信頼性 16
生産性 with 信頼性 17
とは言っても本番に出したくないときもある 18
フィーチャーフラグ コードを書き換えることなく、動的に機能のON/OFF を切り替えシス テムの振る舞いを変更することができる手法 if featureFlg { // Do something
} else { // Do something else } 19
トランクベース開発が向いていないケ ース 明確にバージョンごとにリリースしたい場合 20
おまけ 21
Progressive Delivery Canary Release に加えて、SLO などのメトリクスを閾値として分析 しデプロイする手法 分析に通らなければ自動でロールバック 22
出典: https://static.sched.com/hosted_files/kccncna19/f2/Progressive Delivery %26 Argo Rollouts.pdf 23
出典: https://static.sched.com/hosted_files/kccncna19/f2/Progressive Delivery %26 Argo Rollouts.pdf 24
Four Keys デプロイの頻度 組織による正常な本番環境へのリリースの頻度 変更のリードタイム commit から本番環境稼働までの所要時間 変更障害率 デプロイが原因で本番環境で障害が発生する割合(% )
サービス復元時間 組織が本番環境での障害から回復するのにかかる時間 25
出典: https://cloud.google.com/blog/ja/products/gcp/using-the-four-keys-to-measure-your-devops-performance 26
参考 https://cloud.google.com/architecture/devops/devops-tech-trunk- based-development?hl=ja https://cloud.google.com/blog/ja/products/gcp/using-the-four- keys-to-measure-your-devops-performance https://ca-base-next.cyberagent.co.jp/2022/sessions/developer- productivity/ https://rheb.hatenablog.com/entry/2021/08/24/ トランクベース開 発について
27