SlideShare una empresa de Scribd logo
1 de 90
Descargar para leer sin conexión
 
The Zen of High Performance
Messaging with NATS
Waldemar Quevedo / @wallyqs
Strange Loop 2016
ABOUT
Waldemar Quevedo /
Software Developer at in SF
Development of the Apcera Platform
Past: PaaS DevOps at Rakuten in Tokyo
NATS client maintainer (Ruby, Python)
@wallyqs
Apcera
ABOUT THIS TALK
What is NATS
Design from NATS
Building systems with NATS
What is NATS?
NATS
High Performance Messaging System
Created by
First written in in 2010
Originally built for Cloud Foundry
Rewritten in in 2012
Better performance
Open Source, MIT License
Derek Collison
Ruby
Go
https://github.com/nats-io
THANKS GO TEAM
Small binary → Lightweight Docker image
No deployment dependencies ✌
Acts as an always available dial-tone
Performance
single byte message
Around 10M messages/second
MUCH BETTER BENCHMARK
From 's awesome blog@tyler_treat
(2014)http://bravenewgeek.com/dissecting-message-queues/
NATS = Performance + Simplicity
Design from NATS
NATS
Design constrained to keep it as operationally simple and
reliable as possible while still being both performant and
scalable.
Simplicity Matters!
Simplicity buys you opportunity.
ー Rich Hickey, Cognitect
Link: https://www.youtube.com/watch?v=rI8tNMsozo0
LESS IS BETTER
Concise feature set (pure pub/sub)
No built-in persistence of messages
No exactly-once-delivery promises either
Those concerns are simpli ed away from NATS
THOUGHT EXERCISE
What could be the fastest,
simplest and most reliable
way of writing and reading
to a socket to communicate
with N nodes?
DESIGN
TCP/IP based
Plain text protocol
Pure pub/sub
re and forget
at most once
PROTOCOL
PUB
SUB
UNSUB
MSG
PING
PONG
INFO
CONNECT
-ERR
+OK
EXAMPLE
Connecting to the public demo server…
telnet demo.nats.io 4222
INFO {"tls_required":false,"max_payload":1048576,...}
Optionally giving a name to the client
connect {"name":"nats-strangeloop-client"}
+OK
Pinging the server, we should get a pong back
ping
PONG
Not following ping/pong interval, results in server
disconnecting us.
INFO {"auth_required":false,"max_payload":1048576,...}
PING
PING
-ERR 'Stale Connection'
Connection closed by foreign host.
Subscribe to the hellosubject identifying it with the
arbitrary number 10
sub hello 10
+OK
Publishing on hellosubject a payload of 5 bytes
sub hello 10
+OK
pub hello 5
world
Message received!
telnet demo.nats.io 4222
sub hello 10
+OK
pub hello 5
world
MSG hello 10 5
world
Payload is opaque to the server!
It is just bytes, but could be json, msgpack, etc…
REQUEST/RESPONSE
is also pure pub/sub
PROBLEM
How can we send a request and expect a response back
with pure pub/sub?
NATS REQUESTS
Initially, client making the request creates a subscription
with a string:unique identi er
SUB _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 2
+OK
NATS clients libraries have helpers for generating these:
nats.NewInbox()
// => _INBOX.ioL1Ws5aZZf5fyeF6sAdjw
NATS REQUESTS
Then it expresses in the topic:limited interest
SUB _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 2
UNSUB 2 1
tells the server to unsubscribe from subscription with sid=2
after getting 1 message
NATS REQUESTS
Then the request is published to a subject (help), tagging it
with the ephemeral inbox just for the request to happen:
SUB _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 2
UNSUB 2 1
PUB help _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 6
please
NATS REQUESTS
Then i there is another subscriber connected and
interested in the helpsubject, it will receive a message
with that inbox:
# Another client interested in the help subject
SUB help 90
# Receives from server a message
MSG help 90 _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 6
please
# Can use that inbox to reply back
PUB _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 11
I can help!
NATS REQUESTS
Finally, i the client which sent the request is still connected
and interested, it will be receiving that message:
SUB _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 2
UNSUB 2 1
PUB help _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 6
please
MSG _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 2 11
I can help!
Simple Protocol == Simple Clients
Given the protocol is simple, NATS clients libraries
tend to have a very small footprint as well.
CLIENTS
RUBY
require 'nats/client'
NATS.start do |nc|
nc.subscribe("hello") do |msg|
puts "[Received] #{msg}"
end
nc.publish("hello", "world")
end
GO
nc, err := nats.Connect()
// ...
nc.Subscribe("hello", func(m *nats.Msg){
fmt.Printf("[Received] %s", m.Data)
})
nc.Publish("hello", []byte("world"))
MANY MORE AVAILABLE
C C# Java
Python NGINX Spring
Node.js Elixir Rust
Lua Erlang PHP
Haskell Scala Perl
Many thanks to the community!
ASYNCHRONOUS IO
Note: Most clients have asynchronous behavior
nc, err := nats.Connect()
// ...
nc.Subscribe("hello", func(m *nats.Msg){
fmt.Printf("[Received] %s", m.Data)
})
for i := 0; i < 1000; i ++ {
nc.Publish("hello", []byte("world"))
}
// No guarantees of having sent the bytes yet!
// They may still just be in the flushing queue.
ASYNCHRONOUS IO
In order to guarantee that the published messages have
been processed by the server, we can do an extra
ping/pong to con rm they were consumed:
nc.Subscribe("hello", func(m *nats.Msg){
fmt.Printf("[Received] %s", m.Data)
})
for i := 0; i < 1000; i ++ {
nc.Publish("hello", []byte("world"))
}
// Do a PING/PONG roundtrip with the server.
nc.Flush()
SUB hello 1rnPUB hello 5rnworldrn..PINGrn
Then ush the bu er and wait for PONGfrom server
ASYNCHRONOUS IO
Worst way of measuring NATS performance
nc, _ := nats.Connect(nats.DefaultURL)
msg := []byte("hi")
nc.Subscribe("hello", func(_ *nats.Msg) {})
for i := 0; i < 100000000; i++ {
nc.Publish("hello", msg)
}
 
