The World Of IoT Computing - Cloud Vs Edge Vs Fog

Welcome to another not so boring article on IoT. Well, for starters I will keep this short and as informative as possible.

Cloud Vs Edge Vs Fog

The world of IoT

Do we need to go through this again? What is IoT and all those? Not really… Let's keep it simple.

IoT or Internet of things is simply connecting everything to everything either directly or indirectly.

But the world of IoT is extremely confusing. When we design IoT systems lots of questions keep on bugging our mind. The fact is for any IoT system there can be many approaches, but all boils down to the fact that what constraints we have and how we want to resolve it. A major part of this is the million-dollar question –

“Where to do the computing ??? ☹”

Computing in the world of IoT

In the world of IoT, our main information source are sensors. These convert the physical parameters into digital and then provide us an output. In some cases, the data we need is available as raw and in some scenarios the data is available to us in processed form.

To play with these data available from sensors, based on the use case we can process these data points at different places. This we refer as computation. Based on where we are processing the data, we can classify it into the following 3 categories.

  1. Cloud computing
  2. Fog computing
  3. Edge computing

Now, what is what and when to use when? Too many questions. I will walk you through each of these and then we are going to address the questions.

Cloud computing

Cloud computing is very common when it comes to IoT. Most IoT systems are dependent on the cloud to process the data. Let’s have a look at the following picture to get an understanding.

Cloud Vs Edge Vs Fog

Cloud computing with IoT gateway. Please note that if sensors can send data directly to cloud, gateway may be eliminated.

In the above image, what happens is the sensors either communicate directly to the cloud or indirectly via a gateway and all the processing and analytics happen at cloud including data processing, rule engines and other stuffs.

A lot of platforms exist in today’s world which serves as a cloud computing platform. Microsoft’s Azure, Amazon’s AWS, and Google’s GCP are some of the 1st examples that comes to our mind. They will have dedicated managed services for IoT for the devices to connect to and process data. We can hook up multitude of microservices to the pipeline for any use case.

Its to be noted that most of the processing parts happen on the cloud and thus we refer to as cloud computing.

Edge computing

Edge computing refers to computation performed at device level. It has got several advantages. The 1st being network bandwidth is exponentially reduced. Before going into the details of edge computing, lets have a look at the diagram first.

Cloud Vs Edge Vs Fog

Edge computing brief architecture. Also note that IoT gateway may or may not be a part of the system

In this case of edge computing, the devices that are deployed at edge can do the hard-core processing and the cloud is just used for monitoring, storage, and configuration settings. In this architecture, since we can off-load a lot of processing entities from the cloud, its very efficient when it comes to low bandwidth areas.

This type of architecture is mainly used in the following scenarios.

  1. Video or image processing
  2. Implementation of any DSP based application.

However, sometimes this deployment technique becomes quite costly as for each sensing node, we have a computational unit attached or probably a group of sensors with a multiplexed IO. To solve this problem, we have the concept of fog computing.

Fog computing

Fog computing is very much similar to edge computing, but with a slight difference. In edge computing, we were focused on computing at edge level. However, in this case, its done over a local area network or LAN. Let’s have a look at the diagram below.

Cloud Vs Edge Vs Fog

Fog computing brief example block diagram

In the above image, what we see is the edge device or rather the sensors capture data and send it to a computation device let’s say a FPGA locally over LAN. Now, for IP based camera’s we can have one computational device and for other sensors, we can have another. Also note that if a sensor is not capable of transmitting data directly, we can use a networking block.

Here also the hard-core processing happens locally, and the cloud is used for monitoring, storage, and configuration settings.

Thus, this is very similar to edge computing with the difference being the location of computation is at a local network level for fog and sensor or device level for edge.

What to use when?

After all these discussions, you may be pretty much confused about what architecture to use when. I will try to keep it as soon as possible.

Device telemetry

We need to access real-time information regarding a system telemetry from virtually anywhere in the world. In this scenario, we need each raw piece of information or sensor data to be streamed to the cloud. In this scenario, cloud computing approach works the best.

Video analysis

As discussed earlier, when we deal with a lot of data that requires near real-time or real-time processing, the option to stick to is edge computing. In scenarios where we need to do video processing on camera feeds is one of the most common use-case of edge computing.

Combination of multiple systems

In certain scenarios, where we can have multiple edge nodes like a cluster of cameras which require near real-time processing, an edge computing approach may be costly, in those cases, if the sensors are physically close to each other, LAN based fog computing is used.

In the images above, we have used a component called IoT gateway. Now this can be used in any scenario. However, computing and sensor nodes can directly send information to the cloud as well. Fog and Edge computing are more of a kind of decentralized system where computation happens at fog nodes via LAN in fog and at edge level in case of edge computing.

End note

Well, that marks the end of the discussion for now on cloud, edge, and fog computing. Now there can be a hybrid model too where all 3 are combined into one which is pretty common nowadays but that will be discussed in another article. If you have any problem understanding any concept, drop a note here.