Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Build Distributed Systems with NATS.io

Build Distributed Systems with NATS.io

Hyperjump Tech

May 07, 2021
Tweet

More Decks by Hyperjump Tech

Other Decks in Programming

Transcript

  1. What is Distributed Systems ? A distributed system is a

    group of computers working together as to appear as a single computer to the end-user.
  2. What is NATS ? https://nats.io NATS.io is a simple, secure

    and high performance open source messaging system for cloud native applications, IoT messaging, and microservices architectures.
  3. NATS Creator Created By Derek Collison (https://twitter.com/derekcollison) • Founder &

    CEO Synadia • Former Founder & CEO Apcera • Creator of CloudFoundry • Google Developer APIs and JS CDN • TIBCO Messaging
  4. NATS Features • Easy to use for developers and operators

    • High-Performance • Always on and available • Extremely lightweight • At Most Once and At Least Once Delivery • Support for Observable and Scalable Services and Event/Data Streams • Client support for over 30 different programming languages • Cloud Native, a CNCF project with Kubernetes and Prometheus integrations
  5. NATS Use cases • Cloud Messaging ◦ Services (microservices, service

    mesh) ◦ Event/Data Streaming (observability, analytics, ML/AI) • Command and Control ◦ IoT and Edge ◦ Telemetry / Sensor Data / Command and Control • Augmenting or Replacing Legacy Messaging Systems
  6. Components of Messaging Architecture • Message: Messages are the unit

    of data exchange. A payload, which is used for exchanging the data between applications. • Subject: Subject specifies the destination of messages. • Producer: Producers send messages to the NATS server. • Consumer: Consumers receive messages from the NATS server. • Messaging Server: NATS Server distributes the messages from producers to consumers.
  7. NATS Problem NATS offers an at most once quality of

    service. 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. This is the same level of guarantee that TCP/IP provides. By default, NATS is a fire-and-forget messaging system
  8. Solution NATS Streaming • Message/event persistence • At-Least-Once Delivery model,

    giving reliable message delivery • Rate limiting • Replay/Restart • Last Value Semantics
  9. NATS Conclusion • Simple • No dependency • Optional persistence

    • Lightweight; 16MB docker image • Lack of official GUI