The client is a slow consumer since it is not consuming the
messages which the server is sending fast enough.
Whenever the server cannot ush bytes to a client fast
enough, it will disconnect the client from the system as
this consuming pace could a ect the whole service and rest
of the clients.
NATS Server is protecting itself
NATS = Performance + Simplicity + Resiliency
ALSO INCLUDED
Subject routing with wildcards
Authorization
Distribution queue groups for balancing
Cluster mode for high availability
Auto discovery of topology
Secure TLS connections with certi cates
/varzmonitoring endpoint
used by nats-top
SUBJECTS ROUTING
Wildcards: *
SUB foo.*.bar 90
PUB foo.hello.bar 2
hi
MSG foo.hello.bar 90 2
hi
e.g. subscribe to all NATS requests being made on the demo
site:
telnet demo.nats.io 4222
INFO {"auth_required":false,"version":"0.9.4",...}
SUB _INBOX.* 99
MSG _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 99 11
I can help!
SUBJECTS ROUTING
Full wildcard: >
SUB hello.> 90
PUB hello.world.again 2
hi
MSG hello.world.again 90 2
hi
Subscribe to all subjects and see whole tra c going
through the server:
telnet demo.nats.io 4222
INFO {"auth_required":false,"version":"0.9.4",...}
sub > 1
+OK
SUBJECTS AUTHORIZATION
Clients are not allowed to publish on _SYSfor example:
PUB _SYS.foo 2
hi
-ERR 'Permissions Violation for Publish to "_SYS.foo"'
SUBJECTS AUTHORIZATION
Can customize disallowing pub/sub on certain subjects via
server con g too:
authorization {
admin = { publish = ">", subscribe = ">" }
requestor = {
publish = ["req.foo", "req.bar"]
subscribe = "_INBOX.*"
}
users = [
{user: alice, password: foo, permissions: $admin}
{user: bob, password: bar, permissions: $requestor}
]
}
Building systems with NATS
FAMILIAR SCENARIO
Service A needs to talk to services B and C
FAMILIAR SCENARIO
Horizontally scaled…
COMMUNICATING WITHIN A
DISTRIBUTED SYSTEM
Just use HTTP everywhere?
Use some form of point to point RPC?
What about service discovery and load balancing?
What if sub ms latency performance is required?
 
