SlideShare a Scribd company logo
 
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?

Recommended for you

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 2.0 is the largest feature release since the original code base for the server was released. NATS 2.0 was created to allow a new way of thinking about NATS as a shared utility, solving problems at scale through distributed security, multi-tenancy, larger networks, and secure sharing of data. In this presentation, Derek discusses the motives behind the newest features of NATS and how to leverage them to reduce total cost of ownership, decrease time to value, support extremely large scale deployments, and decentralize security to create secure and easy to manage modern distributed systems.

 
by NATS
iotdistributed systemssecure
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기

- Video Playlist: https://www.youtube.com/playlist?list=PLkgLtPJ7Lg3paDba9_z8m-VRGR88CFK67

openstack
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

Services and Streams are the cornerstones of any modern distributed architecture. Communications and observability of modern systems have become just as important as the deployment of the components themselves. In this talk maintainers of the NATS projectwill create a service using NATS as the communication technology. They will show how NATS allows a service application to utilize cutting edge security with the ability to scale up and down, across multiple Kubernetes clusters and cloud deployments. This will be completely observable, with no code changes from the demo code base to global deployment. NATS allows cutting edge modern systems to be built without the additional complexity of load balancers, proxies or sidecars. NATS allows radically easy yet secure deployments across multiple k8s clusters, in any cloud or on-premise environment.

 
by NATS
#nats#kubernetes#iot
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

Recommended for you

Apache Kafka vs RabbitMQ: Fit For Purpose / Decision Tree
Apache Kafka vs RabbitMQ: Fit For Purpose / Decision TreeApache Kafka vs RabbitMQ: Fit For Purpose / Decision Tree
Apache Kafka vs RabbitMQ: Fit For Purpose / Decision Tree

Kafka as a streaming data platform is becoming the successor to traditional messaging systems such as RabbitMQ. Nevertheless, there are still some use cases where they could be a good fit. This one single slide tries to answer in a concise and unbiased way where to use Apache Kafka and where to use RabbitMQ. Your comments and feedback are much appreciated.

stream processingapache kafkarabbitmq
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview

An in depth overview of Kubernetes and it's various components. NOTE: This is a fixed version of a previous presentation (a draft was uploaded with some errors)

containerkubernetesorchestration
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics

Prometheus is an open-source monitoring system that collects metrics from configured targets, stores time series data, and allows users to query and alert on that data. It is designed for dynamic cloud environments and has built-in service discovery integration. Core features include simplicity, efficiency, a dimensional data model, the PromQL query language, and service discovery.

prometheusgrafanakubernetes
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

Recommended for you

Introduction to Nginx
Introduction to NginxIntroduction to Nginx
Introduction to Nginx

Nginx pronounced as "Engine X" is an open source high performance web and reverse proxy server which supports protocols like HTTP, HTTPS, SMTP, IMAP. It can also be used for load balancing and HTTP caching.

knoldusknowledge sharingknolx
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013

Apache Kafka is a distributed publish-subscribe messaging system that allows both publishing and subscribing to streams of records. It uses a distributed commit log that provides low latency and high throughput for handling real-time data feeds. Key features include persistence, replication, partitioning, and clustering.

zookeepertrihugkafka
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA Broadcast

This document provides an overview of installing and configuring the NGINX web server. It discusses installing NGINX from official repositories or from source on Linux systems like Ubuntu, Debian, CentOS and Red Hat. It also covers verifying the installation, basic configurations for web serving, reverse proxying, load balancing and caching. The document discusses modifications that can be made to the main nginx.conf file to improve performance and reliability. It also covers monitoring NGINX using status pages and logs, and summarizes key documentation resources.

nginx plusreverse proxynginx
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

Recommended for you

Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached

Introduction to memcached, a caching service designed for optimizing performance and scaling in the web stack, seen from perspective of MySQL/PHP users. Given for 2nd year students of professional bachelor in ICT at Kaho St. Lieven, Gent.

phpmysqlikdoeict
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)

Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery called pods. Kubernetes can manage pods across a cluster of machines, providing scheduling, deployment, scaling, load balancing, volume mounting and networking. It is widely used by companies like Google, CERN and in large projects like processing images and analyzing particle interactions. Kubernetes is portable, can span multiple cloud providers, and continues growing to support new workloads and use cases.

Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction

A basic introductory slide set on Kubernetes: What does Kubernetes do, what does Kubernetes not do, which terms are used (Containers, Pods, Services, Replica Sets, Deployments, etc...) and how basic interaction with a Kubernetes cluster is done.

introductiondockerkubernetes
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

Recommended for you

CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton

Building Cloud-Native App Series - Part 9 of 11 Microservices Architecture Series CI-CD Jenkins, GitHub Actions, Tekton

ci/cdcontinuous integrationcontinuous dellivery
KubeCon + CloudNative Con NA 2021 | A New Generation of NATS
KubeCon + CloudNative Con NA 2021 | A New Generation of NATSKubeCon + CloudNative Con NA 2021 | A New Generation of NATS
KubeCon + CloudNative Con NA 2021 | A New Generation of NATS

This document discusses NATS, an open-source messaging system. It provides an overview of NATS' features including performance, simplicity, security, availability and support for cloud-native applications. It also summarizes the growth of the NATS community and ecosystem. Key features of the latest NATS 2 releases are highlighted such as JetStream for streaming and messaging, subject mapping capabilities and an administrative CLI tool. Finally, the document outlines different architectural patterns supported by NATS including single server, clustered, superclustered and edge-focused deployments.

 
by NATS
natsiokubeconmessaging
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon

Containers are everywhere. But what exactly is a container? What are they made from? What's the difference between LXC, butts-nspawn, Docker, and the other container systems out there? And why should we bother about specific filesystems? In this talk, Jérôme will show the individual roles and behaviors of the components making up a container: namespaces, control groups, and copy-on-write systems. Then, he will use them to assemble a container from scratch, and highlight the differences (and likelinesses) with existing container systems.

aufslinuxconnamespaces
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

Recommended for you

HAProxy
HAProxy HAProxy
HAProxy

HAProxy is a free, open-source load balancer and reverse proxy that is fast, reliable and offers high availability. It can be used to load balance HTTP and TCP-based applications. Some key features include out-of-band health checks, hot reconfiguration, and multiple load balancing algorithms. Many large companies use HAProxy to load balance their websites and applications. It runs on Linux, BSD, and Solaris and can be used to load balance applications across servers on-premises or in the cloud.

haproxyloadbalancing
Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1

This presentation includes information on Kubernetes Architecture, Container Orchestration, Internal Routing, External Routing, Configuration Management, Credentials Management, Persistent Volumes, Rolling Out Updates, Autoscaling, Package Management, and a Hello World example using Helm.

kubernetesdockercontainers
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

Waldemar Quevedo, Senior Software Engineer at Apcera NATS is a high-performance messaging system optimized for simplicity, reliability and low latency which can be a lightweight solution for the internal communication of your distributed system. In this talk, we will cover its core feature set as well as how to develop and assemble NATS-based microservices using the latest Docker tooling such as Compose and Swarm mode. You can learn more about NATS at http://www.nats.io

golangiotmessaging queue
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…

Recommended for you

NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016

NATS is a high-performance messaging system that is lightweight, simple to use, and scalable. It provides features like request-reply patterns, subject-based routing with wildcards, distribution queues for load balancing, clustering for high availability, and auto discovery of cluster topology. The NATS Docker image is small and lightweight, making it easy to deploy NATS in Docker containers. Examples demonstrated how to run a single NATS node or create a clustered NATS setup using Docker Compose or Docker Swarm for development and production environments.

docker nats_io 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 Era

The majority of middleware and messaging systems in use were built in a time that did not have the concept of scale and real-time data that developers operate in today. With the rise of Cloud Native and Microservices architectures as a design principle and the emphasis on simplicity, speed, and flexibility that come with it, developers need a messaging protocol to match. Enter NATS. NATS is a remarkably lightweight messaging protocol, and extremely flexible and resilient. It is just a few MB in size, and can scale to publish tens of millions of message from a single server.

allthingsopenatomessaging
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 is a simple, high performance open source messaging system for cloud native applications. It provides a basic publish-subscribe messaging protocol along with durable message queues through NATS Streaming. NATS is lightweight, fast, and scalable. It handles over 11 million messages per second and provides predictable performance and resilience through features like cluster support and protection against slow consumers.

 
by NATS
messagingopen sourcedevelopers
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

Recommended for you

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

NATS is a simple, high performance open source messaging system for cloud native applications. It provides a basic publish-subscribe messaging protocol along with multiple language clients. NATS Streaming builds upon NATS to provide additional capabilities like at-least-once delivery and durability. Both projects are widely used in production and have large, active developer communities supporting a variety of client libraries.

ato2017all things openopen source
KubeConEU - NATS Deep Dive
KubeConEU - NATS Deep DiveKubeConEU - NATS Deep Dive
KubeConEU - NATS Deep Dive

NATS is a high performance messaging server and also one of the latest additions to the CNCF. In this talk, we will make a deep dive to the internals of the project covering its design, protocol, clustering implementation, security and authorization features that make it an attractive solution for microservices and low latency applications.

natsmessagingcncf
Ubuntu server wireless access point (eng)
Ubuntu server wireless access point (eng)Ubuntu server wireless access point (eng)
Ubuntu server wireless access point (eng)

What is WAP? Why bother? Router setup Setting up NIC Setting up bridge Security Firewall DHCP DNS Resources

access pointserverwireless
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

Recommended for you

Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)

AWSKRUG 판교 2019.06.05 Kubernetes Internals (Kubernetes 해부하기) - Understanding Kubernetes Components -- Understanding Kube-APIServer -- Understanding Kube-Scheduler -- Understanding Kube-Controller-Manager -- Understanding Kube-Proxy -- Understanding DNS - Understanding Kubernetes Networking -- Understanding Pod Networking -- Understanding Service Networking

kubernetesk8sinternals
Docker at Flux7
Docker at Flux7Docker at Flux7
Docker at Flux7

The document discusses using Docker containers to enable a solar panel monitoring application to support multiple service providers. It describes setting up Docker containers for the TCP data ingestion server and Flask admin application for each provider, linking them to a Cassandra database container. Each provider's instances use a unique Cassandra keyspace to isolate their data. Automating this process using Docker Python APIs allows easily scaling to support additional providers. Lessons learned include Docker providing fast isolation without code changes, and needing improved Docker orchestration and Dockerfile support for multiple commands.

