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
一部のユーザーに開発版スクリプトを配信する - Fastly を使ったカナリアリリース
Search
Hajime Shiozawa
August 01, 2023
Technology
0
440
一部のユーザーに開発版スクリプトを配信する - Fastly を使ったカナリアリリース
Hajime Shiozawa
August 01, 2023
Tweet
Share
Other Decks in Technology
See All in Technology
Tech-Verse 2025 Keynote
lycorptech_jp
PRO
0
220
BigQuery Remote FunctionでLooker Studioをインタラクティブ化
cuebic9bic
3
320
Agentic Workflowという選択肢を考える
tkikuchi1002
1
540
なぜ私はいま、ここにいるのか? #もがく中堅デザイナー #プロダクトデザイナー
bengo4com
0
480
Observability в PHP без боли. Олег Мифле, тимлид Altenar
lamodatech
0
360
Witchcraft for Memory
pocke
1
440
Microsoft Build 2025 技術/製品動向 for Microsoft Startup Tech Community
torumakabe
2
290
Prox Industries株式会社 会社紹介資料
proxindustries
0
320
Observability infrastructure behind the trillion-messages scale Kafka platform
lycorptech_jp
PRO
0
140
AWS テクニカルサポートとエンドカスタマーの中間地点から見えるより良いサポートの活用方法
kazzpapa3
2
550
Understanding_Thread_Tuning_for_Inference_Servers_of_Deep_Models.pdf
lycorptech_jp
PRO
0
130
Oracle Cloud Infrastructure:2025年6月度サービス・アップデート
oracle4engineer
PRO
2
260
Featured
See All Featured
Writing Fast Ruby
sferik
628
62k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Documentation Writing (for coders)
carmenintech
72
4.9k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
5
220
Rails Girls Zürich Keynote
gr2m
94
14k
VelocityConf: Rendering Performance Case Studies
addyosmani
330
24k
Unsuck your backbone
ammeep
671
58k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Site-Speed That Sticks
csswizardry
10
660
Done Done
chrislema
184
16k
Transcript
| © PLAID Inc. 2023.8.1 | 3rdparty.js #1 | 1 ⼀部のユーザーに開発版スクリプトを配信する Fastly を使ったカナリアリリース
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 2 しおざわ はじめ Hajime
Shiozawa Github : @hshiozawa 株式会社プレイドのエンジニア 主にプロダクト基盤の開発をやってます • 解析エンジン Blitz の開発 • 新しい埋め込みタグ Edge の開発
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 3 カナリアリリースをできるようにしよう 新機能を開発したから、新しいスクリプトの検証がしたい! でも、検証環境だとシンプルなテストデータしか⼊ってない いきなり本番環境にはリリースはできない・・・
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 4
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 5
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 6 考えるべきポイント KARTE の埋め込みスクリプトのアーキテクチャ
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 7 1 埋め込みスクリプトの URL は変えない
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 8 2 クライアントごとに配信スクリプトが異なる
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 9 3 クライアントが設定を変えると、スクリプトを再ビルド スクリプトを ビルドするサーバ
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 10 4 スクリプトへの修正は、全スクリプトの再ビルドが必要
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 11 1. 配信スクリプトは同じ URL
2. クライアントごとに違うスクリプト URL 3. クライアントが設定を変えると、スクリプトを再ビルド 4. スクリプトの修正は、全スクリプトの再ビルドが必要 ポイント
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 12 カナリアリリースを実現する
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 13 Fastly VCL を使う 1.
配信スクリプトは同じ URL 2. クライアントごとに違うスクリプト URL を解決する
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 14
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 15 Cookie を付与して Fastly
の VCL で カナリー環境に振り分け Cookie を付与 VCL で振り分け
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 16 sub vcl_recv {
if (req.http.Cookie ~ "new_feature" && req.url ~ "aaa") { # カナリア環境 set req.backend_hint = canary_release_backend; } else { # プロダクション環境 set req.backend_hint = production_backend; } }
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 17 リクエストごとにビルドする 3. クライアントが設定を変えると、スクリプトを再ビルド 4.
スクリプトの修正は、全スクリプトの再ビルドが必要 を解決する
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 18 カナリー環境はリクエストに応じてスクリプトをビルドする 多少⻑めにキャッシュ 毎リクエストビルド
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 19 全体像
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 20
2023.8.1 | 3rdparty.js #1 | | © PLAID Inc. 21 まとめ&感想 埋め込みスクリプトのカナリアリリース 環境の振り分けに
Fastly VCL を使う スクリプトは毎回ビルドしてる CDN にロジックを組めるのは便利 Edge Computing をもっと組み込みたい 💡 💡
None