WHAT NATS GIVES US
publish/subscribe based low latency mechanism for
communicating with 1 to 1, 1 to N nodes
An established TCP connection to a server
A dial tone
COMMUNICATING THROUGH NATS
Using NATS for internal communication
HA WITH NATS CLUSTER
Avoid SPOF on NATS by assembling a full mesh cluster
HA WITH NATS CLUSTER
Clients reconnect logic is triggered
HA WITH NATS CLUSTER
Connecting to a NATS cluster of 2 nodes explicitly
srvs := "nats://10.240.0.11:4222,nats://10.240.0.21:4223"
nc, _ := nats.Connect(srvs)
Bonus: Cluster topology can be discovered dynamically too!
CLUSTER AUTO DISCOVERY
We can start with a single node…
Then have new nodes join the cluster…
As new nodes join, server announces INFOto clients.
Clients auto recon gure to be aware of new nodes.
Clients auto recon gure to be aware of new nodes.
Now fully connected!
On failure, clients reconnect to an available node.
COMMUNICATING USING NATS
HEARTBEATS
For announcing liveness, services could publish heartbeats
HEARTBEATS → DISCOVERY
Heartbeats can help too for discovering services via
wildcard subscriptions.
nc, _ := nats.Connect(nats.DefaultURL)
// SUB service.*.heartbeats 1rn
nc.Subscribe("service.*.heartbeats", func(m *nats.Msg) {
// Heartbeat from service received
})
DISTRIBUTION QUEUES
Balance work among nodes randomly
DISTRIBUTION QUEUES
Balance work among nodes randomly
DISTRIBUTION QUEUES
Balance work among nodes randomly
DISTRIBUTION QUEUES
Service A workers subscribe to service.Aand create
workersdistribution queue group for balancing the work.
nc, _ := nats.Connect(nats.DefaultURL)
// SUB service.A workers 1rn
nc.QueueSubscribe("service.A", "workers",
func(m *nats.Msg) {
nc.Publish(m.Reply, []byte("hi!"))
})
DISTRIBUTION QUEUES
Note: NATS does not assume the audience!
DISTRIBUTION QUEUES
All interested subscribers receive the message
LOWEST LATENCY RESPONSE
Service A communicating with fastest node from Service B
LOWEST LATENCY RESPONSE
Service A communicating with fastest node from Service B
LOWEST LATENCY RESPONSE
NATS requests were designed exactly for this
nc, _ := nats.Connect(nats.DefaultURL)
t := 250*time.Millisecond
// Request sets to AutoUnsubscribe after 1 response
msg, err := nc.Request("service.B", []byte("help"), t)
if err == nil {
fmt.Println(string(msg.Data))
// => sure!
}
nc, _ := nats.Connect(nats.DefaultURL)
nc.Subscribe("service.B", func(m *nats.Msg) {
nc.Publish(m.Reply, []byte("sure!"))
})
UNDERSTANDING NATS TIMEOUT
Note: Making a request involves establishing a client
timeout.
t := 250*time.Millisecond
_, err := nc.Request("service.A", []byte("help"), t)
fmt.Println(err)
// => nats: timeout
This needs special handling!
UNDERSTANDING NATS TIMEOUT
NATS is re and forget, reason for which a client times out
could be many things:
No one was connected at that time
service unavailable
Service is actually still processing the request
service took too long
Service was processing the request but crashed
service error
CONFIRM AVAILABILITY OF
SERVICE NODE WITH REQUEST
Each service node could have its own inbox
A request is sent to service.Bto get a single response,
which will then reply with its own inbox, (no payload
needed).
If there is not a fast reply before client times out, then
most likely the service is unavailable for us at that time.
If there is a response, then use that inbox in a request
SUB _INBOX.123available 90
PUB _INBOX.123available _INBOX.456helpplease...
Summary
NATS is a simple, fast and reliable solution for the internal
communication of a distributed system.
It chooses simplicity and reliability over guaranteed
delivery.
Though this does not necessarily mean that guarantees of a
system are constrained due to NATS!
→ https://en.wikipedia.org/wiki/End-to-end_principle
We can always build strong guarantees on top, but
we can't always remove them from below.
Tyler Treat, Simple Solutions to Complex Problems
Replayability can be better than guaranteed delivery
Idempotency can be better than exactly once delivery
Commutativity can be better than ordered delivery
Related NATS project: NATS Streaming
REFERENCES
High Performance Systems in Go (Gophercon 2014)
Derek Collison ( )
Dissecting Message Queues (2014)
Tyler Treat ( )
Simplicity Matters (RailsConf 2012)
Rich Hickey ( )
Simple Solutions for Complex Problems (2016)
Tyler Treat ( )
End To End Argument (1984)
J.H. Saltzer, D.P. Reed and D.D. Clark ( )
link
link
link
link
link
THANKS!
/github.com/nats-io @nats_io
Play with the demo site!
telnet demo.nats.io 4222

Más contenido relacionado

La actualidad más candente

RethinkConn 2022!
RethinkConn 2022!RethinkConn 2022!
RethinkConn 2022!NATS
 
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹InfraEngineer
 
Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusGrafana Labs
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchTe-Yen Liu
 
Observability in Java: Getting Started with OpenTelemetry
Observability in Java: Getting Started with OpenTelemetryObservability in Java: Getting Started with OpenTelemetry
Observability in Java: Getting Started with OpenTelemetryDevOps.com
 
Deep dive into Kubernetes Networking
Deep dive into Kubernetes NetworkingDeep dive into Kubernetes Networking
Deep dive into Kubernetes NetworkingSreenivas Makam
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Weaveworks
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes NetworkingCJ Cullen
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetesRishabh Indoria
 
Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3NGINX, Inc.
 
Open vSwitch Introduction
Open vSwitch IntroductionOpen vSwitch Introduction
Open vSwitch IntroductionHungWei Chiu
 
Istio service mesh introduction
Istio service mesh introductionIstio service mesh introduction
Istio service mesh introductionKyohei Mizumoto
 
Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondKubeAcademy
 
Distributed Tracing with Jaeger
Distributed Tracing with JaegerDistributed Tracing with Jaeger
Distributed Tracing with JaegerInho Kang
 
