A Tour of Apcera NATS: A Simple, High-Performance Messaging System
Setting up complicated messaging systems for service communications can be something of a challenge. Apcera‘s NATS open source messaging platform was designed to address this complexity. “The core principle behind that is around simplicity and performance. NATS is incredibly simple. It uses a plain text protocol, which is always available. Your systems are ready to communicate with each other, regardless of scale,” said Brian Flannery, community and ecosystems manager at Apcera.
In the short demonstration embedded below, Flannery is joined by Waldemar Quevedo Salinas, Apcera senior software developer as The New Stack founder Alex Williams joins the duo for a demonstration of NATS live from the DockerCon 2016 event floor. Salinas offers a step-by-step tutorial of some of NATS‘s most powerful features, including NATS’ unique approach to traditional pub/sub model.
As Salinas spun up some basic clients, he explained that NATS uses a plain-text, basic publish and subscribe model for its messaging system. Salinas noted that NATS internal architecture has simplified a lot of the glue-work that was traditionally required by developers when setting up a messaging system.
“By using the NATS-based architecture, you can scan to have at least an established connection, meaning you don’t have to worry about creating open sockets, estimating connections to the server, or sending payloads. You also don’t have to worry about how you’re wrapping all of that stuff, or garbage collection. With NATS, you are only focusing on send and response, that’s it,” he said.
Salinas went on to build a simple architecture utilizing docker-compose, creating tasks which he was able to view traffic on in real-time. The workers were able to receive requests from the end-point server, having been configured to expect the same response. After scheduling a task, Salinas then requested trace logs from the server — which were returned in eight milliseconds.
After spinning up a new Docker container containing a monitoring tool, Salinas polled the server to get a view of the current clients running. Through once again harnessing the docker-compose tool, Salinas was then able to quickly scale out the clients. It is this flexibility, in not assuming what one’s architecture looks like, nor how a system should communicate, which Apcera has brought to the table with NATS.
“Other messaging protocols make assumptions in regards to what your system architecture should look like. NATS is there to handle pub/sub and to always be available. That’s a big difference, is the flexibility,” Flannery finished.
Apcera is a sponsor of The New Stack.