$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Pub_Sub
Search
株式会社Curious Vehicle
March 14, 2025
0
4
Pub_Sub
株式会社Curious Vehicle
March 14, 2025
Tweet
Share
More Decks by 株式会社Curious Vehicle
See All by 株式会社Curious Vehicle
ElasticsearchのHA構成について
curicle
0
2
機械学習で絶対音感になりたかった
curicle
0
5
BQにおけるSQLアンチパターンとslot消費削減策
curicle
0
10
VibeKanbanについて
curicle
0
5
"バーチャル宮本さん"を作ってみた
curicle
0
5
"バーチャル宮本さん” 本番デプロイ編
curicle
0
7
最近課金しているAIサービスについて
curicle
0
11
音声認識について
curicle
0
7
ファクトリメソッドパターンについて
curicle
0
5
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
0
480
Raft: Consensus for Rubyists
vanstee
141
7.2k
A designer walks into a library…
pauljervisheath
210
24k
Statistics for Hackers
jakevdp
799
230k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Building Applications with DynamoDB
mza
96
6.8k
How to train your dragon (web standard)
notwaldorf
97
6.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Site-Speed That Sticks
csswizardry
13
990
Making Projects Easy
brettharned
120
6.5k
Writing Fast Ruby
sferik
630
62k
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