The Service Mesh: It's about Traffic
The Service Mesh: It's about TrafficThe Service Mesh: It's about Traffic
The Service Mesh: It's about TrafficC4Media
 
MySQL Monitoring using Prometheus & Grafana
MySQL Monitoring using Prometheus & GrafanaMySQL Monitoring using Prometheus & Grafana
MySQL Monitoring using Prometheus & GrafanaYoungHeon (Roy) Kim
 
Event Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQEvent Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQAraf Karsh Hamid
 

La actualidad más candente (20)

RethinkConn 2022!
RethinkConn 2022!RethinkConn 2022!
RethinkConn 2022!
 
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
 
Monitoring Kubernetes with Prometheus
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with Prometheus
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
Observability in Java: Getting Started with OpenTelemetry
Observability in Java: Getting Started with OpenTelemetryObservability in Java: Getting Started with OpenTelemetry
Observability in Java: Getting Started with OpenTelemetry
 
Deep dive into Kubernetes Networking
Deep dive into Kubernetes NetworkingDeep dive into Kubernetes Networking
Deep dive into Kubernetes Networking
 
gRPC Overview
gRPC OverviewgRPC Overview
gRPC Overview
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3Get Hands-On with NGINX and QUIC+HTTP/3
Get Hands-On with NGINX and QUIC+HTTP/3
 
Open vSwitch Introduction
Open vSwitch IntroductionOpen vSwitch Introduction
Open vSwitch Introduction
 
Istio service mesh introduction
Istio service mesh introductionIstio service mesh introduction
Istio service mesh introduction
 
Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyond
 
Distributed Tracing with Jaeger
Distributed Tracing with JaegerDistributed Tracing with Jaeger
Distributed Tracing with Jaeger
 
The Service Mesh: It's about Traffic
The Service Mesh: It's about TrafficThe Service Mesh: It's about Traffic
The Service Mesh: It's about Traffic
 
MySQL Monitoring using Prometheus & Grafana
MySQL Monitoring using Prometheus & GrafanaMySQL Monitoring using Prometheus & Grafana
MySQL Monitoring using Prometheus & Grafana
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Event Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQEvent Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQ
 

Similar a The Zen of High Performance Messaging with NATS

Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm NATS
 
NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016wallyqs
 
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and SwarmSimple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and SwarmApcera
 
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 Erawallyqs
 
Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...
Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...
Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...NATS
 
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 EraAll Things Open
 
KubeConEU - NATS Deep Dive
KubeConEU - NATS Deep DiveKubeConEU - NATS Deep Dive
KubeConEU - NATS Deep Divewallyqs
 
Ubuntu server wireless access point (eng)
Ubuntu server wireless access point (eng)Ubuntu server wireless access point (eng)
Ubuntu server wireless access point (eng)Anatoliy Okhotnikov
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)DongHyeon Kim
 
VyOS Users Meeting #2, VyOSのVXLANの話
VyOS Users Meeting #2, VyOSのVXLANの話VyOS Users Meeting #2, VyOSのVXLANの話
VyOS Users Meeting #2, VyOSのVXLANの話upaa
 
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdf
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdfOf the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdf
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdfanuradhasilks
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefMatt Ray
 
NATS for Rubyists - Tokyo Rubyist Meetup
NATS for Rubyists - Tokyo Rubyist MeetupNATS for Rubyists - Tokyo Rubyist Meetup
NATS for Rubyists - Tokyo Rubyist Meetupwallyqs
 
Writing Networking Clients in Go - GopherCon 2017 talk
Writing Networking Clients in Go - GopherCon 2017 talkWriting Networking Clients in Go - GopherCon 2017 talk
Writing Networking Clients in Go - GopherCon 2017 talkNATS
 
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
 
OSCON: Building Cloud Native Apps with NATS
OSCON:  Building Cloud Native Apps with NATSOSCON:  Building Cloud Native Apps with NATS
OSCON: Building Cloud Native Apps with NATSwallyqs
 
Networking in Kubernetes
Networking in KubernetesNetworking in Kubernetes
Networking in KubernetesMinhan Xia
 
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...idsecconf
 

Similar a The Zen of High Performance Messaging with NATS (20)

Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
 
NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016
 
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and SwarmSimple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
 
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
 
Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...
Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...
Simple, Secure, Scalable Messaging for the Cloud Native Era - AllThingsOpen 2...
 
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
 
KubeConEU - NATS Deep Dive
KubeConEU - NATS Deep DiveKubeConEU - NATS Deep Dive
KubeConEU - NATS Deep Dive
 
Ubuntu server wireless access point (eng)
Ubuntu server wireless access point (eng)Ubuntu server wireless access point (eng)
Ubuntu server wireless access point (eng)
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)
 
Docker at Flux7
Docker at Flux7Docker at Flux7
Docker at Flux7
 
