Saturday, February 6, 2016

NATS


With 2 decades of my industry experience, I'm recollecting the initial days of nostalgia 'C' procedural coding @ Bell Labs, up to Today's highly distributed 'Spark' coding. To me, high performance at scale is critically important for anybody to build highly distributed systems, Today.

Why Communication is vital?
Three buzz words in Today's Architecture world
  1. API (Application Programming Interface) or Micro Service model 
  2. Highly distributed Cloud Infra
  3. IoT (Internet of Things) network of all devices

Today, the components of application have been built in Service Oriented Architecture (SoA), new term called API style.  As per Cloud theory, pieces of any given service might be spread across physical or virtual infrastructure. IoT thrives to comprise thousands or even millions of devices.

But, to the end user they need to operate seamlessly, as if they are one entity. This requires extremely fast (Performance), lightweight (Portable), always-on (Availability) communication.

What is NATS?
Open Source NATS is an extremely lightweight, and massively scalable Publish/Subscribe (PubSub) messaging system for Cloud Native applications, IoT device messaging, etc.  Home Page: http://nats.io/

History of NATS
NATS was originally created by Derek Collison as the messaging layer inside of Cloud Foundry, when he was designing that product. The original version of NATS was written in Ruby, but was ported over to Go. The Go implementation of the NATS server is called gnatsd, and immediately offered performance well in excess of Ruby-nats,  Brief video at:  https://ttps://blogs.msdn.microsoft.com/dotnet/2016/02/01/on-net-1262016-nats-with-brian-flannery-and-colin-sullivan/

NATS Objective
NATS is clustered mode, auto pruning of interest graph & text based protocol. Itz not intended as a traditional enterprise messaging system - you can think of it more as an ephemeral nervous system, that is always on, and always available.

By sticking to the core tenets of simplicity and speed, NATS - much like Go - provides an excellent foundation for delivering modern distributed systems at scale.

Core Principles
NATS supports 3 key messaging models as listed below:

1. PubSub
NATS implements a publish subscribe (PubSub) messaging model, with fire-and-forget messaging system. It means that if a subscriber is not listening on the subject (no subject match), or is not active when the message is sent, the message is not received

2. RequestReply
NATS supports two flavors of request reply messaging: point-to-point or one-to-many. In a request-response exchange, publish request operation publishes a message with a reply subject expecting a response on that reply subject. You can request to automatically wait for a response inline.

3. Queuing
Queue subscribers can be asynchronous, in which case the message handler callback function processes the delivered message. Synchronous queue subscribers must build in logic to processes the message.

Benchmark
Performance Comparison  (between NATS, Kafka, Active MQ, Redis, NSQ, RabbitMQ, etc) chart is depreciated with throughput payloads as shown in the attached chart.

As the most performant cloud native messaging platform, NATS can send up to 6 million messages per second. Are you ready to leverage throughput benefit from NATS?

No comments:

Post a Comment