dockerinternet of thingssolar
VyOS Users Meeting #2, VyOSのVXLANの話
VyOS Users Meeting #2, VyOSのVXLANの話VyOS Users Meeting #2, VyOSのVXLANの話
VyOS Users Meeting #2, VyOSのVXLANの話

VyOS now supports VXLAN interfaces which allow multiple L2 segments to be multiplexed over a single physical network. VXLAN uses encapsulation to transport Ethernet frames over IP. The VNI field in VXLAN headers maps frames to different L2 segments. VyOS VXLAN interfaces can be configured and used like physical interfaces for routing, bridging, and protocols like OSPF. However, attributes like the VNI and multicast group cannot be changed after interface creation without deleting and recreating the interface.

 
by upaa
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"))

Recommended for you

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

Of the variedtypes of IPC, sockets arout and awaythe foremostcommon. On any given platform, there arprobably to be differenttypes of IPC that arquicker, except for cross-platform communication, sockets arregardingthe sole game in city. They were fancied in Berkeley as a part of the BSD flavor of UNIX operating system. They unfold like inferno withthe web. With sensible reason — the mixture of sockets with INET makes reprehensionabsolute machines round the world incrediblystraightforward (at least compared to different schemes). Creating a Socket Roughly speaking, once you clicked on the link that brought you to the current page, your browser did one thingjust like the following: #create Associate in Nursing INET, STREAMing socket s = socket.socket( socket.AF_INET, socket.SOCK_STREAM) #now connect withthe net server on port eighty # - the traditionalcommunications protocol port s.connect((\"www.mcmillan-inc.com\", 80)) When the connect completes, the socket s may beaccustomedsend outa call for participation for the text of the page. a similar socket canbrowse the reply, so be destroyed. That’s right, destroyed. shopper sockets arunremarkablysolely used for one exchange (or atiny low set of sequent exchanges). What happens within thenet server may be a bit additionalcomplicated. First, the net server creates a “server socket”: #create Associate in Nursing INET, STREAMing socket serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) #bind the socket to a public host, # and a widely known port serversocket.bind((socket.gethostname(), 80)) #become a server socket serversocket.listen(5) A couple things to notice: we tend to used socket.gethostname() in order that the socket would be visible to the surface world. If we tend to had used s.bind((\'localhost\', 80)) or s.bind((\'127.0.0.1\', 80)) we\'d still have a “server” socket, however one that was solely visible insidea similar machine. s.bind((\'\', 80)) specifies that the socket isaccessible by any address the machine happens to own. A second issue to note: low range ports arsometimes reserved for “well known” services (HTTP, SNMP etc). If you’re kidding, use a pleasant high range (4 digits). Finally, the argument to pay attention tells the socket library that we wish it to queue as several as five connect requests (the traditional max) before refusing outside connections. If the remainder of the code is written properly,that ought to be masses. Now that we\'ve got a “server” socket, listening on port eighty, we will enter the mainloop of the net server: while 1: #accept connections from outside (clientsocket, address) = serversocket.accept() #now do one thing with the clientsocket #in this case, we\'ll fakethis can be a rib server ct = client_thread(clientsocket) ct.run() There’s trulythree general ways thatduring which this loop might work - dispatching a thread to handle clientsocket, producea replacementmethod to handle clientsocket, or structure this app to use non-blocking socke.

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

Razor is an open source provisioning tool that was originally developed by EMC and Puppet Labs. It can discover hardware, select images to deploy, and provision nodes using model-based provisioning. The demo showed setting up a Razor appliance, adding images, models, policies, and brokers. It then deployed an OpenStack all-in-one environment to a new VM using Razor and Chef. The OpenStack cookbook walkthrough explained the roles, environments, and cookbooks used to deploy and configure OpenStack components using Chef.

razoropschefchef
NATS for Rubyists - Tokyo Rubyist Meetup
NATS for Rubyists - Tokyo Rubyist MeetupNATS for Rubyists - Tokyo Rubyist Meetup
NATS for Rubyists - Tokyo Rubyist Meetup

NATS is a high performance messaging system that was originally created as part of CloudFoundry but since then it has grown its own ecosystem and community around it, and also recently included as part of the Cloud Native Computing Foundation (CNCF). Similar to Ruby, one of the goals from NATS is to make building messaging based applications as simple and reliable as possible. In this talk, we will cover why NATS might be interesting to consider for your next project and share some of the lessons learned so far from maintaining the Ruby clients from NATS.

messagingnatspubsub
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)
}

Recommended for you

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...

The NATS Go client is the canonical implementation of a client for the NATS Messaging System, and from the beginning it was designed for high performance. In this talk, we will cover its APIs and dissect how the client internal engine works to get the most out of Go to achieve maximum throughput.

nats messaging performance golang networking
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

Talk by Wally Quevedo at GopherCon 2017 on writing networking clients in Go, based on our experience with Go on the NATS team. The full talk is available on YouTube: https://www.youtube.com/watch?v=QoetRI2KHvc

 
by NATS
cloud computingnetworkinggolang
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