VyOS Users Meeting #2, VyOSのVXLANの話
VyOS Users Meeting #2, VyOSのVXLANの話VyOS Users Meeting #2, VyOSのVXLANの話
VyOS Users Meeting #2, VyOSのVXLANの話
 
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdf
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdfOf the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdf
Of the variedtypes of IPC, sockets arout and awaythe foremostcommon..pdf
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and Chef
 
NATS for Rubyists - Tokyo Rubyist Meetup
NATS for Rubyists - Tokyo Rubyist MeetupNATS for Rubyists - Tokyo Rubyist Meetup
NATS for Rubyists - Tokyo Rubyist Meetup
 
Writing Networking Clients in Go - GopherCon 2017 talk
Writing Networking Clients in Go - GopherCon 2017 talkWriting Networking Clients in Go - GopherCon 2017 talk
Writing Networking Clients in Go - GopherCon 2017 talk
 
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...
 
OSCON: Building Cloud Native Apps with NATS
OSCON:  Building Cloud Native Apps with NATSOSCON:  Building Cloud Native Apps with NATS
OSCON: Building Cloud Native Apps with NATS
 
Networking in Kubernetes
Networking in KubernetesNetworking in Kubernetes
Networking in Kubernetes
 
IoT Secure Bootsrapping : ideas
IoT Secure Bootsrapping : ideasIoT Secure Bootsrapping : ideas
IoT Secure Bootsrapping : ideas
 
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
 

Más de NATS

NATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATS
NATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATSNATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATS
NATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATSNATS
 
NATS Connect Live!
NATS Connect Live!NATS Connect Live!
NATS Connect Live!NATS
 
NATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATSNATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATSNATS
 
NATS Connect Live | Pub/Sub on the Power Grid
NATS Connect Live | Pub/Sub on the Power GridNATS Connect Live | Pub/Sub on the Power Grid
NATS Connect Live | Pub/Sub on the Power GridNATS
 
NATS Connect Live | Distributed Identity & Authorization
NATS Connect Live | Distributed Identity & AuthorizationNATS Connect Live | Distributed Identity & Authorization
NATS Connect Live | Distributed Identity & AuthorizationNATS
 
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 MeshNATS
 
NATS Connect Live | Resgate
NATS Connect Live | ResgateNATS Connect Live | Resgate
NATS Connect Live | ResgateNATS
 
NATS Connect Live | NATS & Augmented Reality
NATS Connect Live | NATS & Augmented RealityNATS Connect Live | NATS & Augmented Reality
NATS Connect Live | NATS & Augmented RealityNATS
 
Deploy Secure and Scalable Services Across Kubernetes Clusters with NATS
Deploy Secure and Scalable Services Across Kubernetes Clusters with NATSDeploy Secure and Scalable Services Across Kubernetes Clusters with NATS
Deploy Secure and Scalable Services Across Kubernetes Clusters with NATSNATS
 
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 FutureNATS
 
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 & ConnectivityNATS
 
OSCON 2019 | Time to Think Different
OSCON 2019 | Time to Think DifferentOSCON 2019 | Time to Think Different
OSCON 2019 | Time to Think DifferentNATS
 
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 FissionNATS
 
NATS vs HTTP for Interservice Communication
NATS vs HTTP for Interservice CommunicationNATS vs HTTP for Interservice Communication
NATS vs HTTP for Interservice CommunicationNATS
 
Using NATS for Control Flow in Distributed Systems
Using NATS for Control Flow in Distributed SystemsUsing NATS for Control Flow in Distributed Systems
Using NATS for Control Flow in Distributed SystemsNATS
 
Integration Patterns for Microservices Architectures
Integration Patterns for Microservices ArchitecturesIntegration Patterns for Microservices Architectures
Integration Patterns for Microservices ArchitecturesNATS
 
Simple Solutions for Complex Problems - Boulder Meetup
Simple Solutions for Complex Problems - Boulder Meetup Simple Solutions for Complex Problems - Boulder Meetup
Simple Solutions for Complex Problems - Boulder Meetup NATS
 
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupNATS
 
NATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices NATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices NATS
 
Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATSNATS
 

Más de NATS (20)

NATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATS
NATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATSNATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATS
NATS Connect Live | Serverless on Kubernetes with OpenFaaS & NATS
 
NATS Connect Live!
NATS Connect Live!NATS Connect Live!
NATS Connect Live!
 
NATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATSNATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATS
 
NATS Connect Live | Pub/Sub on the Power Grid
NATS Connect Live | Pub/Sub on the Power GridNATS Connect Live | Pub/Sub on the Power Grid
NATS Connect Live | Pub/Sub on the Power Grid
 
NATS Connect Live | Distributed Identity & Authorization
NATS Connect Live | Distributed Identity & AuthorizationNATS Connect Live | Distributed Identity & Authorization
NATS Connect Live | Distributed Identity & Authorization
 
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 Connect Live | Resgate
NATS Connect Live | ResgateNATS Connect Live | Resgate
NATS Connect Live | Resgate
 
