33,59 €
With the rising demand for and recent enhancements in IoT, a developer with sound knowledge of IoT is the need of the hour. This book will help you design, build, and operate large-scale E2E IoT solutions to transform your business and products, increase revenue, and reduce operational costs.
Starting with an overview of how IoT technologies can help you solve your business problems, this book will be a useful guide to helping you implement end-to-end IoT solution architecture. You'll learn to select IoT devices; real-time operating systems; IoT Edge covering Edge location, software, and hardware; and the best IoT connectivity for your IoT solution. As you progress, you'll work with IoT device management, IoT data analytics, IoT platforms, and put these components to work as part of your IoT solution. You'll also be able to build IoT backend cloud from scratch by leveraging the modern app architecture paradigms and cloud-native technologies such as containers and microservices. Finally, you'll discover best practices for different operational excellence pillars, including high availability, resiliency, reliability, security, cost optimization, and high performance, which should be applied for large-scale production-grade IoT solutions.
By the end of this IoT book, you'll be confident in designing, building, and operating IoT solutions.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 655
Veröffentlichungsjahr: 2022
A comprehensive and practical guide to implementing end-to-end IoT solutions
Mohamed Abdelaziz
BIRMINGHAM—MUMBAI
Designing Production-Grade and Large-Scale IoT Solutions
Copyright © 2022 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Rahul Nair
Publishing Product Manager: Rahul Nair
Senior Editor: Sangeeta Purkayastha
Content Development Editor: Rafiaa Khan
Technical Editor: Shruthi Shetty
Copy Editor: Safis Editing
Project Coordinator: Shagun Saini
Proofreader: Safis Editing
Indexer: Tejal Daruwale Soni
Production Designer: Jyoti Chauhan
Marketing Coordinator: Nimisha Dua and Sanjana Gupta
First published: May 2022
Production reference: 1170522
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-83882-925-4
www.packt.com
First and foremost, all thanks to God for helping me complete this book; then thanks to my wonderful wife, Shaimaa; my lovely daughter, Somia; my amazing sons, Omar and Zeyad; and the rest of my big family for supporting and encouraging me in writing this book, especially during the tough time we and the rest of the world have had due to the COVID-19 global pandemic.
– Mohamed Abdelaziz
Mohamed Abdelaziz is a technology leader, IoT subject matter expert, cloud expert, and architect with more than 17 years of experience in IT and telecoms. He has designed and delivered many large-scale, production-grade, multi-million-dollar pieces of software and cloud-based solutions that cover both traditional IT and IoT solutions that are used by millions of users across the globe. Mohamed holds a degree in computer science and information systems, and he has gained multiple credentials in AWS (eight certificates) and Azure (five certificates – including the Azure IoT Developer certificate). Mohamed is an advocate of cloud computing, IoT, app modernization, containerization, and the architecture and design of large-scale distributed systems.
Balaji is a Microsoft Azure IoT Specialty-certified IoT engineer and he holds a bachelor's in electronics and communications engineering. He has a significant amount of experience in the end-to-end processes of both the hardware and software sections of IoT. His area of expertise is in consumer electronics and automation. Quite recently, he expanded his horizons by stepping into Industry 4.0. He is currently exploring PLC, SCADA, and cybersecurity for OT in his free time. His areas of interest include but are not limited to low-power devices, data analytics, and ML on edge. When not tinkering with development boards, you can find him reading the New York Times bestseller of the month.
I would like to thank Packt Publishing for providing me with the opportunity to review this excellent book. I would also like to extend my gratitude to my mom and my friends who have stood beside me always.
Luca Palermo is an IoT practice lead and holds a BSc in computer science and an MSc in internetworking. Luca's career spans over 12 years in technology, including communication protocol design, solution architecture, and teaching at universities. Currently, he is employed with a system integrator, where he leads the designing and building of the largest Australian IoT platform. Luca is passionate about technology, in particular wireless networks, software design, and blockchain.
I would like to thank my wife, Giulia, for her continued support and encouragement with everything that I do, and my daughter, Sofia, for the unconditional love and joy she gives me every day.
Yatish Patil is an author and an Azure IoT analytics technology expert with a passion for building IoT solutions using Microsoft Azure. He works with enterprise customers, enabling them to identify and cultivate IoT analytics opportunities through technology innovation. His focus is on helping businesses accelerate their growth by using the cloud, mobility, and analytics with IoT, in which his career spans over 16 years.
He leads IoT practice and is actively involved in technology consulting and solutioning for customers, defining technology road maps, best practices, and processes for delivering on and achieving business objectives, consulting, and architectural aspects of end-to-end solutioning.
I'd like to thank my wife, Vasudha, and our children, Rudra and Rugved, for their daily support and patience. I'd also like to thank the Packt team for continuously giving me opportunities to review and write content on technology, which encourages me to continuously learn more and more and build a community through which we can learn as users. Also, to my friends, who encourage me in doing this stuff and appreciate and helpelp me from time to time on this exciting technology journey.
Without any doubt, we are living in a true digital era, and the future will be even more digitalized. The keyword when we consider what it means to be truly digitalized is being connected. Many organizations and business enterprises are striving to make their products and solutions fully connected, with a view to gain more insights and operate their products both efficiently and remotely. The end goal is to increase their revenue, reduce operational costs, and increase customer satisfaction.
Internet of Things, or IoT for short, plays a vital role in connecting the physical products around us that we never imagined could be connected. Therefore, understanding IoT technologies and how they can solve different business problems, and having an understanding of how these technologies work is a must-have skill for any IT or software professional, both in our current era, and in the future as well.
People typically approach IoT technologies in one of following two ways - as a hobby, or as a profession. A hobbyist will typically use and play with IoT technologies to solve small problems they might have in their smart home, or in their office. They might purchase personal devices or microcontrollers such as Arduino or Raspberry Pi, along with some sensors. Then, using Wi-Fi connectivity and little or no code, they can program their devices to automate processes in their smart home and beyond.
Approaching IoT from a professional point of view is somewhat different, as IoT professionals (such as IoT solution architects, designers, or engineers) work in companies or enterprises that design and build large IoT solutions and products. Some examples of this could be smart cities, smart agriculture, connected vehicles, and so many other large IoT solutions that are available across thousands of different industries and business segments.
I wrote this book for IoT professionals who want to design and build large scale IoT solutions. I have worked in the IoT field for a long time now, so in this book, I'm sharing a wealth of practical experience in designing and building large IoT solutions.
There are three sections in this book. The first section covers the basics, or the foundations, of IoT, which is what I like to call the anatomy of IoT – for example, we will explore the meaning of the letters I and T in IoT.
The second section covers the IoT backend layer, or what I would call the IoT solution backbone. This is where we'll learn about the different software solutions and components that are used in that layer.
The final section covers the different IoT modern application architecture paradigms that are commonly used in almost all IoT solution layers. We'll also cover the IoT solution operational excellence pillars, which include IoT monitoring, security, resiliency, and availability.
In this book, I tried to cover a wide range of IoT topics, such as IoT connectivity, IoT device management, IoT analytics, IoT platforms, IoT applications, and many more. Our approach will be to first explain the concepts behind each topic, then show the different implementation options that you as an IoT solution architect or designer might come across during the IoT project designing and building phase. Finally, I have added my own design or architecture views, which is based on my practical experience and the technical pragmatic approach that is typically used in designing and building such large scale IoT solutions.
The book targets E2E solution architects, systems and technical architects, and IOT developers who are looking to design, build, and operate E2E IoT applications and solutions. The book is not for beginners; however, some details and concepts will be provided in the book – where applicable – in certain sections/chapters.
Chapter 1, Introduction to the IoT – The Big Picture, gives an introduction to IoT and answers – in detail – three common questions about IoT (What? Why? How?).
Chapter 2, The "I" in IoT – IoT Connectivity, covers IoT connectivity in detail to help you understand and select the best IoT connectivity option for an IoT solution.
Chapter 3, The "T" in IoT – Devices and Edge, covers the hardware and software (Real-Time Operating System (RTOS)) aspects of IoT devices (microcontrollers) and IoT Edge devices.
Chapter 4, Diving Deep into the IoT Backend (The IoT Cloud), covers the IoT backend layer or the IoT cloud that is considered the backbone of any large-scale IoT solution. This chapter covers only the infrastructure part of the IoT backend layer by explaining the different options (that is, public versus private cloud, containers versus VMs, and so on) that can be used for hosting the IoT backend layer.
Chapter 5, Exploring IoT Platforms, covers the second part of the IoT backend layer, which is the software part. The chapter explains what is meant by an IoT platform, how to select the best IoT platform for an IoT solution, whether to build or buy an IoT platform, and the typical software components that should be provided by the IoT backend layer.
Chapter 6, Understanding IoT Device Management, covers the IoT device management capability in detail. The chapter explains the different IoT device management protocols commonly and widely used in the IoT domain, how to select an IoT device management solution, the typical features of IoT device management solutions, and how those features work and serve some business requirements of the IoT solution.
Chapter 7, In the End, It Is All about Data, Isn't It?, covers IoT data analytics in detail and how to design and build an IoT data analytics solution to gain the most desirable and valuable business insights out of the collected IoT data and other data from other data sources.
Chapter 8, IoT Application Architecture Paradigms, focuses on explaining new and modern application architecture paradigms such as cloud-native design concepts and the famous Twelve-Factor App methodology, microservice architecture, API gateways, service meshes, and other applications and architecture paradigms that can help you design and build (or customize) a robust IoT backend layer for a large-scale IoT solution.
Chapter 9, Operational Excellence Pillars for Production-Grade IoT Solutions, covers the pillars of IoT solution operational excellence. It covers pillars and aspects such as security, high availability, resiliency, monitoring, automation, and DevOps.
Chapter 10, Wrapping Up and Final Thoughts, summarizes what has been explained in the book by walking through an IoT industrial solution reference architecture and explaining its layers in detail. It also covers the future of IoT and the emerging cutting-edge technologies that will shape that future.
Basic knowledge of cloud computing and distributed system design will help you to get the most out of this book.
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781838829254_ColorImages.pdf.
There are a number of text conventions used throughout this book.
Code in text: Indicates code words in the text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "To configure the host side of the network, you need the tunctl command from the User Mode Linux (UML) project."
A block of code is set as follows:
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
printf ("Hello, world!\n");
return 0;
}
Any command-line input or output is written as follows:
$ sudo tunctl -u $(whoami) -t tap0
Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Click Flash from Etcher to write the image."
Tips or Important Notes
Appear like this.
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Once you've read Designing Production-Grade and Large-Scale IoT Solutions, we'd love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.
Your review is important to us and the tech community and will help us make sure we're delivering excellent quality content.
The objective of Section 1 is to help you deeply understand the fundamentals of IoT. In other words, deeply understand what the I and T mean in IoT.
This part of the book comprises the following chapters:
Chapter 1, Introduction to the IoT – The Big PictureChapter 2, The "I" in IoT – IoT ConnectivityChapter 3, The "T" in IoT – Devices and EdgeIn this chapter, we will start our journey of exploring the Internet of Things, or IoT, by introducing a number of topics, such as the purpose of any technology and the purpose of IoT technologies. We will then cover the three common questions (what, why, and how?) asked in relation to any technology, including IoT technology. We will cover what the IoT is, why the IoT matters, the impact of the IoT on different industries and segments, and finally, how IoT technology works. In other words, we will explain the IoT production-grade solution reference architecture and its solution building blocks.
The chapter will also cover some of the IoT solution design patterns commonly used in any IoT solution and will show a case study of a business problem and how IoT technologies can solve that business problem and deliver the desired business benefits and outcomes.
In this chapter, we will cover the following topics:
The purpose of any technology (including IoT technology)IoT definition – the whatIoT impact and benefits in different industries – the whyIoT solution reference and architecture – the howIoT solution design patternsA case studyThe book's strategyTechnology exists, and will keep evolving, to help achieve desired business outcomes. This is the ultimate fact. Business owners and investors always look for the following business outcomes when they run a company or invest in any business domain:
Increased business sales, revenue, company value, the number of customers, and profits. In other words, an increase in the value of business growth with respect to the different business metrics we have just mentioned.Reduced business operational costs, which means the cost of running and operating the business must not exceed the value of the business profits by any means. Otherwise, the business is not considered profitable.The mitigation of different business risks such as new market disruptions and innovations, more competition, falling brand reputation (including an increase in the number of unhappy customers, extra product failures, negative social media feedback, and other factors affecting business brands), security risks, fraud risks, and operational risks (lack of automation, speed, and employee skills).These are three common, well-known business outcomes every organization or business aims to achieve. There may be more, but this book does not cover economy or business theories.
Based on those aforementioned outcomes, it is clear now that no one will buy technology just to play with it; rather, they will buy technology that can help them achieve their desired business outcomes, or, in other words, they will buy technology that solves their business problems.
If you have been in business for the last few years, I am sure you've heard the term Digital Transformation a lot. Every organization nowadays is talking about its steps and strategies to transform its existing business into a digital-first business, especially after seeing the massive growth and business disruption of many large, digital, hyperscale companies such as Amazon, Facebook, and other tech companies that were born in the digital era, including Uber, Airbnb, and a host of other successful start-ups.
"Digital transformation marks a radical rethinking of how an organization uses technology, people, and processes to fundamentally change business performance", says George Westerman, MIT principal research scientist and the author of Leading Digital: Turning Technology into Business Transformation.
Many IT and tech companies offer business enterprises and organizations a complete, rich portfolio of services, solutions, and technologies that they provide to assess such enterprises in their digital transformation journey toward becoming digital-first.
Since this book is about technology (not people or processes), the question might be, how will technology help such a great digital transformation initiative? Or, in other words, what are the digital transformation technology enablers that each enterprise could use on such an exciting transformation journey? You might even ask why we are talking about business outcomes and digital transformation when this book is all about the IoT.
Regarding the last question, it is a valid one, and we will answer it soon. One thing to mention here is that we have decided to share with you the practical, or what is called applied, IoT experience that we have gained from being in the IoT field for many years. This experience stemmed from designing, delivering, and operating many large-scale and production-grade IoT solutions for many large enterprises around the globe:
Now, back to the question of what are the key technology enablers and solutions for enterprise digital transformation programs? And to answer this, let's look at the technologies and architecture paradigms that are considered key enablers for digital transformation:
Figure 1.1 – Digital transformation – key technology enablers
Let's explain these key technology enablers in more detail.
Transforming existing enterprise systems and IT workloads into new and modern cloud-native solutions is a key enabler in the digital transformation journey.
There are many different views on the definition of cloud-native, especially when it is compared with other terms and trends such as cloud-readiness and cloud-enabled. We will cover this in more detail later in the book. However, for now, we will stick to the official definition of cloud-native as per the Cloud Native Computing Foundation (CNCF):
Cloud-native technologies empower organizations to build and run scalable applications in modern, dynamic environments such as public, private, and hybrid clouds. Containers, service meshes, microservices, immutable infrastructure, and declarative APIs exemplify this approach.
The benefits of transforming organization workloads into cloud-native workloads are as follows:
Releasing software fast so that it can hit the market quickly with new featuresReducing costs, and leveraging the cloud and different pricing models, for example, pay as you go or paying for what you consumeIncreasing the scalability, reliability, and availability of enterprise applications and solutionsAvoiding vendor lock-in – in other words, increasing application and solution portabilityThere are many benefits of migrating and moving enterprise IT workloads and systems to the cloud (especially public clouds). We'll mention a few here:
Operational benefits, operational excellence, and operational efficiency: Efficiency means you get more for less. In the public cloud model, the monitoring and support of application workloads become much more effective and manageable. Public cloud providers offer lots of automation tools, different support, and monitoring services to help enterprise operation teams.Financial benefits and cost reduction: The move from the CapEx (Capital Expenditure) model to OpEx (Operating Expenses), or the pay-as-you-go model, helps you pay for what you use. With this model, by reducing the total cost of ownership (TCO), you don't need to worry about data center facilities, ongoing hardware maintenance costs, and support to maintain the required reliability and availability of your IT and system workloads; the cloud provider will take care of such things.Faster innovation or shorter time to hit the market: Leveraging different cloud offerings, such as IaaS, PaaS, and/or SaaS, that enable the enterprise to try and build a proof of concept (POC) of any new ideas very quickly without worrying about buying hardware, software, platforms, and so on.Manage business growth and regulations effectively and smoothly: Most key public cloud providers offer a large set of regions and data centers across the globe. In a couple of minutes or less, you could deploy your workload in any region or geography around the globe if you have business needs in a particular region or have to observe local regulations or compliance requirements, such as data not leaving the country where the business is operating.Traditional analytics and business intelligence technologies and tools have long been used in enterprises and organizations of different sizes. However, the amount, velocity, and different varieties of data generated by business IT (information technology) and business OT (operational technology) systems change the way data and business analytic solutions work. Now, we are talking about big data technologies and real-time or near-real-time data analytics solutions versus historical data analytics.
Artificial Intelligence (AI) and Machine Learning (ML) play a vital role in the digital transformation journey as enterprises in different business segments use different AI and ML models and solutions, including predictive maintenance, product recommendations, personalized marketing and promotions, chatbots, drag discovery, fraud detection, radiology image recognition, video analytics, content commissioning, content creation, auto-subtitling, sentiment analysis, self-driving cars, and many other interesting business cases and solutions besides.
Creating a powerful customer digital experience requires the availability and utilization of a rich set of modern applications and architecture paradigms. For example, in modern apps, the de facto architecture paradigms commonly used nowadays are microservice and two-tier architecture versus the traditional three-tier architecture. When it comes to compute, modern solutions and architecture paradigms will include things such as Serverless Event-Driven Compute (for example, AWS Lambda, Azure, and Google Functions), Containers (for example, Docker), and Container Orchestration (for example, Kubernetes).
When it comes to Middleware and Integration, modern solutions and architecture paradigms will include things such as API Gateway, GraphQL, Service Mesh, Pub-Sub Architecture (queues and Service Bus), and Event Streaming (Kafka). When it comes to Databases, it is not just a question of traditional, well-known relational databases or Relational Database Management Systems (RDBMSs); other database types have emerged recently, including NoSQL, object storage, graph databases, and in-memory databases. When it comes to Mobile Apps and Web Apps, modern frameworks such as React Native, Angular, Vue, and many other frameworks and technologies besides will be used to build such amazing modern customer or consumer apps.
IoT is a key technology enabler for digital transformation. In fact, IoT is the most important technology enabler for the digital transformation process as it is also a key enabler for some other key technology enablers, such as big data and advanced analytics, AI, and machine learning. How? Simply put, such technology enablers depend heavily on collected data and insights from the different data sources of a running business. IoT is one such enterprise or business operational data source.
In the next few sections, we will discuss the different aspects of IoT, in other words, we will discuss the what, why, and how of IoT solutions and technologies.
James Phillips, corporate vice president of Microsoft's Business Applications group, said the following;
It all starts with data; data is coming out of everything. If you can harness that data, make intelligence out of it, and use it to improve your business processes, you're in a position to transform your company and industry.
Have you heard about the Observe, Orient, Decide, Act (OODA) cycle that has been developed by a military strategist and United States Air Force Colonel, John Boyd? As the name suggests, it is a decision-making process based on a loop or series of steps or tasks. It all starts by observing or monitoring the target by collecting data from multiple sources, and then doing orientation by filtering, analyzing, and enriching the collected raw data. Next comes deciding, based on the insights collected and what actions need to be taken, and then finally executing such actions and assessing whether the decision taken was right or wrong. Such a loop continues endlessly.
Enterprises get insights from customer interactions, sales, and connected products to improve the quality of their products, find untouched revenue streams, increase customer satisfaction and retention, and improve the whole business process and operations.
As we can see, there is a strong relationship between IoT and data, so let's dive further into that relationship to understand IoT better.
Imagine converting any physical thing around you into a smart connected thing and getting insights from that physical thing remotely. This would be awesome, wouldn't it?
How can I convert a physical thing into a smart thing, you may ask? The answer is by using IoT technologies and different IoT ecosystems, such as sensors/actuators, microcontrollers, connectivity, and IoT platforms.
Still not clear? Let's take an example. Suppose you run a waste disposal company. The trucks of the company currently travel once a week to different residential areas in the city. After a while, and based on some insights and data analytics, you realize that on some days, the trucks return almost empty as there is not much waste to be collected on those days. That is a business problem as you could save money on the fuel used and employee wages for those days, you could help to save the environment by reducing air pollution and toxic emissions, and so on.
To solve that problem, you need the waste bin to somehow talk to you or notify you whether it is full, halfway there, or empty. Interesting. So how can we do that? We could install in each waste bin a small low-power, constrained IoT device (or a microcontroller in short) equipped with an ultrasonic sensor (such as ultrasonic thru-beam sensors) to detect the level of waste inside the waste bin. You could have another sensor to detect how many times the bin lid has been opened. The microcontroller could have a radio communication module for short-range connectivity options such as Wi-Fi Bluetooth Low Energy or Zigbee, or long-range connectivity options such as cellular (mobile) network connectivity to provide internet or network connectivity to the microcontroller to send the sensor insights or data to the IoT Cloud backend.
Once you have the data in the IoT Cloud, then it becomes just another software or data analytics solution to get insights and act accordingly. Similarly, you could simply convert anything into a smart thing.
The concept of converting any physical thing into an internet-connected thing is really disruptive and has a big impact on the current internet infrastructure. Currently, there are billions of devices already connected to the internet, including laptops, mobiles, tablets, PCs, and other smart connected products, but with such a concept, we have to deal with massive growth in the number of devices connected to the internet network. In a single smart home, for example, you could have 100 devices or more connected to the internet.
The options in terms of dealing with such a massive number of internet-connected devices are either to extend the existing internet infrastructure or to have a dedicated IoT.
Definition of IoT as per Gartner
The IoT is a network of physical objects that contain embedded technology to communicate and sense or interact with their internal states or the external environment.
Now that we have an idea of what the IoT is, let's move on to its impact on different industries.
Over the course of history, there have been different industrial revolutions that occurred in different eras. The first industrial revolution that occurred between the years 1760 and 1840 introduced machine power to replace hand power. At that time, this represented a significant achievement that disrupted and changed many industries, including mining, the iron industry, and agriculture.
Then, between the years 1871 and 1914, the second industrial revolution was enabled and powered by one of the greatest inventions and discoveries of humankind – electricity. Electricity fundamentally changed and disrupted different industries at that time.
In the late 20th century, the third industrial revolution was powered and enabled by the great invention of the computer. Computer systems and networking paved the way for the next and most recent industrial revolution, aka Industry 4.0.
The fourth industrial revolution (Industry 4.0) includes many technology enablers, such as IoT, cloud computing, automation, AI, ML, analytics, and cybersecurity, for disrupting a variety of industries and manufacturing processes.
IoT plays a critical role in shaping Industry 4.0 and impacts and disrupts any current industry and business. Let's learn how!
With IoT technologies, different consumer products and services are not only classified as connected products, but they move to the next level of a business model where the following features can be easily introduced and bring great business value:
New billing and revenue models: Think about smart bulbs, for example. What about buying smart bulbs on a monthly-based subscription instead of the current traditional model (that is, it is yours for just a one-off payment). In that new model, the consumer will not worry about ongoing maintenance issues with smart bulbs in their home as they will pay the monthly subscription to the smart bulb company, which will cover everything, including installation and ongoing post-installation maintenance. In other words, you rent the bulbs in your home instead of owning them. This new model enables and introduces IoT technologies, such as asset monitoring IoT solutions.Increased quality of products and services: A smart factory typically collects massive amounts of operational data that is generated by its connected devices, and also from the environment where those devices are deployed and operate. This helps the factory to undertake proper analytics on such massive amounts of data and introduce new features to the company's connected products or even predict failures in the connected products and act proactively in fixing those expected failures. This could be done by running predictive maintenance machine learning algorithms in the cloud based on the data collected by IoT sensors.Increased business agility and resource optimization: With IoT, companies or factory staff can run and maintain a company's connected products and services remotely using what is called a remote asset management solution. We saw during the COVID-19 pandemic in the year 2020 how companies that use IoT technologies in their products and services managed to survive and ensure business continuity during that difficult time. Also, with the concept of digital twins, workforce safety increased as staff no longer have to face some hazardous challenges during the manufacturing process.Many challenges, such as connectivity issues, asset tracking and monitoring, safety, and security emanated from remote locations such as refineries and oil fields. Those challenges are addressed by leveraging IoT technologies such as IoT device management, IoT connectivity, edge computing, ML, and Analytics @EDGE.
Also, on the consumer side of things, IoT helps a lot in saving energy. Think about smart lights that detect a person's movement in a room and switch on only if there are people in the room. They can also detect brightness levels – whether it is daytime or during the night, and act accordingly. Other examples that employ the same idea are air conditioning systems and heaters. These kinds of solutions save lots of energy resources and reduce consumers' bills as well.
In the utilities sector, things such as smart meters are the first requirement for many utility companies.
The IoT fundamentally impacts and disrupts the transportation industry. IoT technologies play a critical role in the following services and features in that industry:
Connected vehicles.Autonomous vehicles and self-driving.Fleet management.Increased safety and security.Increased efficiency.Onboard entertainment.And many other interesting features and services besides. Recently, as a response to the COVID-19 pandemic, we have started to see trains and buses being equipped with multiple additional sensors to help train and bus companies enforce social distancing and other health-related rules that were put in place to help fight the pandemic.The IoT fundamentally impacts and disrupts this industry. IoT technologies play a critical role in the following services and features of the industry:
Wearable patient devices to remotely monitor blood pressure, heart rate, and many other biometrics. This helps in tracking the health status of old and lonely people to act immediately in the case of an emergency.Doctors can now diagnose their patients remotely as they get all the data that they need to collect from their patients through attached IoT devices or sensors. With the introduction of 5G (a super low-latency connectivity option), it will become possible to perform remote surgery, which will help save lots of lives in remote areas.Different hospital equipment can be tracked and monitored by IoT using IoT asset tracking solutions.Have you heard about the interesting "Amazon Go" stores that have no staff working in them? Consumers just pop into the store and buy whatever they want and when they leave the store, payment is taken automatically? Interesting, isn't it? IoT and other modern technologies are behind those types of smart stores.
In retail, the IoT supports many use cases, such as the following:
Real-time inventory managementPersonalizationSafety and security, that is, video analyticsCost savings and operational efficienciesAnd so many other interesting features and servicesThe IoT supports many use cases in the sport and leisure center domain, such as the following:
Real-time trackingImproved safety with video analyticsInteractive fan engagementIoT technologies introduce many benefits to the agriculture and farming sector, such as the following:
Livestock and crop tracking.Improved crop quality and increased volumes.Increased farming process efficiency. Think about smart irrigation and how much water the farmer could save if they manage to detect soil moisture and see whether crops require watering. Also, in a smart irrigation solution, you could get input about the weather status and whether it will rain, so you could save even more water on this basis.One of the interesting use cases in that sector was a case of a farmer complaining about an increase in the newborn cattle death rate (this is the business problem) that occurred because the farmer did not know exactly when cattle would give birth. During labor, human intervention may be required to help female cattle should a problem arise.
So, how could IoT solve that business problem? With a very tiny microcontroller equipped with a vibration sensor and a cellular communication module attached to the tail of the pregnant cattle, at a specific vibration rate (this specific rate indicates that the cattle is giving birth), a video call will be triggered with the farmer and the latter can watch the whole process from their home and intervene if needed. Through this solution, the volume of newly born cattle has increased significantly.
IoT technologies introduce many benefits to the supply chain sector, such as the following:
Detecting counterfeit goodsImproved product quality, that is, better control of products' expiration datesReal-time or near-real-time inventory managementResource scarcity, or a lack of resources, occurs when demand for a natural resource exceeds supply. Therefore, in a modern economy, there is always a need for new and sustainable financial and service models.
Smart cities are a business initiative to offer a sustainability model and the best quality of life standards with fewer resources.
IoT technologies help a lot in achieving the vision of smart cities and completely disrupt lots of traditional citizen and council services. Here, we'll mention a few:
Smart parkingSmart street lightingSmart waste managementSmart energy managementSmart buildingsAnd so many more features and services.
With IoT technologies, the concept of a true and complete smart home is possible. Many products and services in homes are powered by IoT technologies. Here, we'll mention a few:
Smart refrigerators, microwaves, ovens, coffee machines, TVs, and so onSmart lightingSecurity and safetySmart windows, doors, curtains, and so onSmart thermostatsSmart gardensAnd many other features and services besides.
Without any doubt, and as has already been stated, the IoT is everywhere and disrupts many different business sectors.
Important Note
What is interesting here is the fact that the IoT solution paradigm is very simple and very common. In any sector, you will have things or IoT devices equipped with sensors to sense the physical world and with communication modules to provide connectivity to send the collected generated data from those IoT devices to the IoT backend cloud for further analysis.
To conclude this section, the most important thing is understanding business problems, how IoT can solve these issues, and what benefits businesses will get from using IoT technologies. Let's now move on to understand more about IoT solutions and technologies and see how it all works together.
When an architect, designer, or developer starts thinking about solution architecture for a business problem, they usually start thinking about a standard reference model or reference architecture that has been used and tested, with proof of success, by other experts in solving the same business problem they have in hand.
In traditional IT systems, you go with well-known architecture paradigms such as three-tier architecture, Service-Oriented Architecture (SOA), two-tier architecture, and many more modern paradigms, such as microservice-based architecture and serverless architecture. Even at the software code level, there are software design patterns.
IoT solutions are not unlike traditional IT solutions in the sense of the need to have a standard solution reference architecture or solution building blocks for any IoT solutions. However, IoT solutions are different in the following ways:
IoT solutions, by default, are End-to-End (E2E) solutions, from devices/sensors to web and mobile apps for end user use.IoT solutions contain so many architecture paradigms that in the IoT solution application layer, you could leverage one of the architecture paradigms we mentioned before, for example, three-tier architecture or serverless, while in the IoT solution analytics layer, you have different architecture paradigms, such as Lambda and Kapp architecture, with other IoT solution layers. We will explain those types of architecture paradigms later in this book.The footprint of skills and technologies required for IoT solutions is big compared to traditional IT solutions.In Figure 1.2, we have tried to capture, to some extent, the standard or commonly agreed upon IoT reference architecture, or IoT solution building blocks, that can be used to address IoT solutions for different business problems in different business domains:
Figure 1.2 – IoT solution reference architecture
Let's examine each layer of the IoT solution reference architecture in some detail.
This layer of the solution focuses on the IoT devices and their ecosystems. IoT devices can be classified into two categories:
IoT endpoint devices: This kind of device is usually cheap, low-power, or battery-based, such as constrained microcontroller devices that have sensors attached to them to sense objects in the physical world, or a wireless communication module to support short-range connectivity options (Wi-Fi, Zigbee, Bluetooth, and so on) to connect that device to an IoT edge or gateway device or to the IoT backend cloud directly using long-range connectivity options such as cellular, Ethernet, or satellite connectivity options. They also have a real-time operating system (RTOS) and different software stacks, Software Development Kits (SDKs), and embedded systems.IoT gateway devices: This kind of device is more powerful or bigger in terms of resources (compute, networking, and storage) compared to resource-constrained and limited IoT endpoint devices. Such types of devices usually run gateway services and have features such as the following:a) They act as a communication hub/router, that is, helping IoT endpoint device-to-device communication or IoT endpoint device-to-IoT backend cloud communication.
b) Data caching, cleansing, buffering, and aggregation locally at the edge.
c) IoT endpoint devices go through the gateway to get internet access and don't directly connect to the internet, so such devices manage IoT devices' security.
d) They play a role in the edge computing paradigm as sometimes it is used for local data processing and analytics.
e) The IoT gateway plays a critical role in supporting legacy and protocol conversion. Old IoT devices typically run old IoT connectivity protocols. The IoT gateway can convert those old protocols to modern and supported IoT protocols that run in the IoT edge layer or the IoT Cloud.
We will cover this layer in detail later in the book.
The edge or fog computing paradigm, in short, is running data center workloads very close to the end user or devices. You can move a small data center workload or an entire workload to the edge; it all depends on the edge location facility size and the data center's supported capabilities.
Let's look at the three main drivers behind the need for the edge computing paradigm.
We can't beat the speed of light, right? This is physics. In other words, whatever the quality and strength of a fiber optic cable used for data transmission in a packet data network, the transmission of the data will not be done in zero or fewer milliseconds.
Think about an IoT device running in a car park in the Singapore region, with the IoT analytics and applications running in the IoT backend cloud in the USA region. We should expect – and we can't do anything about it – in the region of a 250 ms latency factor added to the overall application request-response latency. So, a request raised from the IoT device in the car park might take roughly 1 or 2 seconds in total (250 ms latency + application processing time + database processing time, and so on) to get a response, assuming the workload running in the IoT Cloud is well designed and implemented and will not add any further unnecessary latency to the response time.
In some applications, getting an answer or response from the IoT backend cloud in 1 or 2 seconds could be fine, but in other real-time or near-real-time applications, that time could be a big problem. Regarding the example we just discussed, imagine there is a fire in the car park and the drivers need to get out or escape as soon as possible. The car park gate is closed and waiting for a response from the IoT backend cloud to open. Getting the response in 1 or 2 seconds in this case (note: we are not discussing here a no-response scenario as that is a completely different case altogether) might be too late to save people's lives.
In network topology, data traffic goes through multiple nodes or hops till it reaches its destination. Besides the light speed latency that we discussed above, you could also have a number of network issues, such as the cable being torn or some congestion in one of the nodes in the network topology. All such factors could even make the situation worse in terms of latency or getting a response quickly from the IoT backend cloud.
Edge computing solves these issues and challenges by running the IoT Cloud workload required (for example, Apps, Analytics, ML, and Control) locally, that is, as close as possible to IoT devices.
Data is important and, in fact, the goal of any IoT solution is to acquire data, gain some insights, and finally, act upon those insights.
IoT devices generate, or can generate, massive amounts of data. You can have data generated in a very small time resolution, for example, one second or less. Domains such as analytics and ML usually require such big data to give proper analytic outputs or excellent ML model accuracy results, but processing and storing such an amount of data comes at a cost.
Edge computing solves that challenge by processing all (or part of) such IoT-generated data at the edge and storing only the relevant and required data needed for further analysis and applications in the IoT backend cloud.
In the edge cloud, you can do data aggregation first before sending the data or batch of data to the IoT backend cloud. You can run advanced near-real-time or streaming analytics on the edge and might be storing just the results of such real-time analytics in the IoT backend cloud for other historical analytics solutions (for example, trends). For example, running analytics on the last 10 or fewer minutes of usage of smart parking could be done easily on the edge with data stored and processed on the edge for such a time resolution, that is, 10 minutes. After that, data could be deleted or aggregated into a higher time resolution (for example, 1 hour or so) and that aggregated data is then sent to the IoT Cloud for historical analytics.
Edge computing solves the preceding issues and challenges by reducing the cost of storing and processing such massive amounts of generated IoT data in the IoT Cloud.
Due to certain regulations or data privacy compliance requirements, you might have to store sensitive data such as personal data generated from IoT devices within the country or region where those IoT devices are deployed and operating. A problem may arise if you have a kind of centralized IoT backend cloud in one or more regions that differs from the highly regulated regions the IoT devices are deployed and operated in.
Edge computing solves that issue by storing and processing such sensitive data locally and might anonymize such data and push it later to the central IoT Cloud in an anonymized or masked form.
We will cover this layer in further detail later in the book.
This layer is very important in any IoT solution as it covers so many solutions and applications. Let's look at these in detail.
Provisioning, in general, means setting up and configuring backend systems with all the required information and configurations the solution's upstream and downstream systems require to operate as expected.
In IoT solutions, IoT device provisioning can be done in many backend systems depending on the final IoT solution architecture, but here are common systems required in IoT device provisioning:
A thing or IoT device provisioning: This system or platform is responsible for storing IoT device metadata in the IoT Cloud database – usually, it is called an IoT device registry solution. Metadata such as the device ID, device description, and so much other metadata that you could store about the IoT device will help you in the solution later; for example, storing the device's location (which floor of the building, parking lot, and so on the IoT device is installed on) might help in an end user's journey when it comes to searching for a smart parking solution and suchlike.Also, IoT device identity details such as device credentials and/or X.509 certificates can be securely stored and provisioned in that layer.
Connectivity provisioning: The IoT device might have one or more communication modules, for example, one communication module for Zigbee connectivity and another one for cellular (mobile) connectivity.In the case of cellular connectivity, for example, you must configure or provision a Subscriber Identification Module (SIM) with the mobile network operator, otherwise such connectivity will not work.
This layer is the front-door layer of backend IoT Cloud solutions and services. In other words, this is the first layer that receives data from the IoT endpoint devices or IoT edge and ingests such data into the proper IoT Cloud storage layer. In that layer, you can have the following components:
MQTT Message Broker: We will cover the Message Queuing Telemetry Transport (MQTT) protocol in greater detail later in this book, but for now, MQTT is a lightweight publish-subscribe (or Pub-Sub) network protocol that supports message transportation between devices, so one device publishes the message to a specific topic and the other device(s) or applications from the other end subscribe to that topic to get the published message. MQTT is considered one of the best IoT application communication protocols for a wide variety of reasons, which will be discussed later. But for now, the MQTT lightness feature is the most obvious reason to prefer MQTT over HTTP as IoT endpoint devices are usually constrained in terms of computing resources, so running heavy protocols such as HTTP might be a problem or not supported at all by the IoT endpoint device operating system.A complete IoT solution should have a scalable, reliable, resilient, and secure MQTT message broker, or we can call it an MQTT server since the IoT endpoint, IoT edge devices, and IoT applications usually act as MQTT clients.
Streaming Processing Engine: Data, in the case of powerful IoT devices, could come from the IoT devices directly in the form of data streams over the HTTP(S) protocol or, typically in large-scale and production-grade IoT solution architecture, you have in the front an MQTT message broker and that message broker sends or forwards such incoming IoT data (coming through MQTT) to the streaming processing engine for further processing if required.A complete IoT solution should have – if needed – a scalable, reliable, resilient, and secure streaming processing engine such as Kafka to support IoT data streams.
This component is critical and crucial in any IoT solution. Why? Because this component is the glue between IoT devices on the ground and the IoT backend cloud. In other words, the component is responsible for directing incoming data from the IoT devices to their destination in the IoT backend cloud. There are so many destinations, such as the database (SQL, NoSQL, and so on), message queue/bus, data lake, or object storage such as Amazon S3, Hadoop, and a streaming engine for further processing or real-time analytics use cases.
In this layer of an IoT solution, there are so many different storage options, as we will discuss later in the book, but the most common one used in large-scale and production-grade IoT solutions is object storage solutions such as the famous Amazon S3 object storage service.
The concept of the data lake – usually built on top of object storage solutions such as Amazon S3 – is the recommended IoT design pattern where all data in whatever format coming from IoT devices will be ingested and stored durably and securely in that data lake storage for subsequent processing.
Further down the line of IoT solutions, you could have another process or system read such raw IoT data from the data lake for further processing and storage. For example, you could perform some data cleansing, preparation, and processing, and store the data in another data store such as a SQL database (for reporting) or a NoSQL database (for a real-time dashboard application).
This layer of the IoT solution covers all systems and components used in building a big data and analytics standard pipeline (collect->process->store->analyze->visualize).
It also contains systems and components used in building an ML pipeline (Data Extraction -> Model Training -> Model Evaluation -> Model Deployment).
This layer is so important because, as explained earlier, IoT is all about getting the data for analytics and insights.
We will cover this layer in further detail later in the book.
In this layer of the solution, there are many components. Let's briefly discuss them.
You will write application code and you will need to deploy or run that code, so you will require compute services to host the application code. These are the typical options:
Bare-metal or physical host: This option is so expensive and not often used in the era of public cloud and managed hosting services. It could be used only if you have legacy application code that has special hardware specifications or special software restrictions, for example, licenses.Virtual Machines: This option is the most used compute option whether applications are deployed in a traditional data center, a private cloud, or a public cloud.Virtualization technologies have been a game-changer in the computing service domain in recent decades and are still valuable options in terms of modern application deployment.
Containers: Container technologies are the latest compute services that offer the greatest benefits. We'll cover them later in the book.Container technologies help a lot in achieving the desired benefits of new application architecture paradigms such as microservice architecture. Microservice architecture concepts were not new, but with container technologies, they become brighter and make much more sense.
Container technology introduces a need for a container orchestration platform to manage container deployment on a large scale. Kubernetes is an open source container orchestration engine designed to deploy and manage containerized services on a large scale.
There are other container orchestration platforms available on the market offered as commercial solutions, such as AWS ECS – Elastic Container Services, or open source, such as Apache Mesos or Docker Swarm. However, Kubernetes has proven to be the best and is the market-leading container orchestration platform with huge technical community support.
Serverless: Serverless means there is a server, but the less part of serverless means you do not manage that server at all.In the serverless paradigm, the application developer will focus on the code only, be it Java, Python, C#, and so on. Then, when it comes to deploying that code onto a server-side platform, the developer simply uploads the code artifacts to the serverless provider (whether it is a public cloud provider or a private cloud provider). The serverless provider behind the scenes will deploy that code to a server managed by that provider.
Serverless technologies, also called Function as a Service (FaaS), typically run and manage containers at scale behind the scenes to deploy and run the user's uploaded code.
Serverless usually follows an event-driven architecture paradigm. To execute the uploaded code, an event must be triggered to notify the serverless service to execute your code and return its result, or it can be triggered in a scheduled manner.
Examples of serverless offerings are AWS Lambda, Azure Functions, and Google Cloud Functions.
As part of the IoT solution design phase, you have to choose the compute service you require for your solution. You might prefer containers over virtual machines or vice versa, you might choose both for different applications' requirements, or you may prefer serverless for a quick start and to avoid server maintenance, and so on.
In modern applications, no one database engine or type fits all data and applications' purposes. Currently, there are lots of database engines for different uses and purposes, such as the following:
Relational databases or SQL databases: This is the oldest and most well-known, with RDBMSs such as Oracle DB, Microsoft SQL Server, My SQL, MariaDB, PostgreSQL, and many more. Such kinds of database engines are usually used in traditional applications, ERP, and e-commerce solutions.Non-relational (or NoSQL) databases