NATS is a mature, high-performance publish/subscribe messaging system that is a hosted project of the Cloud Native Computing Foundation (CNCF). NATS has a goal of connecting services in the simplest, most secure and reliable way possible, and cloud native applications built using NATS inherit much of that simplicity and become easier to operate, benefiting from the performance and resiliency characteristics from the server. Waldemar Quevedo walks you through how to build an application using NATS and how to set up, deploy, and operate a NATS cluster on top of Kubernetes. You’ll learn core NATS features like publish/subscribe, load-balanced queue subscribers, request/response, and handing connection events and examine NATS cluster setup and client application failover, graceful NATS server shutdown and NATS server configuration reload, and graceful client shutdown with NATS Drain mode. You’ll also learn how to secure a NATS cluster with Transport Layer Security (TLS) and secure streams and services with permissions, account isolation and NATS keys (NKEYS) (ed25519 based), and decentralized permissions via JSON Web Tokens (JWTs).

natsoscon2019simple
 
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

Recommended for you

Networking in Kubernetes
Networking in KubernetesNetworking in Kubernetes
Networking in Kubernetes

Overview of networking requirements of Kubernetes cluster, Service Discovery using kubeDNS, Load Balancing, Network Plugins and more extensions.

networkingcontainerkubernetes
IoT Secure Bootsrapping : ideas
IoT Secure Bootsrapping : ideasIoT Secure Bootsrapping : ideas
IoT Secure Bootsrapping : ideas

Presentation of a few mechanisms that can help to automate the bootstrap process in IoT environment. This is the summary of my work done during an 8 weeks internship at red hat

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...

The document discusses exploiting vulnerabilities in wireless routers that have USB ports for sharing storage and printers. It describes conducting attacks against a D-Link wireless router to steal data, delete data, and implant backdoors by accessing the shared USB flash drive and printer through the router's vulnerable SharePort technology. The attacker scans the wireless network, identifies the router and connected USB devices, and then explores ways to hack into the shared resources and conduct unauthorized activities.

idsecconf2014paper
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}
]
}

Recommended for you

How to build a Kubernetes networking solution from scratch
How to build a Kubernetes networking solution from scratchHow to build a Kubernetes networking solution from scratch
How to build a Kubernetes networking solution from scratch

Presented by: Antonin Bas & Jianjun Shen, VMware Presented at All Things Open 2020 Abstract: For the non-initiated, Kubernetes (K8s) networking can be a bit like dark magic. Many clusters have requirements beyond what the default network plugin, kubenet, can provide and require the use of a third-party Container Network Interface (CNI) plugin. But what exactly is the role of these plugins, how do they differ from each other and how does the choice of one affect your cluster? In this talk, Antonin and Jianjun will describe how a group of developers was able to build a CNI plugin - an open source project called Antrea - from scratch and bring it to production in a matter of months. This velocity was achieved by leveraging existing open-source technologies extensively: Open vSwitch, a well-established programmable virtual switch for the data plane, and the K8s libraries for the control plane. Antonin and Jianjun will explain the responsibilities of a CNI plugin in the context of K8s and will walk the audience through the steps required to create one. They will show how Antrea integrates with the rest of the cloud-native ecosystem (e.g. dashboards such as Octant and Prometheus) to provide insight into the network and ensure that K8s networking is not just dark magic anymore.

all things openopen sourceato2020
RethinkConn 2022!
RethinkConn 2022!RethinkConn 2022!
RethinkConn 2022!

Learn how simple it can be to build adaptive and scalable cloud-to-edge systems. Powered By OpenSource NATS.io

 
by NATS
#natsio
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

This document discusses serverless computing with Kubernetes using PLONK (Prometheus, Linux/Linkerd, OpenFaaS, NATS, and Kubernetes) and OpenFaaS. It introduces PLONK and its components, describes how to install the PLONK stack on Kubernetes with or without TLS, explains how to create asynchronous functions with NATS, and discusses future work integrating NATS further for event-driven architectures using queues and JetStream.

 
by NATS
natsionatsconnectkubernetes
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?

Recommended for you

NATS Connect Live!
NATS Connect Live!NATS Connect Live!
NATS Connect Live!

Synadia/NATS Team Presentations for NATS Connect Live on April 16, 2020. To see the recorded event, go to our NATS YouTube Channel https://youtube.com/c/nats_messaging

 
by NATS
natsionatsconnectiot
NATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATSNATS Connect Live | SwimOS & NATS
NATS Connect Live | SwimOS & NATS

SwimOS is an Apache 2.0 licensed runtime platform that makes it easy to build stateful, distributed, data-driven applications. SwimOS is a stateful real-time stream processor that auto-scales apps from real-world event data, building a stateful graph from the data on-the-fly. SwimOS subscribes to event streams from real-world things, creates a stateful web agent for each data source, and links related agents to form an intelligent stream processing graph where the agents continuously compute on incoming data and share insights in real-time.

 
by NATS
#natsio#swimai#eventstreams
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

Dwayne Bradley is a technology development manager at Duke Energy who is working on new approaches to the power grid. He discusses how Duke Energy is adopting new standards like OpenFMB and using message-oriented middleware like NATS to enable distributed intelligence on the grid. This includes deploying OpenFMB nodes with NATS at a microgrid test site in Mount Holly, North Carolina to allow different components like solar panels and batteries to communicate and exchange operational schedules.

 
by NATS
#natsio#messaging#powergrid
 
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

Recommended for you

NATS Connect Live | Distributed Identity & Authorization
NATS Connect Live | Distributed Identity & AuthorizationNATS Connect Live | Distributed Identity & Authorization
NATS Connect Live | Distributed Identity & Authorization

