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
ラッコキーワード サービス紹介資料
rakko
1
2.2M
Designing for Performance
lara
610
70k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Being A Developer After 40
akosma
91
590k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
110
What's in a price? How to price your products and services
michaelherold
247
13k
Automating Front-end Workflow
addyosmani
1371
200k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
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