Business Logic for IoT Sensors
Suppose that you run a chain of retail stores and you want to know how many customers are passing by a particular product every day. To do so, you might decide to measure the number of people who visit the aisle in which the product is stocked.
Using a traditional security camera would require you to review hours and hours of surveillance footage, creating a manual (and error-prone) count of the customers in that aisle. Fortunately, IoT infrared sensors for motion detection can make this task dramatically easier and more automated.
Whenever it detects motion, an IoT sensor can send information about the current time and location. This raw data then needs to be cleaned up, collated, and analyzed in order to become human-readable and useful.
In most use cases, this sort of computation should be performed in the cloud, and not on the edge computer. The role of the edge device should only be to pass the sensor data along to the cloud in a secure manner, as well as making any time-sensitive decisions. (For example, if a sensor detects motion when the store is supposed to be closed, it might be advisable to alert the manager and store owner.)
Here at Very, we worked with one of our clients to build the world’s first self-serve beer kiosk powered by facial recognition technology. Of course, computation-heavy tasks such as the facial recognition itself need to be performed in the cloud.
However, the edge computer also needs to control the machine’s tap locally and in real-time. This allows the machine to cut off the beer when customers pour too much or have too little money in their account. In addition, local control of the tap enables the machine to be easily shut down for maintenance when necessary.
As Dumb As Possible, But No Dumber
Your IoT edge devices should be kept at the right degree of complexity: as simple as possible, yet also with the proper functionality they need to do their jobs.
The benefits of “keeping the edges dumb” in IoT include:
- Higher performance: IoT edge devices are fairly small and can’t match the virtually unlimited compute power of the cloud.
- Better security: Having physical access to an edge device may put your IoT data at risk; in most cases, your information is more secure in the cloud, where data centers are kept under lock and key. If sensitive or confidential data is passing through the edge device, then encryption is highly recommended when transmitting it to the cloud.
- Lower costs: Keeping your edge lightweight allows you to use cheaper hardware, which saves on the total cost of the IoT project.
- Easier debugging: Cloud services typically have rich error reporting features that help you determine when things go wrong. If you put complicated business logic on the edge, however, it can be harder to detect and diagnose failures.
Considering the Tradeoffs in IoT Architecture
Throughout an IoT development project, you’ll have to make the tradeoff between performance and network latency. Pushing all the computation into the cloud is much faster and gives you more control, but it also comes at the cost of higher delays in communication.
Deciding which business logic should run in the cloud, and which needs to be moved down to the edge is therefore a highly important question. If you need help, speak with a qualified and knowledgeable IoT development firm.
Want more information about how the IoT development process works from start to finish? Check out our totally free complete guide to IoT development.