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
200
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
830
Cloud Pub/Sub Pull Subscriberの構成検討
atsushikoga
0
400
巨大なモノリスの静的解析をレベルMaxにする方法
atsushikoga
0
3.5k
Lenet の開発環境の紹介
atsushikoga
0
970
Other Decks in Technology
See All in Technology
Welcome to the LLM Club
koic
0
160
mrubyと micro-ROSが繋ぐロボットの世界
kishima
2
190
Amazon Bedrockで実現する 新たな学習体験
kzkmaeda
1
520
あなたの声を届けよう! 女性エンジニア登壇の意義とアウトプット実践ガイド #wttjp / Call for Your Voice
kondoyuko
4
410
MySQL5.6から8.4へ 戦いの記録
kyoshidaxx
1
200
PHP開発者のためのSOLID原則再入門 #phpcon / PHP Conference Japan 2025
shogogg
4
710
解析の定理証明実践@Lean 4
dec9ue
0
170
2年でここまで成長!AWSで育てたAI Slack botの軌跡
iwamot
PRO
4
680
M3 Expressiveの思想に迫る
chnotchy
0
100
IIWレポートからみるID業界で話題のMCP
fujie
0
780
Navigation3でViewModelにデータを渡す方法
mikanichinose
0
220
ローカルLLMでファインチューニング
knishioka
0
150
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
33
5.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.4k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
Practical Orchestrator
shlominoach
188
11k
What's in a price? How to price your products and services
michaelherold
246
12k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Documentation Writing (for coders)
carmenintech
71
4.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
Balancing Empowerment & Direction
lara
1
370
Git: the NoSQL Database
bkeepers
PRO
430
65k
Designing for Performance
lara
609
69k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.3k
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 のメリット、デメリット ・順序保証の仕組みが必要な事例(もしあれば)
・発表内容についてのコメント