I’ve been thinking a lot recently about how I can build “organic software” that permits services to transparently join the network and leave again. I want to know when a service joins the network and for it to advertise itself. I want to know when a service leaves the network so its consumers can gracefully adapt. I want a service to browse the network for the services it requires. I don’t want worry about configuration.
I have a service that provides an MQTT broker. When the broker is ready it advertises itself on the network.
My client browses the network for an MQTT broker, when it finds one it connects to the broker and starts publishing messages. If the broker leaves the network it stops publishing. When the broker rejoins the network, it is again discovered, and the client resumes publishing again.
Take a look at my Gist.
Although my exploration has been limited I have found it to be simple and robust. As we shift our mindset from the monolithic deployment of software to one where we build, deploy, and scale processes independently I feel this offers some really interesting and exciting possibilities. This is especially true as we look more and more at how we bridge in to the physical world to build real time experiences that consume large amounts of data and tap in to sensor networks. The end solutions are broad, it can be digital marketing, gaming, home automation (or automation anything). I came across Pachube the other day, which folds in to this and opens the door to some really interesting possibilities.