Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Open Source Messaging Software NATS Releases 2.0

Open Source Messaging Software NATS Releases 2.0

This item in japanese


Open source messaging software NATS 2.0 has been released and offers advanced security management, global disaster recovery, and improved performance at scale. NATS is a Cloud Native Computing Foundation (CNCF) incubating project that provides messaging services for cloud native systems, IoT messaging, and microservices. According to Synadia, the company that leads the development of NATS, the latest release aims to "meet the market need for an advanced communications system tailored for modern distributed systems".

NATS is a group of products that can be used to manage communication in distributed systems and is maintained by Synadia, which offers a communications system built on NATS. The messaging approach implemented in NATS is a publisher-subscriber model where clients connect to the system via a URL and subscribe or publish messages to subjects. NATS is a fire-and-forget messaging system guaranteeing at most once delivery. If no subscriber is available to receive a message, then the message is lost. NATS streaming provides configurable message persistence and can enable at least once message delivery via message acknowledgements.

Pub-Sub Messaging with NATS

The 2.0 release of NATS is the largest feature release since the launch of the original code base and targets the challenges of distributed messaging at scale. According to the NATS team, the goals of the latest release are to reduce the total cost of ownership and maintenance, improve isolation in order to reduce operational costs, provide simple disaster recovery, and decentralize security management. The primary new features in NATS 2.0 are accounts, global deployments, and decentralized security.

Accounts enable secure, isolated communication contexts. When a client connects, it specifies an account or defaults to a global account. Data is shared between accounts based on user defined access limitations so that accounts only access the subjects and data they need. Accounts share data via services or streams. Services work like endpoints to enable access to an account. A service can be exported to allow other accounts to import it. Importing a service permits requests to be sent to the importing account. Streams create continuous data flow between accounts and are exported to permit egress and imported to permit ingress.

NATS global deployments enable global topologies with the concept of superclusters, which function like clusters of NATS clusters across regions. When routing clients, local clients are preferred, then round-trip delay time (RTT) is used to find the lowest latency NATS cluster in the supercluster. Traffic is automatically routed between regional clusters in cases of service disruption, enabling disaster recovery without additional configuration. Spoke and hub topologies are also possible with leaf nodes, which transparently and securely bridge specific local data to a wider NATS deployment and can be used for edge computing or IoT applications.

Security in NATS 2.0 is managed via operators, accounts, and users. Operators define the root trust in the system while accounts limit and expose services and streams. Users have specific credentials and permissions for accessing accounts.

Written in Go, NATS provides clients for several languages including C, Java, Elixir, Node.js, and Ruby. Similar products include RabbitMQ, Kafka, and ActiveMQ. Additional information on installing and running NATS is available in the NATS documentation.

Rate this Article