NATS Connect Live | NATS & Augmented Reality
NATS Connect Live | NATS & Augmented RealityNATS Connect Live | NATS & Augmented Reality
NATS Connect Live | NATS & Augmented Reality
 
Deploy Secure and Scalable Services Across Kubernetes Clusters with NATS
Deploy Secure and Scalable Services Across Kubernetes Clusters with NATSDeploy Secure and Scalable Services Across Kubernetes Clusters with NATS
Deploy Secure and Scalable Services Across Kubernetes Clusters with 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
 
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
 
OSCON 2019 | Time to Think Different
OSCON 2019 | Time to Think DifferentOSCON 2019 | Time to Think Different
OSCON 2019 | Time to Think Different
 
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 vs HTTP for Interservice Communication
NATS vs HTTP for Interservice CommunicationNATS vs HTTP for Interservice Communication
NATS vs HTTP for Interservice Communication
 
Using NATS for Control Flow in Distributed Systems
Using NATS for Control Flow in Distributed SystemsUsing NATS for Control Flow in Distributed Systems
Using NATS for Control Flow in Distributed Systems
 
Integration Patterns for Microservices Architectures
Integration Patterns for Microservices ArchitecturesIntegration Patterns for Microservices Architectures
Integration Patterns for Microservices Architectures
 
Simple Solutions for Complex Problems - Boulder Meetup
Simple Solutions for Complex Problems - Boulder Meetup Simple Solutions for Complex Problems - Boulder Meetup
Simple Solutions for Complex Problems - Boulder Meetup
 
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup
 
NATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices NATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices
 
Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATS
 

Último

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 

Último (20)

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 

