Over a million developers have joined DZone.

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.

· IoT Zone

Access the survey results 'State of Industrial Internet Application Development' to learn about latest challenges, trends and opportunities with Industrial IoT, brought to you in partnership with GE Digital.

Earlier this year, John Lockwood (a Senior Software Engineer at Workiva) gave a great lightning talk about NATS at a Bay Area Python Meetup.  

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.

The IoT Zone is brought to you in partnership with GE Digital.  Discover how IoT developers are using Predix to disrupt traditional industrial development models.

iot examples,iot protocols,iot app development,iot hardware,raspberry pi,raspberry pi 2,microservices,python,golang

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}