Simple, Composable Microservices: An IoT Example Using Raspberry Pi 2 and NATS.io
A look at a talk at a Bay Area Python Meetup using NATS, a messaging system for IoT applications.
Join the DZone community and get the full member experience.Join For Free
The simple, lightweight nature of NATS makes getting up and running with it and doing something useful extremely easy, so as NATS Community Manager I am fortunate to get to speak with many developers connecting things with NATS. John's blog post expanding on his lightning talk was excellent.
For those unfamiliar, NATS is lightweight, secure, and highly performant messaging system for moden cloud native and IoT applications. He does a great job explaining why NATS is perfectly suited for messaging use cases such as microservices transport, or for IoT device communication.
While the NATS server is written in Golang, there is client library support for approximately a dozen languages. In John's example, he is using txnats (a NATS python client using Twisted, compatible with PyPy and CPython 2.7 and 3), Raspberry Pi2, Sense Hat, and NATS for the communication.
The example also does a great job bringing out some of the more nuanced but powerful aspects of NATS (important for building scalable microservices or IoT architecures), such as how it auto-prunes the interest graph of subscribers, and how simple the protocol is (text-based).
If you are interested in learning more about Secure IoT Messaging using NATS, John will be giving another talk later this month at a meetup.
Opinions expressed by DZone contributors are their own.