This document discusses using bearer JWT tokens for authorization in distributed systems without a central authority. It motivates this approach by describing requirements for decentralization, privacy, and reducing complexity. It then explains how bearer tokens work by containing a signature, claims about permissions, and how verification is done to apply permissions to ephemeral users. Finally it discusses some caveats, examples of usage, and resources for further information.

 
by NATS
#natsio#jwt#security
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

The document discusses using NATS as a service mesh. It describes how NATS can provide service discovery, security, metrics, tracing, load balancing and routing control similarly to other service meshes. While NATS can inherently perform some service mesh functions through pub/sub and request/reply patterns, it may not replace a full-featured service mesh like Istio and additional capabilities like circuit breaking would need to be implemented. Other resources are recommended to learn more about building a NATS service mesh and its capabilities.

 
by NATS
#natsio#servicemesh#messaging
NATS Connect Live | Resgate
NATS Connect Live | ResgateNATS Connect Live | Resgate
NATS Connect Live | Resgate

Resgate.io is a platform for building REST and real-time APIs using NATS that provides features like real-time access, access control, caching of queries that update in real time, and an active community. It was presented by Samuel Jirénius of Rescore who provided contact information and pointed to the resgate.io website for more information.

 
by NATS
#natsio#rest
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…

Recommended for you

NATS Connect Live | NATS & Augmented Reality
NATS Connect Live | NATS & Augmented RealityNATS Connect Live | NATS & Augmented Reality
NATS Connect Live | NATS & Augmented Reality

NATS is used to build a scalable, location-independent, and resilient augmented reality platform. NATS topics and subjects are used to distribute messages about avatars, props, and world state changes across devices and locations. Messages are serialized using MessagePack for fast serialization and to define the protocol. NATS is integrated into Unity using a services class to connect and publish/subscribe to handle messages asynchronously.

 
by NATS
#natsio#ar#virtualreality
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 brief history of the NATS project, where it is today, how it fits into cloud-native architecture, and where it's going in the near future.

 
by NATS
#nats#microservices#messaging
OSCON 2019 | Time to Think Different
OSCON 2019 | Time to Think DifferentOSCON 2019 | Time to Think Different
OSCON 2019 | Time to Think Different

Decoupling Distributed Systems from IP Networks Take a trip with Derek Collison into the history of distributed systems, the good and the bad, and now how to move forward.

 
by NATS
#networking#security#nats
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.

Recommended for you

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

Soam Vasani of Platform9 shares how Fission.io makes use of NATS and Kubernetes for Serverless workflows

 
by NATS
cloud nativecloud computingmessaging
NATS vs HTTP for Interservice Communication
NATS vs HTTP for Interservice CommunicationNATS vs HTTP for Interservice Communication
NATS vs HTTP for Interservice Communication

Presentation from a talk given by Diogo Monteiro (@diogogmt) at a recent NATS Meetup in Toronto. The talk covered why NATS is a simple, fast method for microservices communication, and provides some latency benchmarks from Diogo's design of a solution using NATS. You can learn more about NATS at http://www.nats.io

 
by NATS
natsintegrationhttp
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

This talk is by Andy Stone, VP Engineering at Bridgevine - it explains how Bridgevine use NATS for distributed systems communication (and why).

 
by NATS
big datanatssoftware development
Now fully connected!
On failure, clients reconnect to an available node.
COMMUNICATING USING NATS
HEARTBEATS
For announcing liveness, services could publish heartbeats

Recommended for you

Integration Patterns for Microservices Architectures
Integration Patterns for Microservices ArchitecturesIntegration Patterns for Microservices Architectures
Integration Patterns for Microservices Architectures

NATS was created by Derek Collison, founder and CEO of Apcera, who has spent 20+ years designing, building, and using publish-subscribe messaging systems. Unlike traditional enterprise messaging systems, NATS has an always-on dial tone that does whatever it takes to remain available. Learn how end users are building modern, reliable and scalable cloud and distributed systems with NATS. Talk given by David Williams, Principal, Williams & Garcia You can learn more about NATS at http://www.nats.io

 
by NATS
open sourcesoftware developmentdevelopment
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

At the NATS June Meetup in Boulder, CO, Tyler Treat of Workiva gives and updated talk on how to embrace simplicity to solve complex infrastructure problems, and how shares more information on how Workiva uses NATS for microservices communication. You can learn more about NATS at http://www.nats.io

 
by NATS
open sourcemicroservicesbig data
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup

At the NATS June Meetup in Boulder, CO, Steven Osborne and Charlie Strawn of Workiva present the Actor Model concept their team are using, and some of the work they are doing to connect NATS and Akka. You can learn more about NATS at http://www.nats.io

 
by NATS
open sourcesoftwaresoftware development
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

Recommended for you

Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATS

NATS & Docker Meetup in Toronto - August 2016 Implementing Microservices with NATS, Diogo Monteiro -How Aytra uses NATS -Benefits of using NATS for inter service communication -Lessons learned adopting NATS -Overview of Houston NATS library -Demo of Aytra You can learn more about NATS at http://www.nats.io

 
by NATS
softwareopen sourcecloud computing
How Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the Internet How Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the Internet

