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
KubeCon2019_NA_Recap__NATS_.pdf
Search
yosshi_
December 10, 2019
Technology
0
190
KubeCon2019_NA_Recap__NATS_.pdf
yosshi_
December 10, 2019
Tweet
Share
More Decks by yosshi_
See All by yosshi_
Getting Started with Kubernetes Observability
yosshi_
8
2.6k
PromQL_Compatibility_Testing_Recap
yosshi_
0
1.1k
プロダクト誕生の背景から学ぶ PrometheusとGrafana Loki
yosshi_
11
3.7k
これから学ぶKubernetesのReconciliation Loop
yosshi_
15
4.8k
伝統的なエンプラ企業で取り組むインフラの設計書のモダナイゼーション.pdf
yosshi_
13
6.1k
“Running Apache Samza on Kubernetes” Recap : KubeCon2019@NA
yosshi_
3
1.2k
Kuberntes_Monitoring_入門.pdf
yosshi_
17
3.2k
Kubernetes_Logging入門.pdf
yosshi_
18
7.8k
Vitessの基礎.pdf
yosshi_
7
1.5k
Other Decks in Technology
See All in Technology
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
130
AgentCore BrowserとClaude Codeスキルを活用した 『初手AI』を実現する業務自動化AIエージェント基盤
ruzia
7
2k
MariaDB Connector/C のcaching_sha2_passwordプラグインの仕様について
boro1234
0
1.1k
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
1.9k
"人"が頑張るAI駆動開発
yokomachi
1
650
Agentic AIが変革するAWSの開発・運用・セキュリティ ~Frontier Agentsを試してみた~ / Agentic AI transforms AWS development, operations, and security I tried Frontier Agents
yuj1osm
0
110
Introduce marp-ai-slide-generator
itarutomy
0
150
Microsoft Agent Frameworkの可観測性
tomokusaba
1
120
投資戦略を量産せよ 2 - マケデコセミナー(2025/12/26)
gamella
0
510
Keynoteから見るAWSの頭の中
nrinetcom
PRO
1
110
Bedrock AgentCore Evaluationsで学ぶLLM as a judge入門
shichijoyuhi
2
290
「駆動」って言葉、なんかカッコイイ_Mitz
comucal
PRO
0
110
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
What does AI have to do with Human Rights?
axbom
PRO
0
1.9k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
110
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
115
95k
30 Presentation Tips
portentint
PRO
1
180
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
130
The Invisible Side of Design
smashingmag
302
51k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
120
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
150
The World Runs on Bad Software
bkeepers
PRO
72
12k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Transcript
ç “NATS: Past, Present and the Future” Recap : KubeCon2019@NA
Cloud Native Meetup Tokyo #11 KubeCon Recap@CyberAgent @yosshi_
• 吉村 翔太 • NTTコミュニケーションズ所属 • データサイエンスチーム • インフラエンジニア/データエンジニアリング •
Kurbernetes 、Prometheus etc • 趣味:ボードゲーム • コミュニティ活動 “Cloud Native Developers JP” @yosshi_ 自己紹介 “Prometheus Meetup Tokyo”
取り上げるセッション 参考< https://sched.co/UdIm > Keynote: NATS: Past, Present and the
Future Derek Collison, Founder and CEO, Synadia(p42) 参考< https://sched.co/UdIm > Deploy Secure and Scalable Services Across Kubernetes Clusters with NATS(p81)
What is NATS?
Sample of NATS Clients
Use Case
Some NATS Users
Netlify(1/3)
Netlify(2/3)
Netlify(3/3) 参考< https://www.slideshare.net/RyanNeal10/nats-and-netlify >
tinder(1/2)
tinder(2/2) • 要件 – アプリから更新が無いか2秒に1回ポーリングをやめたい • 他のユーザから自分宛に新規のメッセージが来ていないか等の確認 • ポーリングは電池の消費も激しいし、 NWも使う
参考< https://medium.com/tinder-engineering/how-tinder-delivers-your-matches-and-messages-at-scale-504049f22ce0 >
Pub/Sub 基礎
Pub/Subのよくある使い方 • 急激な負荷の吸収 – スマホのアプリ、IoTからのデータの収集 – 負荷が予想しづらい、スケールしやすいもの • 分配 –
同じ入力データを複数の用途で使う – 分析基盤に多い • イベント駆動 – データを作る部分と、使う部分の処理を分けてたい PUB SUB
Subscribeのやり方 • Push型 • Pull型 SUB SUB PUB PUB
QoS(送信の保証) • At Most Once – メッセージが一度だけ送られる – 重複は無いが、欠損はありうる •
At Least Once – メッセージが届くまで送られる – 重複はありうるが欠損は無い。 • Exactly Once – メッセージは一度だけ必ず送られる – “At Least Once”なプロダクトを使用する際にメッセージにIDを入れて、重複削除したり することで実現することが多い。
設計のポイント • スケーラビリティ – 水平スケールをどうできるか? – リバランスできる? • 可用性 –
ノード障害時の挙動 • レイテンシ – データを入れるのにかかる時間 – データを取り出す時間、取り出した後に処理にかかる時間
NATS 基礎
1:1の基本的な構成
1:N(Subject-Based Messaging) 送る側で Subject “foo”をつける 受ける側でもSubjectを持っていて “foo”の該当者が受け取る
Wildcard Subscribers Subjectは “.”で階層化できる Subjectに “*”が付けれる
Subject Hierarchies • Subjectは”.”で階層化出来るので 必要なとこにだけメッセージが届く構成が取れる
Load Balanced Queues 受ける側をグループ化出来る どれか1つにだけランダムで送られる 受け手側の負荷分散が出来る
Securing Connections • Authenticating – User and Password – Token
– NKeys which uses Ed25519 signing – Credentials File • Encrypting Connections with TLS
NATSの構成の話
NATS Cluster この1個がServer 相互接続されたServerの塊が Cluster ClientはどれかのServerに 所属してるイメージ
Supercluseters “Gateway Connections”で Cluster間を接続できる
Leaf Nodes • Leaf nodes allow you to bridge separate
security domains.
調べてて思ったこと・・・電話みたい 離島 関東エリア 関西エリア エリア間通信
KafkaとNATSの使い分け • 要件が”At-Most-Once”の時は – ”NATS” • 要件が”At-Least-Once”の時は – ”Kafka”
KafkaとNATSの使い分け • NATS – シンプルで軽量 – スケールしやすい – Push型 –
(ディスクを意識しなくていいので楽:Core-NATSの話) • Kafka – 耐障害性が重要(レプリケーションがある) – 入れるデータに保管期間が必要(ディスクに入れる) – Pull型 – (NATS StreamingならAt-Least-Onceも可能)
NATS Streaming Moduleを追加 NATS Serverのみの構成を”Core NATS”と呼ぶ
Sample Dashboard(1/3)
Sample Dashboard(2/3)
Sample Dashboard(3/3)
Roadmap 直近は、”NATS Streaming”絡みが多い MQTT、Websocket対応