Data Engineer Things

Things learned in our data engineering journey and ideas on data and engineering.

Follow publication

Real-Time Messaging with NATS on Kubernetes

Deploying NATS On Kubernetes

Pavan Kumar
Data Engineer Things
4 min readDec 20, 2024

--

With the rise of cloud-native applications and real-time communication requirements, reliable messaging systems are crucial for distributed architectures. NATS, an open-source, lightweight messaging system, is designed to deliver simple, high-performance messaging across cloud-native environments. In this article, we’ll explore how NATS works, why it’s useful, and how to deploy it using both Flux (GitOps) and Helm commands.

( Source = https://github.com/nats-io/nats-server/blob/main/logos/nats-horizontal-color.png )

TLDR: What’s the Story?

  1. Understand the working of NATS.
  2. Using Flux for GitOps-driven deployment
  3. Using Helm commands for manual deployment

The deployment includes clustering and JetStream for message persistence and durability.

Story Resources

  1. GitHub Link: https://github.com/pavan-kumar-99/medium-manifests
  2. GitHub Branch: nats

Understanding NATS

NATS is a high-performance messaging system ideal for cloud-native and microservice-based architectures. It supports:

  1. Publish-Subscribe (Pub-Sub): Real-time communication where multiple clients can subscribe to a topic.
  2. Clustering: Increases availability and load distribution.
  3. JetStream: Adds persistence, message replay, and advanced streaming capabilities.

Why NATS Stands Out

NATS solves this problem by providing a communication model based on many-to-many (M:N) connections right from the start. Unlike traditional systems that use hostnames or IP addresses for addressing, NATS relies on subjects to manage discovery and communication. This makes it highly scalable and adaptable to different needs. It can be deployed anywhere — whether on bare metal, in virtual machines, inside containers, on Kubernetes, or even on IoT devices.

Easy Connectivity and Scalability

NATS is built to handle real-time changes in network topology, so when backend systems are updated, clients don’t need to be reconfigured. This means there’s no need to reboot or…

--

--

Published in Data Engineer Things

Things learned in our data engineering journey and ideas on data and engineering.

Written by Pavan Kumar

Senior Cloud DevOps Engineer || CKA | CKS | CSA | CRO | AWS | ISTIO | AZURE | GCP | DEVOPS Linkedin: https://www.linkedin.com/in/pavanakumar18/

No responses yet

Write a response