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
Server Push Middleware "Plasma"
Search
stormcat24
April 29, 2017
Programming
2
5.2k
Server Push Middleware "Plasma"
stormcat24
April 29, 2017
Tweet
Share
More Decks by stormcat24
See All by stormcat24
素早く賢く失敗するDeveloper Productivityの実現を目指して
stormcat24
2
2.8k
KubernetesのマニフェストをそれなりにCIしたい
stormcat24
4
1.2k
令和時代のSaaS開発
stormcat24
1
230
History in 5 years of CircleCI and CyberAgent
stormcat24
3
790
Kubernetes Handson Osaka
stormcat24
5
530
Kubernetes Handson
stormcat24
5
4.1k
DockerとKubernetesでアプリケーション開発にコンテナをフル活用!
stormcat24
0
280
Base Image Journey 2018
stormcat24
29
130k
kotlin-fest
stormcat24
13
17k
Other Decks in Programming
See All in Programming
Harnessing Large Language Models for Training-free Video Anomaly Detection
tereka114
1
1.3k
CSC307 Lecture 09
javiergs
PRO
1
500
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Berlin
prof18
0
110
実用的かつリーズナブルな 「Azure × Gemini × LINE」~キャラクターBot 実装ライブデモ~
tomodo_ysys
1
170
AWS CDKにおける「再利用性」を考える / aws-cdk-reusability
gotok365
6
1.3k
AWS初心者ってどうやってAWSを学ぶ?〜アプリエンジニアがやってよかったアーキテクチャ学習方法〜
yamanashi_ren01
0
190
ピグパーティにおけるMongoDB CommunityバージョンからAtlasへの移行事例
10969hotaka
0
130
Temporalを取り巻く仕様を整理する
sajikix
0
110
20240706_CDKConf
takuyay0ne
0
1.2k
feature環境をGitHub ActionsとCloudFormationでいい感じに管理する
nealle
2
310
Rubyのパフォーマンスプロファイリングの改善 / Enhancing performance profiling for Ruby
osyoyu
1
410
Exploring the Gradually Lost Technical Skills in the Cloud Native Era
hwchiu
2
3.9k
Featured
See All Featured
The Language of Interfaces
destraynor
151
23k
WebSockets: Embracing the real-time Web
robhawkes
59
7.2k
Atom: Resistance is Futile
akmur
261
25k
Code Review Best Practice
trishagee
58
16k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.4k
GraphQLとの向き合い方2022年版
quramy
36
13k
Statistics for Hackers
jakevdp
792
220k
Robots, Beer and Maslow
schacon
PRO
157
8.1k
Producing Creativity
orderedlist
PRO
340
39k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
26
1.6k
Why Our Code Smells
bkeepers
PRO
332
56k
In The Pink: A Labor of Love
frogandcode
139
22k
Transcript
Server Push Middleware “Plasma” @stormcat24 2017.04.29 そうだ Go、京都。
‣ CyberAgent, Inc. ‣ FRESH! https://freshlive.tv ‣ FRESH!はmackerelを利用しています(これ大事) ‣ http://blog.stormcat.io
‣ ワタシGoチョットデキル ‣ 最近の興味はRustとKotlin stormcat24
天皇賞のついでに喋りに来ました
突然ですがポーリングしてますか
ポーリングのシーン・・・ ‣ アプリケーションの状態変化の検知 ‣ 通知を疑似的にServer Pushぽく見せたり ‣ Job Queueのロングポーリング
あまりにも多くの HTTPリクエストが討ち死にしてきた ほぼ同じレスポンスだというのに・・・ ※応仁の乱
世の中のポーリングを撲滅したい
https://github.com/openfresh/plasma
Plasma is ‣ Go製の汎用的なServer Push型ミドルウェア ‣ gRPC StreamとServer-Sent Event(SSE)に対応 ‣
Web/iOS/Android/Serverから状態変化検知を撲滅したくて構想 ‣ 実装はインターン生(@upamune)がほぼ一人でやった
クライアントは必要なイベントタイプを指定し、 subscribeするだけでデータが降ってくる
Plasmaへの接続 ‣ gRPC Streamの場合 ‣ proto定義がPlasmaのリポジトリにあるので、protogenでstubを作る ‣ SSEの場合 ‣ polyfillあります
https://github.com/Yaffle/EventSource ‣ サーバから一定期間データが来ないと接続が切れるブラウザがあるの で、Plasmaは切れないようにHeartbeatする
ユースケース ‣ 状態変化の監視のためポーリングをサーバプッシュに置き換える ‣ Microservices間で別のサービスで起きたイベントを受け取る ‣ Microservicesを跨いだキャッシュの伝搬(試験運用中!)
Server Pushはいいぞ
さあ、ポーリングの屍を乗り越えて行こう ※現在進捗10%
Thanks!