Dennis Mårtensson is the CTO and co-founder of Greta, a Swedish startup that wants to change the way content is delivered on the internet. Greta has developed a technology for peer-to-peer content delivery over webRTC and are using NATS to create rapid webRTC signaling. You can learn more about NATS at http://www.nats.io. You can learn more about Greta at https://greta.io/

 
by NATS
natsopen sourcegolang
How Clarifai uses NATS and Kubernetes for Machine Learning
How Clarifai uses NATS and Kubernetes for Machine Learning How Clarifai uses NATS and Kubernetes for Machine Learning
How Clarifai uses NATS and Kubernetes for Machine Learning

Clarifai (www.clarifai.com) is a machine learning company which aims to make artificial intelligence accessible to the entire world. Their platform allows users to tap into powerful machine learning algorithms while abstracting away the technical minutiae of how the algorithms work and the infrastructure scaling problems of building AI applications from scratch. Clarifai has moved to a highly available Kubernetes (www.kubernetes.io) based architecture, which also required a simple, scalable messaging layer. NATS (www.nats.io) was selected by the Clarifai team for a variety of reasons. The video of the talk that accompanies these slides is available at: https://www.youtube.com/watch?v=fJ20plWSBzw&feature=youtu.be

 
by NATS
machine learningopen sourcenats
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

Recommended for you

AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdfAWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf

AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf

awscloudpractitioner
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...

Hironori Washizaki, "Charting a Course for Equity: Strategies for Overcoming Challenges and Promoting Inclusion in the Metaverse", IEEE COMPSAC 2024 D&I Panel, 2024.

Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple StepsSeamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps

Unlock the full potential of your data by effortlessly migrating from PostgreSQL to Snowflake, the leading cloud data warehouse. This comprehensive guide presents an easy-to-follow 8-step process using Estuary Flow, an open-source data operations platform designed to simplify data pipelines. Discover how to seamlessly transfer your PostgreSQL data to Snowflake, leveraging Estuary Flow's intuitive interface and powerful real-time replication capabilities. Harness the power of both platforms to create a robust data ecosystem that drives business intelligence, analytics, and data-driven decision-making. Key Takeaways: 1. Effortless Migration: Learn how to migrate your PostgreSQL data to Snowflake in 8 simple steps, even with limited technical expertise. 2. Real-Time Insights: Achieve near-instantaneous data syncing for up-to-the-minute analytics and reporting. 3. Cost-Effective Solution: Lower your total cost of ownership (TCO) with Estuary Flow's efficient and scalable architecture. 4. Seamless Integration: Combine the strengths of PostgreSQL's transactional power with Snowflake's cloud-native scalability and data warehousing features. Don't miss out on this opportunity to unlock the full potential of your data. Read & Download this comprehensive guide now and embark on a seamless data journey from PostgreSQL to Snowflake with Estuary Flow! Try it Free: https://dashboard.estuary.dev/register

postgresqlsnowflakepostgres to snowflake
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

Recommended for you

BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTIONBITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION

Bitcoin heist prediction using ML

WEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service ProvidersWEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service Providers

Browse the slides from our recent webinar hosted by Divine Odazie, our tech evangelist.

cloudccxcloud services
Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)

Our world runs on software. It governs all major aspects of our life. It is an enabler for research and innovation, and is critical for business competitivity. Traditional software engineering techniques have achieved high effectiveness, but still may fall short on delivering software at the accelerated pace and with the increasing quality that future scenarios will require. To attack this issue, some software paradigms raise the automation of software development via higher levels of abstraction through domain-specific languages (e.g., in model-driven engineering) and empowering non-professional developers with the possibility to build their own software (e.g., in low-code development approaches). In a software-demanding world, this is an attractive possibility, and perhaps -- paraphrasing Andy Warhol -- "in the future, everyone will be a developer for 15 minutes". However, to make this possible, methods are required to tweak languages to their context of use (crucial given the diversity of backgrounds and purposes), and the assistance to developers throughout the development process (especially critical for non-professionals). In this keynote talk at ICSOFT'2024 I presented enabling techniques for this vision, supporting the creation of families of domain-specific languages, their adaptation to the usage context; and the augmentation of low-code environments with assistants and recommender systems to guide developers (professional or not) in the development process.

softwaremodel-driven engineeringdomain-specific languages
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

Recommended for you

dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdfdachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf

dachnug51 | HCL Sametime 12 as a Software Appliance | Erik Schwalb

dnugdachnugdachnug51
Addressing the Top 9 User Pain Points with Visual Design Elements.pptx
Addressing the Top 9 User Pain Points with Visual Design Elements.pptxAddressing the Top 9 User Pain Points with Visual Design Elements.pptx
Addressing the Top 9 User Pain Points with Visual Design Elements.pptx

Enhance the top 9 user pain points with effective visual design elements to improve user experience & satisfaction. Learn the best design strategies

#ui visual designrecruitmentux
Google ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learningGoogle ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learning

This is the guide on how you can use google's ML kit for machine learning applications on mobile.

ml-kitcoroutineskotlin
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

More Related Content

What's hot

Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
Saroj Panyasrivanit
 
SF Python Meetup - Introduction to NATS Messaging with Python3
SF Python Meetup - Introduction to NATS Messaging with Python3SF Python Meetup - Introduction to NATS Messaging with Python3
SF Python Meetup - Introduction to NATS Messaging with Python3
wallyqs
 
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
 
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
 
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
Ian Choi
 
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
NATS
 
