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.7k
Server Push Middleware "Plasma"
stormcat24
April 29, 2017
Tweet
Share
More Decks by stormcat24
See All by stormcat24
素早く賢く失敗するDeveloper Productivityの実現を目指して
stormcat24
4
5.1k
KubernetesのマニフェストをそれなりにCIしたい
stormcat24
4
1.4k
令和時代のSaaS開発
stormcat24
1
300
History in 5 years of CircleCI and CyberAgent
stormcat24
3
870
Kubernetes Handson Osaka
stormcat24
5
600
Kubernetes Handson
stormcat24
5
4.4k
DockerとKubernetesでアプリケーション開発にコンテナをフル活用!
stormcat24
0
340
Base Image Journey 2018
stormcat24
29
140k
kotlin-fest
stormcat24
13
18k
Other Decks in Programming
See All in Programming
What's new in Spring Modulith?
olivergierke
1
170
Pythonに漸進的に型をつける
nealle
1
120
スキーマ駆動で、Zod OpenAPI Honoによる、API開発するために、Hono Takibiというライブラリを作っている
nakita628
0
320
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
7
5.1k
AkarengaLT vol.38
hashimoto_kei
1
120
Cursorハンズオン実践!
eltociear
2
1.2k
Migration to Signals, Resource API, and NgRx Signal Store
manfredsteyer
PRO
0
110
エンジニアインターン「Treasure」とHonoの2年、そして未来へ / Our Journey with Hono Two Years at Treasure and Beyond
carta_engineering
0
420
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
3.5k
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
1.2k
Foundation Modelsを実装日本語学習アプリを作ってみた!
hypebeans
1
130
GC25 Recap: The Code You Reviewed is Not the Code You Built / #newt_gophercon_tour
mazrean
0
110
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
33k
The Invisible Side of Design
smashingmag
302
51k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
990
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Into the Great Unknown - MozCon
thekraken
40
2.1k
The Pragmatic Product Professional
lauravandoore
36
7k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
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!