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
Pub_Sub
Search
株式会社Curious Vehicle
March 14, 2025
0
5
Pub_Sub
株式会社Curious Vehicle
March 14, 2025
Tweet
Share
More Decks by 株式会社Curious Vehicle
See All by 株式会社Curious Vehicle
ElasticsearchのHA構成について
curicle
0
8
機械学習で絶対音感になりたかった
curicle
0
5
BQにおけるSQLアンチパターンとslot消費削減策
curicle
0
11
VibeKanbanについて
curicle
0
6
"バーチャル宮本さん"を作ってみた
curicle
0
6
"バーチャル宮本さん” 本番デプロイ編
curicle
0
11
最近課金しているAIサービスについて
curicle
0
12
音声認識について
curicle
0
9
ファクトリメソッドパターンについて
curicle
0
7
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
1
1.6k
Navigating Team Friction
lara
192
16k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
71k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Into the Great Unknown - MozCon
thekraken
40
2.2k
Designing for humans not robots
tammielis
254
26k
GitHub's CSS Performance
jonrohan
1032
470k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
The Cult of Friendly URLs
andyhume
79
6.8k
Transcript
第12回 2012/10/02 : 飯田
Pub/Sub
Index 基礎編 Pub/Sub とは Pub/Sub の実装 Pub/Sub in redis 実装編
概要 構成 実装の遷移 まとめ
基礎編
Pub/Subとは • Pub/Sub = Publisher / Subscriber • 出版購買型モデル •
非同期メッセージングパラダイムの一種 • 特徴 ◦ メッセージの送信者は受信者を特定しない ◦ 受信者は指定したトピックに関するメッセージのみを受 信する ◦ メッセージの受信者は送信者を問わない
Pub/Subとは MessageBroker Topic A Topic B Topic C Topic D
Topic Z : Subscriber(受信者) 登録 登録 登録
Pub/Subとは MessageBroker Topic A Topic B Topic C Topic D
Topic Z : Publisher(送信者) Subscriber(受信者)
Pub/Subとは MessageBroker Topic A Topic B Topic C Topic D
Topic Z : Publisher(送信者) Subscriber(受信者)
Pub/Subとは MessageBroker Topic A Topic B Topic C Topic D
Topic Z : Publisher(送信者) Subscriber(受信者)
• HedWig ◦ ZooKeeper ◦ BookKeeper https://cwiki.apache.org/confluence/display/BOOKKEEPER/HedWig • redis ◦
KVS http://redis.io/topics/pubsub Pub/Sub の実装 • PubSubHubbub ◦ Google http://code.google.com/p/pubsubhubbub/
Pub/Sub in redis in @pubsub group 1. PUBLISH channel messge
2. SUBSCRIBE channel 3. UNSUBSCRIBE [channel [channel ...]] 4. PSUBSCRIBE pattern 5. PUNBSUBSCRIBE [pattern [pattern ...]]
実装編
概要 ▪ 第一弾:アクセスカウンター ▪ なぜアクセスカウンターか? ▪ リアルタイム解析 ▪ 時間軸とデータ保持
構成 Real Time core Pub/Sub Client Pub/Sub Server user access
subscribe access publish processing message display
構成 Real Time core Pub/Sub Client Pub/Sub Server user access
subscribe access publish processing message display S4 redis node websocket
実装の遷移 Access Counter Widget chat / advertise Monitor Manager
実装の遷移 Access Counter Widget chat / advertise Monitor Manager Site
Manager Client Dashboard
redis node websocket S4 実装の遷移 user access subscribe publish processing
message display access 次世代 S4 ZooKeeper
まとめ
まとめ 1. リアルタイムアクションに必須 2. 非同期処理に最適 3. 容易にやるならば redis