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
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
From Prompt Engineering to Loop Engineering
shibuiwilliam
1
230
技術・能力を向上する原理原則 #きのこセッションa #きのこ2026
bash0c7
0
130
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
2
470
自分が詳しくない領域でAIを使う #プロヒス2026
konifar
20
7.5k
時期が悪い!それでもRaspberry Piを買って遊んで活用するには / 20260627-osc26do-rpi-jikigawarui
akkiesoft
0
830
WebGIS AI Agentの紹介
_shimizu
0
560
千葉での単身赴任からAWSをやり続け、千葉に戻ってきた話
yama3133
1
120
螺旋型キャリアの生存戦略 / kinoko-conf2026
rakus_dev
1
1k
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
3
840
水を運ぶ人としてのリーダーシップ
izumii19
4
1k
自宅LLMの話
jacopen
1
720
Deep Data Security 機能解説
oracle4engineer
PRO
2
120
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
AI: The stuff that nobody shows you
jnunemaker
PRO
8
730
How to train your dragon (web standard)
notwaldorf
97
6.7k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
Facilitating Awesome Meetings
lara
57
7k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
540
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Making Projects Easy
brettharned
120
6.7k
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 のメリット、デメリット ・順序保証の仕組みが必要な事例(もしあれば)
・発表内容についてのコメント