Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Enterprise Internet of Things Handbook

You're reading from   Enterprise Internet of Things Handbook Build end-to-end IoT solutions using popular IoT platforms

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781788838399
Length 332 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Arvind Ravulavaru Arvind Ravulavaru
Author Profile Icon Arvind Ravulavaru
Arvind Ravulavaru
Arrow right icon
View More author details
Toc

End-to-end architecture

Now that we are aware of the building blocks for a typical IoT solution, we will look at the two different types of architecture for building solutions, their pros and cons, and which setup is suitable for what application.

Using cloud computing

Microsoft Azure defines cloud computing as:

Simply put, cloud computing is the delivery of computing services-servers, storage, databases, networking, software, analytics, and more-over the internet (the cloud).

In IoT, cloud computing is used when the devices talk directly to the cloud. Take a look at this IoT stack built using cloud computing:

The sensor data needs to reach the cloud finally. So, what means do we have? We can connect an Ethernet cable to our controller to talk to a router and then send the data via the router or use a Wi-Fi module to interface with a local router access point. We can also use a GSM module to send the data via a GSM network.

Pros and cons of using cloud computing in the IoT

Now let's quickly look at the pros and cons of this approach:

  • Pros:
    • If we have only one or two devices in an environment (for router-based communication)
    • If devices are closely positioned to each router (for wireless and router-based communication)
    • If the network strength of the SIM/GSM is better than good (for GSM-based communication)
    • If the battery life of the smart device is not a factor, as both GSM and Wi-Fi modules consume high power (for wireless-based communication)
  • Cons:
    • If there is no internet access, these devices are literally dumb devices. No rules or schedules can be run on these devices if they are offline. No intelligence can be gathered.
    • If more devices are connected in the same environment, then we may not have enough Ethernet ports on a router or the router capability to access more devices as Wi-Fi clients (for router-based communication).
    • If the devices are far away from the router, they cannot contact the router or may struggle to keep their connection alive (for wireless and router-based communication).
    • If a particular GSM network is patchy in an area, the connectivity with the cloud is a major issue, again making this device a dumb device till the internet comes on.
    • GSM and Wi-Fi modules consume a lot of power and are not capable of running on a battery for long (not even 6 months).

The biggest issue among all this is the necessity for these devices to be always connected to the internet. If the network goes down, these devices will still function but the data they gather will be quite useless.

Imagine a smart home with about 40 to 50 smart devices deployed; here, all of them need to be connected to power at all times and moving them around might not be an option. Placing them at remote places where there is no power is a breaking factor. The distance between the Wi-Fi router and the device needs to be small.

In developing nations, both internet connectivity and power may be a challenge. This approach may not be a suitable approach for those nations.

These are some of the key challenges when working with cloud computing and IoT.

Now, let us look at fog computing.

Using fog computing

Fog computing, fog networking, or fogging is a computation paradigm where the cloud comes closer to the earth or the fog layer. This layer has the computational infrastructure needed to run most essential operations and has all the features that a typical cloud would have but runs locally.

The primary difference between cloud computing and fog computing is that the sensor/actuator network does not heavily rely on the internet to work.

Take a look at this IoT stack built using fog computing:

In the stack, the sensor nodes do not directly talk to the gateway. Instead, they talk to an Edge Router, which is responsible for locally collecting all the data from various sensors, and this Edge Router sends the data to the Cloud when the network is available.

We can think of the edge router as a mini-cloud which can execute almost all basic functions such as storing data, running rules, executing schedules, and managing the devices offline if the internet is not available.

Pros and cons of using fog computing in the IoT

Now let's quickly look at the pros and cons of this approach.

  • Pros:
    • Ideal for multiple devices connected to a network.
    • The range between the edge router and hub is not a factor because these smart devices or edge nodes use long range or mesh-based communication.
    • All the edge nodes run a protocol such as Bluetooth, Zigbee, or Z-Wave, which are power-efficient and can run a CR2032 battery for years together.
    • The availability of the internet is not a factor for this smart network to work. The edge router is capable of taking on the role of a mini-cloud to emulate all its features.
  • Cons:
    • The biggest con in a system like this is the necessity for a consumer to buy an edge router even though they would like to use just one node
    • Inventory management for an organization would be higher because they need to maintain multiple devices now
    • The initial purchasing cost is on the higher side as the user needs to purchase the edge router along with the actual smart device

If we are looking at building a system where there are plenty of devices connected close to each other and they need to work seamlessly irrespective of the internet connection, then fog computing is better.

Edge computing

Which is better?

Fog computing pushes intelligence towards the smart devices, reducing the amount of data that needs to go to the cloud and decreasing operational latency between the user and the smart device. Cloud computing is a centralized system that can scale on demand and can perform on-demand analysis in real time, among other things.

Here is a table from Cisco's blog, written by Maher Abdelshkour, explaining the differences between cloud and fog computing:

Another table with a high-level comparison follows:

To summarize, depending on the scale, cost, and real-time nature of the application you are planning to deploy, you can pick between cloud computing and fog computing.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime