SlideShare a Scribd company logo
Connect Everything with NATS
Cloud Expo Europe / March 2019
Waldemar Quevedo / @wallyqs
About me
● Waldemar Quevedo / @wallyqs
● Software Engineer at
● NATS core maintainer
● Using NATS based systems since 2012
● Author of Practical NATS (Apress, 2018)
The original book
about NATS
Available at:
https://www.apress.com/us/book/9781484235690
Agenda
● Intro to the NATS project
● Show some of the latest NATS features
Intro to NATS
NATS is a simple,
production proven,
cloud-native
messaging system.
About NATS
● Created by Derek Collison in 2011 for CloudFoundry
● Project known for its resiliency and great performance
● TCP/IP based with a simple plain text protocol and at-
most-once delivery guarantees.
| PUB | SUB | UNSUB | CONNECT | INFO | MSG | -ERR | +OK | PING | PONG |
CNCF Landscape
Joined CNCF as
an incubation
project in 2018
https://landscape.cncf.io
CNCF Landscape
Joined CNCF as
an incubation
project in 2018
https://landscape.cncf.io
CNCF Landscape
https://landscape.cncf.io
Core of NATS:
3 Simple Patterns
Request/Response (1:1)
Publish/Subscribe (1:N)
SUB foo
PUB foo
Load Balanced Queues
SUB foo workers
Load Balanced Queues
Randomly distributed
Load Balanced Queues
Randomly distributed
Load Balanced Queues
Randomly distributed
Load Balanced Queues
Randomly distributed
Wildcards
SUB >
SUB foo.bar workers
PUB foo.bar
Wildcards
SUB >
PUB foo.bar
SUB foo.bar workers
Wildcards
SUB >
SUB foo.bar workers
PUB foo.bar
Wildcards
SUB >
PUB foo.bar
SUB foo.bar workers
Wildcards
SUB >
PUB foo.bar
SUB foo.bar workers
Wildcards
SUB >
SUB foo.bar workers
PUB foo.bar
SUB foo.*
Wildcards
SUB >
SUB foo.bar workers
PUB foo.bar
SUB foo.*
Wildcards
SUB >
SUB foo.bar workers
PUB foo.bar
SUB foo.*
Wildcards
SUB >
SUB foo.bar workers
PUB foo.bar
SUB foo.*
Do not assume the audience!
SUB >
SUB foo.bar workers
PUB foo.bar
SUB foo.*
Simplicity: The Road Not Taken
Image: https://www.theatlantic.com/video/index/555959/robert-frost-road-not-taken/
Simplicity: The Road Not Taken
http://www.curry-on.org/2018/sessions/simplicity-the-road-not-taken.html
Conventional wisdom might be off sometimes...
‘How HTTP 2 nearly derailed
our latency initiatives’ -
Altitude San Francisco
2018: HTTP/2 Tales:
Discovery and Woe
https://www.slideshare.net/Fastly/altitude-san-
francisco-2018-http2-tales-discovery-and-woe
Things evolving fast but getting too complex?
‘Yes! We're replaying hits from
the 1990s and 2000s
(and adding some new things)’
QUIC Tutorial
A New Internet Transport
https://datatracker.ietf.org/meeting/98/materials/slides-
98-edu-sessf-quic-tutorial-00.pdf
Things evolving fast but getting too complex?
QUIC ... deeply integrates aspects of TCP,
TLS and HTTP/2 into one cross-layer
implementation over UDP. However, such
ambition comes at the cost of high
complexity, which in turn leads to
misinterpretations, bugs and unwanted
behaviour in implementations. This was
also witnessed in the recently standardized
HTTP/2 protocol.
https://quic.edm.uhasselt.be/files/QUIC_debuggability_C
ameraReadyFinal_18oct2018.pdf
Goal of NATS:
Be the simplest, fastest, most
secure and reliable way to
communicate among services.
NATS as an always available dial
tone to connect everything
The NATS Server
The NATS Server (aka. core NATS)
● Written in Go
a. https://github.com/nats-io/gnatsd
● Extremely high performance
● Full-mesh one hop clustering for HA
● Auto discovery via gossip
● Auto prune of interest
● TLS support
● Authorization and Authentication
The NATS Server
NATS
Client
NATS
NATSNATS
NATS
Client
The NATS Server
NATS
Client
NATS
NATSNATS
NATS
Client
The NATS Server
NATS
Client
NATS
NATSNATS
NATS
Client
The NATS Server
NATS
Client
NATS
NATSNATS
NATS
Client
NATS Streaming
NATS Streaming (aka. STAN)
● Supports at-least-once delivery guarantees
a. https://github.com/nats-io/nats-streaming-server
● Persistence of messages / ‘Message replay’
● Raft based replicated log for clustering
● Protocol based on NATS Request/Reply
NATS Streaming (aka. STAN)
NATS
Streaming
Client
NATS
NATSNATS
NATS
Streaming
Server
‘cluster-A’
NATS
Streaming
Server
‘cluster-A’
NATS
Streaming
Server
‘cluster-A’
Edge NATS v2
What’s in edge NATS v2
● NATS v2 is a very special release of the server.
● Expands the security and project capabilities of the server
to become a core component used to build a global
communication network.
What’s in edge NATS v2
● Gateways & Super clusters
● New clustering protocol
● Accounts isolation
○ Containers for messaging
● NKEYS (ed25519 based keys)
● Decentralized authorization with JWTs
● System Accounts
● Graceful shutdown
Super Clusters
Services & Streams
Service definitions are a secure RPC endpoint
✓ Export a service to allow other accounts to import
✓ Import a service to allow requests to be sent and securely, seamlessly,
and anonymously to another account
✓ Usage include monitoring probes, certificate generation services, secure
vault, geolocation
Stream definitions allow data flow between accounts
✓ Export a stream to allow egress
✓ Import a stream to allow ingress
✓ Use cases include stock quotes, weather, Twitter feeds, Slack, global
alerts
Zero client configuration or client API changes!
Accounts Example
accounts {
synadia {
users = [
{user: nats, password: $2a$10$BYItxVAGPCbHakeKXegN7uGNJQB45p5sQT4D5Jrlb/gOI13Orx.RK}
{nkey: UC53TQCCXLUYSYTJ7PHSHDAORV6OSON7SNZQAWVMJUGM5JC3GR2AAD2M}
]
# For sharing streams and services with others.
exports = [
# Network status updates available for anyone.
{stream: "cloud.network.status"}
# Service to request developer statistics
{service: "private.devstats", accounts: [CNCF]}
]
}
}
Accounts Example
accounts {
synadia {
users = [
{user: nats, password: $2a$10$BYItxVAGPCbHakeKXegN7uGNJQB45p5sQT4D5Jrlb/gOI13Orx.RK}
{nkey: UC53TQCCXLUYSYTJ7PHSHDAORV6OSON7SNZQAWVMJUGM5JC3GR2AAD2M}
]
# For sharing streams and services with others.
exports = [
# Network status updates available for anyone.
{stream: "cloud.network.status"}
# Service to request developer statistics
{service: "private.devstats", accounts: [CNCF]}
]
}
}
JWTs
JWTs are used to represent identities in NATS
● User, Account, Cluster, or Server
User JWTs Contain
● Account NKey (Issuer)
● Public NKey (Subject)
● Friendly Name
● Permissions
● Limits
● Not Before and Expiration
JWTs
{
"jti": "3Y2OIRCSQLHOZI2KWXPS7JCRIR5BT5ZGZ5G74VHFCMUJAZUPCYCA",
"iat": 1544140248,
"iss": "ADQO262SKHLYIQTIBU3VG2K4GWRVO4TXYYJDHKI7QBMWYW6HACLQZIVB",
"name": "Waldemar",
"sub":
"UCZRG6WDXWMIKDPLUMMRS2UAO2NSA5GOU2WCTXQLK7TRUWLLQ2CAXY7M",
"type": "user",
"nats": {
"pub": {
"allow": [
"public.>"
]
},
"sub": {
"deny": [
"private.>"
]
}
}
NGS: A NATS based global communication network
https://synadia.com/ng
NGS: A NATS based global communication network
telnet connect.ngs.global 4222
Trying 34.241.195.68...
Connected to euwest1.aws.ngs.global.
Escape character is '^]'.
INFO
{"server_id":"NBZCGYFTHLCMZC5FWCJXQHVK7VUXSDRYEALBY6GFYCGEBZHGJLWHZR7J",
"version":"2.0.0-RC5","nonce":"kBpF7HCm6rb_TW0",
"cluster":"aws-
euwest1","connect_urls":["34.241.195.68:4222","34.243.238.95:4222","34.249.187.230:4222"]}
NGS: A NATS based global communication network
telnet connect.ngs.global 4222
Trying 34.241.195.68...
Connected to euwest1.aws.ngs.global.
Escape character is '^]'.
INFO
{"server_id":"NBZCGYFTHLCMZC5FWCJXQHVK7VUXSDRYEALBY6GFYCGEBZHGJLWHZR7J",
"version":"2.0.0-RC5","nonce":"kBpF7HCm6rb_TW0",
"cluster":"aws-
euwest1","connect_urls":["34.241.195.68:4222","34.243.238.95:4222","34.249.187.230:4222"]}
Gathering all server metrics
opts := []nats.Option{nats.Name("NGS Tools - PING")}
opts = append(opts, nats.UserCredentials("./ngs-system.jwt", "./ngs-system.nkey"))
ncs, err := nats.Connect(*urls, opts...)
if err != nil {
log.Fatal(err)
}
// Replies for ping responses.
reply := ncs.NewRespInbox()
if _, err := ncs.Subscribe(reply, processServerUpdate); err != nil {
log.Fatal(err)
}
// Send our ping for statusz updates
if err := ncs.PublishRequest("$SYS.REQ.SERVER.PING", reply, nil); err != nil {
log.Fatal(err)
}
Roadmap
● Other Messaging Project Integrations
● Augmenting other messaging systems with NATS
● Jetstream (NATS Streaming V2)
● Native MQTT support
● Websocket Support
● Microcontroller Clients for IoT
Summary
● Consider NATS if:
○ Require low operational overhead
○ Looking for low latency RPC solution
○ Not constrained to use HTTP for communicating
○ Fan of simple solutions that just work
Questions?
Thanks!
github.com/nats-io / @nats_io
https://nats.io

More Related Content

What's hot

Deep Dive into Building a Secure & Multi-tenant SaaS Solution with NATS
Deep Dive into Building a Secure & Multi-tenant SaaS Solution with NATSDeep Dive into Building a Secure & Multi-tenant SaaS Solution with NATS
Deep Dive into Building a Secure & Multi-tenant SaaS Solution with NATS
NATS
 
NATS Connect Live!
NATS Connect Live!NATS Connect Live!
NATS Connect Live!
NATS
 
NATS Connect Live | NATS as a Service Mesh
NATS Connect Live | NATS as a Service MeshNATS Connect Live | NATS as a Service Mesh
NATS Connect Live | NATS as a Service Mesh
NATS
 
Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATS
Apcera
 
Microservices Meetup San Francisco - August 2017 Talk on NATS
Microservices Meetup San Francisco - August 2017 Talk on NATSMicroservices Meetup San Francisco - August 2017 Talk on NATS
Microservices Meetup San Francisco - August 2017 Talk on NATS
NATS
 
A New Way of Thinking | NATS 2.0 & Connectivity
A New Way of Thinking | NATS 2.0 & ConnectivityA New Way of Thinking | NATS 2.0 & Connectivity
A New Way of Thinking | NATS 2.0 & Connectivity
NATS
 
KubeCon NA 2019 Keynote | NATS - Past, Present, and the Future
KubeCon NA 2019 Keynote | NATS - Past, Present, and the FutureKubeCon NA 2019 Keynote | NATS - Past, Present, and the Future
KubeCon NA 2019 Keynote | NATS - Past, Present, and the Future
NATS
 
NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016
wallyqs
 
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
NATS: Simple, Secure and Scalable Messaging For the Cloud Native EraNATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
wallyqs
 
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
wallyqs
 
Network Security Best Practice (BCP38 & 140)
Network Security Best Practice (BCP38 & 140) Network Security Best Practice (BCP38 & 140)
Network Security Best Practice (BCP38 & 140)
Bangladesh Network Operators Group
 
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...
wallyqs
 
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
StreamNative
 
Serverless for the Cloud Native Era with Fission
Serverless for the Cloud Native Era with FissionServerless for the Cloud Native Era with Fission
Serverless for the Cloud Native Era with Fission
NATS
 
Surviving A DDoS Attack: Securing CDN Traffic at CloudFlare
Surviving A DDoS Attack: Securing CDN Traffic at CloudFlareSurviving A DDoS Attack: Securing CDN Traffic at CloudFlare
Surviving A DDoS Attack: Securing CDN Traffic at CloudFlare
Cloudflare
 
NATS: Control Flow for Distributed Systems
NATS: Control Flow for Distributed SystemsNATS: Control Flow for Distributed Systems
NATS: Control Flow for Distributed Systems
Apcera
 
NATS for Modern Messaging and Microservices
NATS for Modern Messaging and MicroservicesNATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices
Apcera
 

What's hot (17)

Deep Dive into Building a Secure & Multi-tenant SaaS Solution with NATS
Deep Dive into Building a Secure & Multi-tenant SaaS Solution with NATSDeep Dive into Building a Secure & Multi-tenant SaaS Solution with NATS
Deep Dive into Building a Secure & Multi-tenant SaaS Solution with NATS
 
NATS Connect Live!
NATS Connect Live!NATS Connect Live!
NATS Connect Live!
 
NATS Connect Live | NATS as a Service Mesh
NATS Connect Live | NATS as a Service MeshNATS Connect Live | NATS as a Service Mesh
NATS Connect Live | NATS as a Service Mesh
 
Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATS
 
Microservices Meetup San Francisco - August 2017 Talk on NATS
Microservices Meetup San Francisco - August 2017 Talk on NATSMicroservices Meetup San Francisco - August 2017 Talk on NATS
Microservices Meetup San Francisco - August 2017 Talk on NATS
 
A New Way of Thinking | NATS 2.0 & Connectivity
A New Way of Thinking | NATS 2.0 & ConnectivityA New Way of Thinking | NATS 2.0 & Connectivity
A New Way of Thinking | NATS 2.0 & Connectivity
 
KubeCon NA 2019 Keynote | NATS - Past, Present, and the Future
KubeCon NA 2019 Keynote | NATS - Past, Present, and the FutureKubeCon NA 2019 Keynote | NATS - Past, Present, and the Future
KubeCon NA 2019 Keynote | NATS - Past, Present, and the Future
 
NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016
 
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
NATS: Simple, Secure and Scalable Messaging For the Cloud Native EraNATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
 
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
 
Network Security Best Practice (BCP38 & 140)
Network Security Best Practice (BCP38 & 140) Network Security Best Practice (BCP38 & 140)
Network Security Best Practice (BCP38 & 140)
 
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...
 
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
 
Serverless for the Cloud Native Era with Fission
Serverless for the Cloud Native Era with FissionServerless for the Cloud Native Era with Fission
Serverless for the Cloud Native Era with Fission
 
Surviving A DDoS Attack: Securing CDN Traffic at CloudFlare
Surviving A DDoS Attack: Securing CDN Traffic at CloudFlareSurviving A DDoS Attack: Securing CDN Traffic at CloudFlare
Surviving A DDoS Attack: Securing CDN Traffic at CloudFlare
 
NATS: Control Flow for Distributed Systems
NATS: Control Flow for Distributed SystemsNATS: Control Flow for Distributed Systems
NATS: Control Flow for Distributed Systems
 
NATS for Modern Messaging and Microservices
NATS for Modern Messaging and MicroservicesNATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices
 

Similar to Connect Everything with NATS - Cloud Expo Europe

RethinkConn 2022!
RethinkConn 2022!RethinkConn 2022!
RethinkConn 2022!
NATS
 
Interconnecting containers at scale #Dockercon
Interconnecting containers at scale #Dockercon Interconnecting containers at scale #Dockercon
Interconnecting containers at scale #Dockercon
sarahnovotny
 
.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles
VMware Tanzu
 
Towards a Lightweight Multi-Cloud DSL for Elastic and Transferable Cloud-nati...
Towards a Lightweight Multi-Cloud DSL for Elastic and Transferable Cloud-nati...Towards a Lightweight Multi-Cloud DSL for Elastic and Transferable Cloud-nati...
Towards a Lightweight Multi-Cloud DSL for Elastic and Transferable Cloud-nati...
Nane Kratzke
 
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
Juraj Hantak
 
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVM
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVMSven Vogel: Running CloudStack and OpenShift with NetApp on KVM
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVM
ShapeBlue
 
Cloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit KubernetesCloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit Kubernetes
QAware GmbH
 
.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp
VMware Tanzu
 
Safer Commutes & Streaming Data | George Padavick, Ohio Department of Transpo...
Safer Commutes & Streaming Data | George Padavick, Ohio Department of Transpo...Safer Commutes & Streaming Data | George Padavick, Ohio Department of Transpo...
Safer Commutes & Streaming Data | George Padavick, Ohio Department of Transpo...
HostedbyConfluent
 
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
Mario-Leander Reimer
 
A hitchhiker‘s guide to the cloud native stack
A hitchhiker‘s guide to the cloud native stackA hitchhiker‘s guide to the cloud native stack
A hitchhiker‘s guide to the cloud native stack
QAware GmbH
 
CCCNA17 Introduction
CCCNA17 IntroductionCCCNA17 Introduction
CCCNA17 Introduction
ShapeBlue
 
OCCIware@POSS 2016 - an extensible, standard XaaS cloud consumer platform
OCCIware@POSS 2016 - an extensible, standard XaaS cloud consumer platformOCCIware@POSS 2016 - an extensible, standard XaaS cloud consumer platform
OCCIware@POSS 2016 - an extensible, standard XaaS cloud consumer platform
Marc Dutoo
 
MRA AMA Part 10: Kubernetes and the Microservices Reference Architecture
MRA AMA Part 10: Kubernetes and the Microservices Reference ArchitectureMRA AMA Part 10: Kubernetes and the Microservices Reference Architecture
MRA AMA Part 10: Kubernetes and the Microservices Reference Architecture
NGINX, Inc.
 
Traefik 2.x features - canary deployment with Traefik and K3S
Traefik 2.x features - canary deployment with Traefik and K3STraefik 2.x features - canary deployment with Traefik and K3S
Traefik 2.x features - canary deployment with Traefik and K3S
Jakub Hajek
 
Gluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWANGluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWAN
Pance Cavkovski
 
OCCIware: Extensible and Standard-based XaaS Platform To Manage Everything in...
OCCIware: Extensible and Standard-based XaaS Platform To Manage Everything in...OCCIware: Extensible and Standard-based XaaS Platform To Manage Everything in...
OCCIware: Extensible and Standard-based XaaS Platform To Manage Everything in...
OW2
 
OCCIware, an extensible, standard-based XaaS consumer platform to manage ever...
OCCIware, an extensible, standard-based XaaS consumer platform to manage ever...OCCIware, an extensible, standard-based XaaS consumer platform to manage ever...
OCCIware, an extensible, standard-based XaaS consumer platform to manage ever...
OCCIware
 
WSO2 Cloud Strategy Update
WSO2 Cloud Strategy UpdateWSO2 Cloud Strategy Update
WSO2 Cloud Strategy Update
Imesh Gunaratne
 
WSO2Con ASIA 2016: WSO2 Cloud Strategy Update
WSO2Con ASIA 2016: WSO2 Cloud Strategy UpdateWSO2Con ASIA 2016: WSO2 Cloud Strategy Update
WSO2Con ASIA 2016: WSO2 Cloud Strategy Update
WSO2
 

Similar to Connect Everything with NATS - Cloud Expo Europe (20)

RethinkConn 2022!
RethinkConn 2022!RethinkConn 2022!
RethinkConn 2022!
 
Interconnecting containers at scale #Dockercon
Interconnecting containers at scale #Dockercon Interconnecting containers at scale #Dockercon
Interconnecting containers at scale #Dockercon
 
.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles
 
Towards a Lightweight Multi-Cloud DSL for Elastic and Transferable Cloud-nati...
Towards a Lightweight Multi-Cloud DSL for Elastic and Transferable Cloud-nati...Towards a Lightweight Multi-Cloud DSL for Elastic and Transferable Cloud-nati...
Towards a Lightweight Multi-Cloud DSL for Elastic and Transferable Cloud-nati...
 
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
10. th cncf meetup - Routing microservice-architectures-with-traefik-cncfsk
 
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVM
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVMSven Vogel: Running CloudStack and OpenShift with NetApp on KVM
Sven Vogel: Running CloudStack and OpenShift with NetApp on KVM
 
Cloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit KubernetesCloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit Kubernetes
 
.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp
 
Safer Commutes & Streaming Data | George Padavick, Ohio Department of Transpo...
Safer Commutes & Streaming Data | George Padavick, Ohio Department of Transpo...Safer Commutes & Streaming Data | George Padavick, Ohio Department of Transpo...
Safer Commutes & Streaming Data | George Padavick, Ohio Department of Transpo...
 
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
A Hitchhiker’s Guide to the Cloud Native Stack. #CDS17
 
A hitchhiker‘s guide to the cloud native stack
A hitchhiker‘s guide to the cloud native stackA hitchhiker‘s guide to the cloud native stack
A hitchhiker‘s guide to the cloud native stack
 
CCCNA17 Introduction
CCCNA17 IntroductionCCCNA17 Introduction
CCCNA17 Introduction
 
OCCIware@POSS 2016 - an extensible, standard XaaS cloud consumer platform
OCCIware@POSS 2016 - an extensible, standard XaaS cloud consumer platformOCCIware@POSS 2016 - an extensible, standard XaaS cloud consumer platform
OCCIware@POSS 2016 - an extensible, standard XaaS cloud consumer platform
 
MRA AMA Part 10: Kubernetes and the Microservices Reference Architecture
MRA AMA Part 10: Kubernetes and the Microservices Reference ArchitectureMRA AMA Part 10: Kubernetes and the Microservices Reference Architecture
MRA AMA Part 10: Kubernetes and the Microservices Reference Architecture
 
Traefik 2.x features - canary deployment with Traefik and K3S
Traefik 2.x features - canary deployment with Traefik and K3STraefik 2.x features - canary deployment with Traefik and K3S
Traefik 2.x features - canary deployment with Traefik and K3S
 
Gluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWANGluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWAN
 
OCCIware: Extensible and Standard-based XaaS Platform To Manage Everything in...
OCCIware: Extensible and Standard-based XaaS Platform To Manage Everything in...OCCIware: Extensible and Standard-based XaaS Platform To Manage Everything in...
OCCIware: Extensible and Standard-based XaaS Platform To Manage Everything in...
 
OCCIware, an extensible, standard-based XaaS consumer platform to manage ever...
OCCIware, an extensible, standard-based XaaS consumer platform to manage ever...OCCIware, an extensible, standard-based XaaS consumer platform to manage ever...
OCCIware, an extensible, standard-based XaaS consumer platform to manage ever...
 
WSO2 Cloud Strategy Update
WSO2 Cloud Strategy UpdateWSO2 Cloud Strategy Update
WSO2 Cloud Strategy Update
 
WSO2Con ASIA 2016: WSO2 Cloud Strategy Update
WSO2Con ASIA 2016: WSO2 Cloud Strategy UpdateWSO2Con ASIA 2016: WSO2 Cloud Strategy Update
WSO2Con ASIA 2016: WSO2 Cloud Strategy Update
 

Recently uploaded

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
FODUU
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 

Recently uploaded (20)

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 

Connect Everything with NATS - Cloud Expo Europe

  • 1. Connect Everything with NATS Cloud Expo Europe / March 2019 Waldemar Quevedo / @wallyqs
  • 2. About me ● Waldemar Quevedo / @wallyqs ● Software Engineer at ● NATS core maintainer ● Using NATS based systems since 2012 ● Author of Practical NATS (Apress, 2018)
  • 3. The original book about NATS Available at: https://www.apress.com/us/book/9781484235690
  • 4. Agenda ● Intro to the NATS project ● Show some of the latest NATS features
  • 6. NATS is a simple, production proven, cloud-native messaging system.
  • 7. About NATS ● Created by Derek Collison in 2011 for CloudFoundry ● Project known for its resiliency and great performance ● TCP/IP based with a simple plain text protocol and at- most-once delivery guarantees. | PUB | SUB | UNSUB | CONNECT | INFO | MSG | -ERR | +OK | PING | PONG |
  • 8. CNCF Landscape Joined CNCF as an incubation project in 2018 https://landscape.cncf.io
  • 9. CNCF Landscape Joined CNCF as an incubation project in 2018 https://landscape.cncf.io
  • 11. Core of NATS: 3 Simple Patterns
  • 19. Wildcards SUB > SUB foo.bar workers PUB foo.bar
  • 21. Wildcards SUB > SUB foo.bar workers PUB foo.bar
  • 24. Wildcards SUB > SUB foo.bar workers PUB foo.bar SUB foo.*
  • 25. Wildcards SUB > SUB foo.bar workers PUB foo.bar SUB foo.*
  • 26. Wildcards SUB > SUB foo.bar workers PUB foo.bar SUB foo.*
  • 27. Wildcards SUB > SUB foo.bar workers PUB foo.bar SUB foo.*
  • 28. Do not assume the audience! SUB > SUB foo.bar workers PUB foo.bar SUB foo.*
  • 29. Simplicity: The Road Not Taken Image: https://www.theatlantic.com/video/index/555959/robert-frost-road-not-taken/
  • 30. Simplicity: The Road Not Taken http://www.curry-on.org/2018/sessions/simplicity-the-road-not-taken.html
  • 31. Conventional wisdom might be off sometimes... ‘How HTTP 2 nearly derailed our latency initiatives’ - Altitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe https://www.slideshare.net/Fastly/altitude-san- francisco-2018-http2-tales-discovery-and-woe
  • 32. Things evolving fast but getting too complex? ‘Yes! We're replaying hits from the 1990s and 2000s (and adding some new things)’ QUIC Tutorial A New Internet Transport https://datatracker.ietf.org/meeting/98/materials/slides- 98-edu-sessf-quic-tutorial-00.pdf
  • 33. Things evolving fast but getting too complex? QUIC ... deeply integrates aspects of TCP, TLS and HTTP/2 into one cross-layer implementation over UDP. However, such ambition comes at the cost of high complexity, which in turn leads to misinterpretations, bugs and unwanted behaviour in implementations. This was also witnessed in the recently standardized HTTP/2 protocol. https://quic.edm.uhasselt.be/files/QUIC_debuggability_C ameraReadyFinal_18oct2018.pdf
  • 34.
  • 35.
  • 36. Goal of NATS: Be the simplest, fastest, most secure and reliable way to communicate among services.
  • 37. NATS as an always available dial tone to connect everything
  • 39. The NATS Server (aka. core NATS) ● Written in Go a. https://github.com/nats-io/gnatsd ● Extremely high performance ● Full-mesh one hop clustering for HA ● Auto discovery via gossip ● Auto prune of interest ● TLS support ● Authorization and Authentication
  • 45. NATS Streaming (aka. STAN) ● Supports at-least-once delivery guarantees a. https://github.com/nats-io/nats-streaming-server ● Persistence of messages / ‘Message replay’ ● Raft based replicated log for clustering ● Protocol based on NATS Request/Reply
  • 46. NATS Streaming (aka. STAN) NATS Streaming Client NATS NATSNATS NATS Streaming Server ‘cluster-A’ NATS Streaming Server ‘cluster-A’ NATS Streaming Server ‘cluster-A’
  • 48. What’s in edge NATS v2 ● NATS v2 is a very special release of the server. ● Expands the security and project capabilities of the server to become a core component used to build a global communication network.
  • 49. What’s in edge NATS v2 ● Gateways & Super clusters ● New clustering protocol ● Accounts isolation ○ Containers for messaging ● NKEYS (ed25519 based keys) ● Decentralized authorization with JWTs ● System Accounts ● Graceful shutdown
  • 51. Services & Streams Service definitions are a secure RPC endpoint ✓ Export a service to allow other accounts to import ✓ Import a service to allow requests to be sent and securely, seamlessly, and anonymously to another account ✓ Usage include monitoring probes, certificate generation services, secure vault, geolocation Stream definitions allow data flow between accounts ✓ Export a stream to allow egress ✓ Import a stream to allow ingress ✓ Use cases include stock quotes, weather, Twitter feeds, Slack, global alerts Zero client configuration or client API changes!
  • 52. Accounts Example accounts { synadia { users = [ {user: nats, password: $2a$10$BYItxVAGPCbHakeKXegN7uGNJQB45p5sQT4D5Jrlb/gOI13Orx.RK} {nkey: UC53TQCCXLUYSYTJ7PHSHDAORV6OSON7SNZQAWVMJUGM5JC3GR2AAD2M} ] # For sharing streams and services with others. exports = [ # Network status updates available for anyone. {stream: "cloud.network.status"} # Service to request developer statistics {service: "private.devstats", accounts: [CNCF]} ] } }
  • 53. Accounts Example accounts { synadia { users = [ {user: nats, password: $2a$10$BYItxVAGPCbHakeKXegN7uGNJQB45p5sQT4D5Jrlb/gOI13Orx.RK} {nkey: UC53TQCCXLUYSYTJ7PHSHDAORV6OSON7SNZQAWVMJUGM5JC3GR2AAD2M} ] # For sharing streams and services with others. exports = [ # Network status updates available for anyone. {stream: "cloud.network.status"} # Service to request developer statistics {service: "private.devstats", accounts: [CNCF]} ] } }
  • 54. JWTs JWTs are used to represent identities in NATS ● User, Account, Cluster, or Server User JWTs Contain ● Account NKey (Issuer) ● Public NKey (Subject) ● Friendly Name ● Permissions ● Limits ● Not Before and Expiration
  • 55. JWTs { "jti": "3Y2OIRCSQLHOZI2KWXPS7JCRIR5BT5ZGZ5G74VHFCMUJAZUPCYCA", "iat": 1544140248, "iss": "ADQO262SKHLYIQTIBU3VG2K4GWRVO4TXYYJDHKI7QBMWYW6HACLQZIVB", "name": "Waldemar", "sub": "UCZRG6WDXWMIKDPLUMMRS2UAO2NSA5GOU2WCTXQLK7TRUWLLQ2CAXY7M", "type": "user", "nats": { "pub": { "allow": [ "public.>" ] }, "sub": { "deny": [ "private.>" ] } }
  • 56. NGS: A NATS based global communication network https://synadia.com/ng
  • 57. NGS: A NATS based global communication network telnet connect.ngs.global 4222 Trying 34.241.195.68... Connected to euwest1.aws.ngs.global. Escape character is '^]'. INFO {"server_id":"NBZCGYFTHLCMZC5FWCJXQHVK7VUXSDRYEALBY6GFYCGEBZHGJLWHZR7J", "version":"2.0.0-RC5","nonce":"kBpF7HCm6rb_TW0", "cluster":"aws- euwest1","connect_urls":["34.241.195.68:4222","34.243.238.95:4222","34.249.187.230:4222"]}
  • 58. NGS: A NATS based global communication network telnet connect.ngs.global 4222 Trying 34.241.195.68... Connected to euwest1.aws.ngs.global. Escape character is '^]'. INFO {"server_id":"NBZCGYFTHLCMZC5FWCJXQHVK7VUXSDRYEALBY6GFYCGEBZHGJLWHZR7J", "version":"2.0.0-RC5","nonce":"kBpF7HCm6rb_TW0", "cluster":"aws- euwest1","connect_urls":["34.241.195.68:4222","34.243.238.95:4222","34.249.187.230:4222"]}
  • 59.
  • 60. Gathering all server metrics opts := []nats.Option{nats.Name("NGS Tools - PING")} opts = append(opts, nats.UserCredentials("./ngs-system.jwt", "./ngs-system.nkey")) ncs, err := nats.Connect(*urls, opts...) if err != nil { log.Fatal(err) } // Replies for ping responses. reply := ncs.NewRespInbox() if _, err := ncs.Subscribe(reply, processServerUpdate); err != nil { log.Fatal(err) } // Send our ping for statusz updates if err := ncs.PublishRequest("$SYS.REQ.SERVER.PING", reply, nil); err != nil { log.Fatal(err) }
  • 61.
  • 62.
  • 63.
  • 64. Roadmap ● Other Messaging Project Integrations ● Augmenting other messaging systems with NATS ● Jetstream (NATS Streaming V2) ● Native MQTT support ● Websocket Support ● Microcontroller Clients for IoT
  • 65. Summary ● Consider NATS if: ○ Require low operational overhead ○ Looking for low latency RPC solution ○ Not constrained to use HTTP for communicating ○ Fan of simple solutions that just work