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
GCPを使った transaction log tailing と polling publi...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
atsu.kg
March 17, 2023
Technology
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GCPを使った transaction log tailing と polling publisher の性能比較
atsu.kg
March 17, 2023
More Decks by atsu.kg
See All by atsu.kg
OpenTelemetry PHPで始める!オブザーバビリティ入門
atsushikoga
0
1.8k
Cloud Pub/Sub Pull Subscriberの構成検討
atsushikoga
0
1.4k
巨大なモノリスの静的解析をレベルMaxにする方法
atsushikoga
0
4k
Lenet の開発環境の紹介
atsushikoga
0
1.1k
Other Decks in Technology
See All in Technology
2026TECHFRESH畢業分享會 - 原生還是跨平台? App 開發踩坑實錄
line_developers_tw
PRO
0
810
Claude Code×Terraform IaC テンプレート駆動開発
itouhi
1
490
地球に⽣きるAI —GeoAIと「中間領域」— / AI Living on Earth — GeoAI and the “Intermediate Layer” —
ykiyota
0
280
データサイエンスを価値につなげるプロジェクト設計 〜 DS一年目が現場で得た気づき 〜
ysd113
1
180
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
220
自律型AIエージェントは何を破壊するのか
kojira
0
150
チームで進めるAI駆動アジャイル×ウォーターフォール
kumaiu
0
150
非エンジニアがClaudeと挑んだ「1ヶ月間プロダクト30本ノック」
askokc
0
320
AGENTS.mdとSkillsで始めるAIエージェント活用
sonoda_mj
3
200
On-behalf-of Token exchange with AgentCore Identity
hironobuiga
2
150
ポケモンの型をTypeScriptの型システムで表現してみた
subroh0508
0
370
DevOps Agentで始めるAWS運用 〜フロンティアエージェントが変える運用の現場〜
nyankotaro
1
380
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
450
Exploring anti-patterns in Rails
aemeredith
3
400
What's in a price? How to price your products and services
michaelherold
247
13k
Context Engineering - Making Every Token Count
addyosmani
9
960
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
220
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
For a Future-Friendly Web
brad_frost
183
10k
Transcript
GCPを使った transaction log tailing と polling publisher の性能比較 2023/3/17 株式会社ホワイトプラス 古賀
非同期処理基盤(PoC) ① Service1がイベントをFirestoreに保存 ② Message Relay がイベントを取得 ③ Message Relay
がイベントをPub/Subへ投げる ④ Service2がイベントを受け取って処理する
非同期処理基盤(PoC) 2パターンの実装方法がある ・polling publisher ・transaction log tailing
polling publisher(pull 方式) ①常時稼働の worker が Firestore を定期的に polling する
②取得したイベントデータを Pub/Sub に投げる
transaction log tailing(push 方式) ①新規ドキュメント(イベント)作成時、Eventarc 経由でCloud Run に通知 ②リクエストに含まれるIDを元に Firestore
からイベントを取得 ③取得したイベントを Pub/Sub へ投げる
性能比較ポイント ・順序保証の有無 ・スケーラビリティ ・メンテナビリティ
性能比較:順序保証の有無 ▪polling publisher(◯) workerがイベントを作成日時順に取得し Pub/Subへ投げる、を繰 り返すことで作成された順番で配信(順序保証)が可能 ▪transaction log tailing(×) おおよそイベントは登録された順番に処理フローに乗る
Eventarc に順序保証の仕組みが無い(※) イベントの順序配信がない前提で受信側の処理を設計する ※厳密に言うと、トランスポート層の Pub/Sub に任意の順序指定キーを渡すことができないために順序保証ができない
性能比較:スケーラビリティ ▪polling publisher(△) (順序保証する前提で)イベント量が増えると worker が律速 要因となりレイテンシが上がりやすい 小規模であれば問題にならない(要計測) ▪transaction log
tailing(◯) イベント量が増えても Cloud Run・Firestore がスケールする ためレイテンシは上がりにくい
性能比較:メンテナビリティ ▪polling publisher(△) 自前で順序保証ロジックを実装・保守しなければならない workerが詰まった時(配信遅延の閾値を超えた時)の緊急対 応、予防策(パフォーマンスチューニング等)が必要となり得る ▪transaction log tailing(◯) 順序保証・スケーリングについてのロジックの構築は不要
(稼働状況の監視、異常の検知は必要) 低いメンテナンスコストで安定稼働が可能
比較結果 polling publisher transaction log tailing 順序保証の有無 ◯ × スケーラビリティ
△ ◯ メンテナビリティ △ ◯ スケーラビリティ・メンテナビリティは transaction log tailing が優位、polling publisher は懸念あり 現行の非同期処理基盤では順序保証をしていないため、順序保証は必須でない 順序保証が無くても、受信したイベントと処理したイベントのタイムスタンプを比較する事で、受信側で生成順序を判 定してハンドリングするなど、ある程度設計でカバー可能 → 現時点では transaction log tailing の方向で検討中
Discussion Time ・polling publisher や transaction log tailing のメリット、デメリット ・順序保証の仕組みが必要な事例(もしあれば)
・発表内容についてのコメント