The Internet of Things (IoT) is no foreign topic to CIOs, IT professionals and developers in the software world. According to Statista, there is an estimated 38.6 billion connected devices by 2025.
In our experience analyzing, consulting and building IoT infrastructure, we’ve uncovered a few things that contribute to a more successful product that saves time, costs and support headaches. Here are four strategies companies should implement to ensure that their IoT systems are sustainable and effective, work seamlessly, and create an ROI.
Combine Teams Early and Often
There are several components of an IoT system, and each requires a different set of skills and teams. These teams are often divided into three buckets—software, hardware and product—and each usually works in its own way. For example, it’s common for a software team to work in an agile environment, but less so for a hardware team. To have a successful product, it’s important that all three teams work together from planning through testing and execution.
If the three teams are not on the same page from the beginning, features that one team must implement that depend on features from another team can become difficult, have suboptimal solutions or be impossible to execute. In order to avoid this, each team must be mindful of the other team’s process and constraints. The project needs strong technical leadership that understands how teams can successfully work together to build an efficient product.
Push, Don’t Pull
Connected devices have less computational power than servers, so it’s often easier to move most logic off the connected devices and onto the server. This approach comes with a challenge, though: it’s costly to get information out of a connected device, and that cost increases significantly with more connected devices. For example, if we want to find out how a value on a connected device changes over time, we could have the server poll the connected device at a certain interval.
However, if the value has not changed, we’ve wasted precious CPU cycles and network bandwidth. These wasted resources add up to a significant amount as the number of devices increases. One way to solve this is to move some of the logic onto the connected device to free up considerable resources at the point at which they are the most constrained. This increases the speed of the overall system without bogging it down with needless operations.
Design a System With the Concept of Eventual Consistency
The most expensive transaction in an IoT system is a round-trip request from the user to the connected device. For that reason, it’s important to minimize the number of round-trip requests. When controlling a connected device from a mobile application, this is unavoidable. However, if the connected device is set up to send values continuously to the server, a mobile client could read those values from the server instead of making a roundtrip to the connected device. A good approach is to keep the last known state of the connected device in a database. When client applications need to display values from a connected device, they are read from the database instead.
While this process might not serve up the most updated values, the system is designed to eventually get the most accurate information. In many scenarios, values change infrequently enough that approximate data is good enough and eventually will become accurate anyway. Likewise, for values that can change during the amount of time it takes to retrieve them, you will never receive real-time readings. One way to reduce this burden from the system involves catching device data on the server and defaulting the reading from that cache. When implemented, this strategy can reduce the amount of data that needs to be transmitted, which speeds up the system and minimizes data cost.
Plan for Dealing With System Pressure from the Very Beginning
In a distributed system, there will always be failures and downtime. When systems are interdependent and one part goes down, work can start to queue up, and it can either take a long time to be processed or become so taxing on the system that it will never be processed. Usually, when the system recognizes it’s struggling, each component will halt operations. This typically means batching operations altogether and waiting to emit those combined operations once the system has stabilized.
If a catastrophic event occurs that affects thousands of devices at once, mass reconnections add severe loads to the system. These loads can be so severe that it can take down the entire system again, creating a scenario from which it is impossible to recover. To avoid this situation, connected devices need to limit their aggression when reconnecting. The accepted best practice is to program connected devices to use a randomized exponential backoff strategy. When a device loses its connection to the server, it waits a random period of time before reconnecting. If it still cannot reconnect, the device continuously increases the amount of time it waits before trying again. This gives the system time to recover and avoid a catastrophic failure.
IoT systems are built to minimize the cost to control a device and also give the user increased visibility into the way it operates so he or she can take appropriate action. By applying each of these techniques, IoT systems have exponential power and opportunity to transform how your business operates, how you communicate with clients and how well these components work together.