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
atsu.kg
March 17, 2023
Technology
0
1.1k
GCPを使った transaction log tailing と polling publisher の性能比較
atsu.kg
March 17, 2023
Tweet
Share
More Decks by atsu.kg
See All by atsu.kg
OpenTelemetry PHPで始める!オブザーバビリティ入門
atsushikoga
0
1.8k
Cloud Pub/Sub Pull Subscriberの構成検討
atsushikoga
0
1.3k
巨大なモノリスの静的解析をレベルMaxにする方法
atsushikoga
0
3.7k
Lenet の開発環境の紹介
atsushikoga
0
1k
Other Decks in Technology
See All in Technology
Flutterで実装する実践的な攻撃対策とセキュリティ向上
fujikinaga
2
370
エンタープライズ企業における開発効率化のためのコンテキスト設計とその活用
sergicalsix
1
370
今、MySQLのバックアップを作り直すとしたら何がどう良いのかを考える旅
yoku0825
0
240
us-east-1 の障害が 起きると なぜ ソワソワするのか
miu_crescent
PRO
2
830
コンピューティングリソース何を使えばいいの?
tomokusaba
1
150
Datadog On-Call と Cloud SIEM で作る SOC 基盤
kuriyosh
0
160
ある編集者のこれまでとこれから —— 開発者コミュニティと歩んだ四半世紀
inao
4
1.9k
Introducing RFC9111 / YAPC::Fukuoka 2025
k1low
1
230
AI時代に必要なデータプラットフォームの要件とは by @Kazaneya_PR / 20251107
kazaneya
PRO
4
970
「O(n log(n))のパフォーマンス」の意味がわかるようになろう
dhirabayashi
0
120
Master Dataグループ紹介資料
sansan33
PRO
1
3.9k
エンジニア採用と 技術広報の取り組みと注力点/techpr1112
nishiuma
0
130
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
The Cult of Friendly URLs
andyhume
79
6.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Scaling GitHub
holman
463
140k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
660
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
970
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 のメリット、デメリット ・順序保証の仕組みが必要な事例(もしあれば)
・発表内容についてのコメント