Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
KubeCon2019_NA_Recap__NATS_.pdf
Search
yosshi_
December 10, 2019
Technology
240
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
KubeCon2019_NA_Recap__NATS_.pdf
yosshi_
December 10, 2019
Transcript
36 slides
ç “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対応
More Decks by yosshi_
See All by yosshi_
From Vanilla Kubernetes to a Batteries-Included Platform: Developer Experience at 1,300+ Clusters
yosshi_
0
770
From 5 to 1,300+ Clusters: Declarative Scaling for Private Kubernetes
yosshi_
1
120
Scaling In Kubernetes Safely on On-Prem KaaS Across 1,300+ Clusters and 40,000+ Nodes
yosshi_
1
200
Getting Started with Kubernetes Observability
yosshi_
8
2.9k
PromQL_Compatibility_Testing_Recap
yosshi_
1
1.2k
プロダクト誕生の背景から学ぶ PrometheusとGrafana Loki
yosshi_
11
3.9k
これから学ぶKubernetesのReconciliation Loop
yosshi_
16
5.5k
伝統的なエンプラ企業で取り組むインフラの設計書のモダナイゼーション.pdf
yosshi_
14
6.6k
“Running Apache Samza on Kubernetes” Recap : KubeCon2019@NA
yosshi_
3
1.3k
Other Decks in Technology
See All in Technology
プラガブルで宣言的なソフトウェアファクトリーを支えるTypeScript
timakin
2
570
統制されたID・権限をどう利用するか : DPoP/FAPIによるAPIセキュリティ強化
oidfj
2
300
AI-DLCでソフトウェア開発の速さは 上がったのか?
rfdnxbro
0
140
業務の傍らで進める改善ループエンジニアリング
bengo4com
1
240
AWS Blocksで AIエージェント作れるの知ってます?
kmiya84377
1
170
PHPで家庭用ゲーム機の専用コントローラーをMIDIデバイスとして扱ってみる
wind111
0
200
Well, that’s weird…
csswizardry
1
200
パスワードのない鍵で、 データを手元に置く
ginjihayashi
0
400
[関西Kaggler会 20261113] 続・コミュニティコンペのススメ
nejumi
0
200
Terraform 0 to 100:100個以上のリポジトリを常に最新にし続けるための自動化
sue445
3
1.4k
コピーオンライト型ファイルシステムと ランダム書き込み
sat
PRO
2
140
閉域網でのAPI公開の選択肢全部比較!
takano0131
5
700
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7.1k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
620
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
1
250
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
760
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
310
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
43k
Exploring anti-patterns in Rails
aemeredith
4
580
How to make the Groovebox
asonas
2
2.6k
KATA
mclloyd
PRO
35
16k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
880