The Zen of High Performance Messaging with NATS

  • 1.   The Zen of High Performance Messaging with NATS Waldemar Quevedo / @wallyqs Strange Loop 2016
  • 2. ABOUT Waldemar Quevedo / Software Developer at in SF Development of the Apcera Platform Past: PaaS DevOps at Rakuten in Tokyo NATS client maintainer (Ruby, Python) @wallyqs Apcera
  • 3. ABOUT THIS TALK What is NATS Design from NATS Building systems with NATS
  • 5. NATS High Performance Messaging System Created by First written in in 2010 Originally built for Cloud Foundry Rewritten in in 2012 Better performance Open Source, MIT License Derek Collison Ruby Go https://github.com/nats-io
  • 6. THANKS GO TEAM Small binary → Lightweight Docker image No deployment dependencies ✌
  • 7. Acts as an always available dial-tone
  • 9. single byte message Around 10M messages/second
  • 10. MUCH BETTER BENCHMARK From 's awesome blog@tyler_treat (2014)http://bravenewgeek.com/dissecting-message-queues/
  • 11. NATS = Performance + Simplicity
  • 13. NATS Design constrained to keep it as operationally simple and reliable as possible while still being both performant and scalable.
  • 15. Simplicity buys you opportunity. ー Rich Hickey, Cognitect Link: https://www.youtube.com/watch?v=rI8tNMsozo0
  • 16. LESS IS BETTER Concise feature set (pure pub/sub) No built-in persistence of messages No exactly-once-delivery promises either Those concerns are simpli ed away from NATS
  • 18. What could be the fastest, simplest and most reliable way of writing and reading to a socket to communicate with N nodes?
  • 19. DESIGN TCP/IP based Plain text protocol Pure pub/sub re and forget at most once
  • 22. Connecting to the public demo server… telnet demo.nats.io 4222 INFO {"tls_required":false,"max_payload":1048576,...}
  • 23. Optionally giving a name to the client connect {"name":"nats-strangeloop-client"} +OK
  • 24. Pinging the server, we should get a pong back ping PONG
  • 25. Not following ping/pong interval, results in server disconnecting us. INFO {"auth_required":false,"max_payload":1048576,...} PING PING -ERR 'Stale Connection' Connection closed by foreign host.
  • 26. Subscribe to the hellosubject identifying it with the arbitrary number 10 sub hello 10 +OK
  • 27. Publishing on hellosubject a payload of 5 bytes sub hello 10 +OK pub hello 5 world
  • 28. Message received! telnet demo.nats.io 4222 sub hello 10 +OK pub hello 5 world MSG hello 10 5 world Payload is opaque to the server! It is just bytes, but could be json, msgpack, etc…
  • 30. PROBLEM How can we send a request and expect a response back with pure pub/sub?
  • 31. NATS REQUESTS Initially, client making the request creates a subscription with a string:unique identi er SUB _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 2 +OK NATS clients libraries have helpers for generating these: nats.NewInbox() // => _INBOX.ioL1Ws5aZZf5fyeF6sAdjw
  • 32. NATS REQUESTS Then it expresses in the topic:limited interest SUB _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 2 UNSUB 2 1 tells the server to unsubscribe from subscription with sid=2 after getting 1 message
  • 33. NATS REQUESTS Then the request is published to a subject (help), tagging it with the ephemeral inbox just for the request to happen: SUB _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 2 UNSUB 2 1 PUB help _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 6 please
  • 34. NATS REQUESTS Then i there is another subscriber connected and interested in the helpsubject, it will receive a message with that inbox: # Another client interested in the help subject SUB help 90 # Receives from server a message MSG help 90 _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 6 please # Can use that inbox to reply back PUB _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 11 I can help!
  • 35. NATS REQUESTS Finally, i the client which sent the request is still connected and interested, it will be receiving that message: SUB _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 2 UNSUB 2 1 PUB help _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 6 please MSG _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 2 11 I can help!
  • 36. Simple Protocol == Simple Clients
  • 37. Given the protocol is simple, NATS clients libraries tend to have a very small footprint as well.
  • 39. RUBY require 'nats/client' NATS.start do |nc| nc.subscribe("hello") do |msg| puts "[Received] #{msg}" end nc.publish("hello", "world") end
  • 40. GO nc, err := nats.Connect() // ... nc.Subscribe("hello", func(m *nats.Msg){ fmt.Printf("[Received] %s", m.Data) }) nc.Publish("hello", []byte("world"))
  • 41. MANY MORE AVAILABLE C C# Java Python NGINX Spring Node.js Elixir Rust Lua Erlang PHP Haskell Scala Perl Many thanks to the community!
  • 42. ASYNCHRONOUS IO Note: Most clients have asynchronous behavior nc, err := nats.Connect() // ... nc.Subscribe("hello", func(m *nats.Msg){ fmt.Printf("[Received] %s", m.Data) }) for i := 0; i < 1000; i ++ { nc.Publish("hello", []byte("world")) } // No guarantees of having sent the bytes yet! // They may still just be in the flushing queue.
  • 43. ASYNCHRONOUS IO In order to guarantee that the published messages have been processed by the server, we can do an extra ping/pong to con rm they were consumed: nc.Subscribe("hello", func(m *nats.Msg){ fmt.Printf("[Received] %s", m.Data) }) for i := 0; i < 1000; i ++ { nc.Publish("hello", []byte("world")) } // Do a PING/PONG roundtrip with the server. nc.Flush() SUB hello 1rnPUB hello 5rnworldrn..PINGrn Then ush the bu er and wait for PONGfrom server
  • 44. ASYNCHRONOUS IO Worst way of measuring NATS performance nc, _ := nats.Connect(nats.DefaultURL) msg := []byte("hi") nc.Subscribe("hello", func(_ *nats.Msg) {}) for i := 0; i < 100000000; i++ { nc.Publish("hello", msg) }
  • 45.  
  • 46. The client is a slow consumer since it is not consuming the messages which the server is sending fast enough. Whenever the server cannot ush bytes to a client fast enough, it will disconnect the client from the system as this consuming pace could a ect the whole service and rest of the clients. NATS Server is protecting itself
  • 47. NATS = Performance + Simplicity + Resiliency
  • 48. ALSO INCLUDED Subject routing with wildcards Authorization Distribution queue groups for balancing Cluster mode for high availability Auto discovery of topology Secure TLS connections with certi cates /varzmonitoring endpoint used by nats-top
  • 49. SUBJECTS ROUTING Wildcards: * SUB foo.*.bar 90 PUB foo.hello.bar 2 hi MSG foo.hello.bar 90 2 hi e.g. subscribe to all NATS requests being made on the demo site: telnet demo.nats.io 4222 INFO {"auth_required":false,"version":"0.9.4",...} SUB _INBOX.* 99 MSG _INBOX.ioL1Ws5aZZf5fyeF6sAdjw 99 11 I can help!
  • 50. SUBJECTS ROUTING Full wildcard: > SUB hello.> 90 PUB hello.world.again 2 hi MSG hello.world.again 90 2 hi Subscribe to all subjects and see whole tra c going through the server: telnet demo.nats.io 4222 INFO {"auth_required":false,"version":"0.9.4",...} sub > 1 +OK
  • 51. SUBJECTS AUTHORIZATION Clients are not allowed to publish on _SYSfor example: PUB _SYS.foo 2 hi -ERR 'Permissions Violation for Publish to "_SYS.foo"'
  • 52. SUBJECTS AUTHORIZATION Can customize disallowing pub/sub on certain subjects via server con g too: authorization { admin = { publish = ">", subscribe = ">" } requestor = { publish = ["req.foo", "req.bar"] subscribe = "_INBOX.*" } users = [ {user: alice, password: foo, permissions: $admin} {user: bob, password: bar, permissions: $requestor} ] }
  • 54. FAMILIAR SCENARIO Service A needs to talk to services B and C
  • 56. COMMUNICATING WITHIN A DISTRIBUTED SYSTEM Just use HTTP everywhere? Use some form of point to point RPC? What about service discovery and load balancing? What if sub ms latency performance is required?
  • 57.  
  • 58. WHAT NATS GIVES US publish/subscribe based low latency mechanism for communicating with 1 to 1, 1 to N nodes An established TCP connection to a server A dial tone
  • 59. COMMUNICATING THROUGH NATS Using NATS for internal communication
  • 60. HA WITH NATS CLUSTER Avoid SPOF on NATS by assembling a full mesh cluster
  • 61. HA WITH NATS CLUSTER Clients reconnect logic is triggered
  • 62. HA WITH NATS CLUSTER Connecting to a NATS cluster of 2 nodes explicitly srvs := "nats://10.240.0.11:4222,nats://10.240.0.21:4223" nc, _ := nats.Connect(srvs) Bonus: Cluster topology can be discovered dynamically too!
  • 64. We can start with a single node…
  • 65. Then have new nodes join the cluster…
  • 66. As new nodes join, server announces INFOto clients.
  • 67. Clients auto recon gure to be aware of new nodes.
  • 68. Clients auto recon gure to be aware of new nodes.
  • 70. On failure, clients reconnect to an available node.
  • 72. HEARTBEATS For announcing liveness, services could publish heartbeats
  • 73. HEARTBEATS → DISCOVERY Heartbeats can help too for discovering services via wildcard subscriptions. nc, _ := nats.Connect(nats.DefaultURL) // SUB service.*.heartbeats 1rn nc.Subscribe("service.*.heartbeats", func(m *nats.Msg) { // Heartbeat from service received })
  • 74. DISTRIBUTION QUEUES Balance work among nodes randomly
  • 75. DISTRIBUTION QUEUES Balance work among nodes randomly
  • 76. DISTRIBUTION QUEUES Balance work among nodes randomly
  • 77. DISTRIBUTION QUEUES Service A workers subscribe to service.Aand create workersdistribution queue group for balancing the work. nc, _ := nats.Connect(nats.DefaultURL) // SUB service.A workers 1rn nc.QueueSubscribe("service.A", "workers", func(m *nats.Msg) { nc.Publish(m.Reply, []byte("hi!")) })
  • 78. DISTRIBUTION QUEUES Note: NATS does not assume the audience!
  • 79. DISTRIBUTION QUEUES All interested subscribers receive the message
  • 80. LOWEST LATENCY RESPONSE Service A communicating with fastest node from Service B
  • 81. LOWEST LATENCY RESPONSE Service A communicating with fastest node from Service B
  • 82. LOWEST LATENCY RESPONSE NATS requests were designed exactly for this nc, _ := nats.Connect(nats.DefaultURL) t := 250*time.Millisecond // Request sets to AutoUnsubscribe after 1 response msg, err := nc.Request("service.B", []byte("help"), t) if err == nil { fmt.Println(string(msg.Data)) // => sure! } nc, _ := nats.Connect(nats.DefaultURL) nc.Subscribe("service.B", func(m *nats.Msg) { nc.Publish(m.Reply, []byte("sure!")) })
  • 83. UNDERSTANDING NATS TIMEOUT Note: Making a request involves establishing a client timeout. t := 250*time.Millisecond _, err := nc.Request("service.A", []byte("help"), t) fmt.Println(err) // => nats: timeout This needs special handling!
  • 84. UNDERSTANDING NATS TIMEOUT NATS is re and forget, reason for which a client times out could be many things: No one was connected at that time service unavailable Service is actually still processing the request service took too long Service was processing the request but crashed service error
  • 85. CONFIRM AVAILABILITY OF SERVICE NODE WITH REQUEST Each service node could have its own inbox A request is sent to service.Bto get a single response, which will then reply with its own inbox, (no payload needed). If there is not a fast reply before client times out, then most likely the service is unavailable for us at that time. If there is a response, then use that inbox in a request SUB _INBOX.123available 90 PUB _INBOX.123available _INBOX.456helpplease...
  • 87. NATS is a simple, fast and reliable solution for the internal communication of a distributed system. It chooses simplicity and reliability over guaranteed delivery. Though this does not necessarily mean that guarantees of a system are constrained due to NATS! → https://en.wikipedia.org/wiki/End-to-end_principle
  • 88. We can always build strong guarantees on top, but we can't always remove them from below. Tyler Treat, Simple Solutions to Complex Problems Replayability can be better than guaranteed delivery Idempotency can be better than exactly once delivery Commutativity can be better than ordered delivery Related NATS project: NATS Streaming
  • 89. REFERENCES High Performance Systems in Go (Gophercon 2014) Derek Collison ( ) Dissecting Message Queues (2014) Tyler Treat ( ) Simplicity Matters (RailsConf 2012) Rich Hickey ( ) Simple Solutions for Complex Problems (2016) Tyler Treat ( ) End To End Argument (1984) J.H. Saltzer, D.P. Reed and D.D. Clark ( ) link link link link link
  • 90. THANKS! /github.com/nats-io @nats_io Play with the demo site! telnet demo.nats.io 4222