Apache Kafka vs RabbitMQ: Fit For Purpose / Decision Tree
Apache Kafka vs RabbitMQ: Fit For Purpose / Decision TreeApache Kafka vs RabbitMQ: Fit For Purpose / Decision Tree
Apache Kafka vs RabbitMQ: Fit For Purpose / Decision Tree
Slim Baltagi
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
Bob Killen
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics
Juraj Hantak
 
Introduction to Nginx
Introduction to NginxIntroduction to Nginx
Introduction to Nginx
Knoldus Inc.
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
mumrah
 
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX, Inc.
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
Jurriaan Persyn
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
Martin Danielsson
 
CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton
Araf Karsh Hamid
 
KubeCon + CloudNative Con NA 2021 | A New Generation of NATS
KubeCon + CloudNative Con NA 2021 | A New Generation of NATSKubeCon + CloudNative Con NA 2021 | A New Generation of NATS
KubeCon + CloudNative Con NA 2021 | A New Generation of NATS
NATS
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Jérôme Petazzoni
 
HAProxy
HAProxy HAProxy
HAProxy
Arindam Nayak
 
Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1
Imesh Gunaratne
 

What's hot (20)

Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
SF Python Meetup - Introduction to NATS Messaging with Python3
SF Python Meetup - Introduction to NATS Messaging with Python3SF Python Meetup - Introduction to NATS Messaging with Python3
SF Python Meetup - Introduction to NATS Messaging with Python3
 
NATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices NATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices
 
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
 
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
[OpenStack] 공개 소프트웨어 오픈스택 입문 & 파헤치기
 
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
 
Apache Kafka vs RabbitMQ: Fit For Purpose / Decision Tree
Apache Kafka vs RabbitMQ: Fit For Purpose / Decision TreeApache Kafka vs RabbitMQ: Fit For Purpose / Decision Tree
Apache Kafka vs RabbitMQ: Fit For Purpose / Decision Tree
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics
 
Introduction to Nginx
Introduction to NginxIntroduction to Nginx
Introduction to Nginx
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
 
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA Broadcast
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton
 
KubeCon + CloudNative Con NA 2021 | A New Generation of NATS
KubeCon + CloudNative Con NA 2021 | A New Generation of NATSKubeCon + CloudNative Con NA 2021 | A New Generation of NATS
KubeCon + CloudNative Con NA 2021 | A New Generation of NATS
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
 
HAProxy
HAProxy HAProxy
HAProxy
 
Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1
 

Similar to 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 SwarmSimple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Apcera
 
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
 
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 Era
All Things Open
 
KubeConEU - NATS Deep Dive
KubeConEU - NATS Deep DiveKubeConEU - NATS Deep Dive
KubeConEU - NATS Deep Dive
wallyqs
 
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
 
Docker at Flux7
Docker at Flux7Docker at Flux7
Docker at Flux7
Aater Suleman
 
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..pdf
anuradhasilks
 
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
Matt Ray
 
NATS for Rubyists - Tokyo Rubyist Meetup
NATS for Rubyists - Tokyo Rubyist MeetupNATS for Rubyists - Tokyo Rubyist Meetup
NATS for Rubyists - Tokyo Rubyist Meetup
wallyqs
 
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
 
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
NATS
 
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
wallyqs
 
Networking in Kubernetes
Networking in KubernetesNetworking in Kubernetes
Networking in Kubernetes
Minhan Xia
 
IoT Secure Bootsrapping : ideas
IoT Secure Bootsrapping : ideasIoT Secure Bootsrapping : ideas
IoT Secure Bootsrapping : ideas
Jean-Baptiste Trystram
 
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
 
How to build a Kubernetes networking solution from scratch
How to build a Kubernetes networking solution from scratchHow to build a Kubernetes networking solution from scratch
How to build a Kubernetes networking solution from scratch
All Things Open
 

Similar to 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 SwarmSimple 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
 
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
 
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...
 
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
 
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...
 
How to build a Kubernetes networking solution from scratch
How to build a Kubernetes networking solution from scratchHow to build a Kubernetes networking solution from scratch
How to build a Kubernetes networking solution from scratch
 

More from NATS

RethinkConn 2022!
RethinkConn 2022!RethinkConn 2022!
RethinkConn 2022!
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 & NATS
NATS
 
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 & NATS
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
 
NATS Connect Live | Distributed Identity & Authorization
NATS Connect Live | Distributed Identity & AuthorizationNATS Connect Live | Distributed Identity & Authorization
NATS Connect Live | Distributed Identity & Authorization
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
 
NATS Connect Live | Resgate
NATS Connect Live | ResgateNATS Connect Live | Resgate
NATS Connect Live | Resgate
NATS
 
NATS Connect Live | NATS & Augmented Reality
NATS Connect Live | NATS & Augmented RealityNATS Connect Live | NATS & Augmented Reality
NATS Connect Live | NATS & Augmented Reality
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
 
OSCON 2019 | Time to Think Different
OSCON 2019 | Time to Think DifferentOSCON 2019 | Time to Think Different
OSCON 2019 | Time to Think Different
NATS
 
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
 
NATS vs HTTP for Interservice Communication
NATS vs HTTP for Interservice CommunicationNATS vs HTTP for Interservice Communication
NATS vs HTTP for Interservice Communication
NATS
 
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
NATS
 
Integration Patterns for Microservices Architectures
Integration Patterns for Microservices ArchitecturesIntegration Patterns for Microservices Architectures
Integration Patterns for Microservices Architectures
NATS
 
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 Meetup
NATS
 
Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATS
NATS
 
How Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the Internet How Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the Internet
NATS
 
How Clarifai uses NATS and Kubernetes for Machine Learning
How Clarifai uses NATS and Kubernetes for Machine Learning How Clarifai uses NATS and Kubernetes for Machine Learning
How Clarifai uses NATS and Kubernetes for Machine Learning
NATS
 

More from NATS (20)

RethinkConn 2022!
RethinkConn 2022!RethinkConn 2022!
RethinkConn 2022!
 
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
 
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
 
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
 
Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATS
 
How Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the Internet How Greta uses NATS to revolutionize data distribution on the Internet
How Greta uses NATS to revolutionize data distribution on the Internet
 
How Clarifai uses NATS and Kubernetes for Machine Learning
How Clarifai uses NATS and Kubernetes for Machine Learning How Clarifai uses NATS and Kubernetes for Machine Learning
How Clarifai uses NATS and Kubernetes for Machine Learning
 

Recently uploaded

AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdfAWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
karim wahed
 
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
Hironori Washizaki
 
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple StepsSeamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Estuary Flow
 
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTIONBITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
ssuser2b426d1
 
WEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service ProvidersWEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service Providers
Severalnines
 
Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)
miso_uam
 
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdfdachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
DNUG e.V.
 
Addressing the Top 9 User Pain Points with Visual Design Elements.pptx
Addressing the Top 9 User Pain Points with Visual Design Elements.pptxAddressing the Top 9 User Pain Points with Visual Design Elements.pptx
Addressing the Top 9 User Pain Points with Visual Design Elements.pptx
Sparity1
 
Google ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learningGoogle ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learning
VishrutGoyani1
 
CViewSurvey Digitech Pvt Ltd that works on a proven C.A.A.G. model.
CViewSurvey Digitech Pvt Ltd that  works on a proven C.A.A.G. model.CViewSurvey Digitech Pvt Ltd that  works on a proven C.A.A.G. model.
CViewSurvey Digitech Pvt Ltd that works on a proven C.A.A.G. model.
bhatinidhi2001
 
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
ThousandEyes
 
NBFC Software: Optimize Your Non-Banking Financial Company
NBFC Software: Optimize Your Non-Banking Financial CompanyNBFC Software: Optimize Your Non-Banking Financial Company
NBFC Software: Optimize Your Non-Banking Financial Company
NBFC Softwares
 
Migrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS CloudMigrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS Cloud
Ortus Solutions, Corp
 
introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...
sachin chaurasia
 
A Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdfA Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdf
kalichargn70th171
 
React Native vs Flutter - SSTech System
React Native vs Flutter  - SSTech SystemReact Native vs Flutter  - SSTech System
React Native vs Flutter - SSTech System
SSTech System
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
onemonitarsoftware
 
Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …
908dutch
 
ANSYS Mechanical APDL Introductory Tutorials.pdf
ANSYS Mechanical APDL Introductory Tutorials.pdfANSYS Mechanical APDL Introductory Tutorials.pdf
ANSYS Mechanical APDL Introductory Tutorials.pdf
sachin chaurasia
 
Top 10 Tips To Get Google AdSense For Your Website
Top 10 Tips To Get Google AdSense For Your WebsiteTop 10 Tips To Get Google AdSense For Your Website
Top 10 Tips To Get Google AdSense For Your Website
e-Definers Technology
 

Recently uploaded (20)

AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdfAWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
 
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
 
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple StepsSeamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
 
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTIONBITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
 
WEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service ProvidersWEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service Providers
 
Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)
 
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdfdachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
 
Addressing the Top 9 User Pain Points with Visual Design Elements.pptx
Addressing the Top 9 User Pain Points with Visual Design Elements.pptxAddressing the Top 9 User Pain Points with Visual Design Elements.pptx
Addressing the Top 9 User Pain Points with Visual Design Elements.pptx
 
Google ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learningGoogle ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learning
 
CViewSurvey Digitech Pvt Ltd that works on a proven C.A.A.G. model.
CViewSurvey Digitech Pvt Ltd that  works on a proven C.A.A.G. model.CViewSurvey Digitech Pvt Ltd that  works on a proven C.A.A.G. model.
CViewSurvey Digitech Pvt Ltd that works on a proven C.A.A.G. model.
 
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
 
NBFC Software: Optimize Your Non-Banking Financial Company
NBFC Software: Optimize Your Non-Banking Financial CompanyNBFC Software: Optimize Your Non-Banking Financial Company
NBFC Software: Optimize Your Non-Banking Financial Company
 
Migrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS CloudMigrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS Cloud
 
introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...
 
A Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdfA Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdf
 
React Native vs Flutter - SSTech System
React Native vs Flutter  - SSTech SystemReact Native vs Flutter  - SSTech System
React Native vs Flutter - SSTech System
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
 
Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …
 
ANSYS Mechanical APDL Introductory Tutorials.pdf
ANSYS Mechanical APDL Introductory Tutorials.pdfANSYS Mechanical APDL Introductory Tutorials.pdf
ANSYS Mechanical APDL Introductory Tutorials.pdf
 
Top 10 Tips To Get Google AdSense For Your Website
Top 10 Tips To Get Google AdSense For Your WebsiteTop 10 Tips To Get Google AdSense For Your Website
Top 10 Tips To Get Google AdSense For Your Website
 

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