NATS: You Need it Now!

submited by
Style Pass
2022-09-22 19:30:13

If you are running Kubernetes, or really any kind of microservice architecture, you will eventually run into challenges with communication and synchronization between your instances. To solve this, I recommend deploying an instance of NATS as part of your initial infrastructure setup. NATS is great because:

NATS is a light-weight, easy to deploy service that provides pub-sub functionality with very little fuss. It is a tiny application, written in Go, that listens on a port for connections from clients.

The NATS executable is a few MB in size and runs out of the box with sensible defaults. It has no dependencies or required configuration parameters. As a Kubernetes service, it can be deployed very easily with this yaml. With that simple deployment, your microservices can use NATS by connecting to nats://nats:4222.

Clients can send and receive messages to each other by publishing and subscribing to subjects. For example, two clients could be subscribed to subject x. If any client publishes a message to subject x, all subscribed clients will receive that message.

Leave a Comment