0
0
IOT Protocolsdevops~30 mins

Why edge computing reduces latency in IOT Protocols - See It in Action

Choose your learning style9 modes available
Why Edge Computing Reduces Latency
📖 Scenario: You work for a company that manages smart home devices. These devices send data to a central cloud server for processing. Sometimes, the devices respond slowly because the data has to travel far to the cloud and back.To improve speed, the company wants to use edge computing, where data is processed closer to the devices.
🎯 Goal: Build a simple simulation that shows how processing data at the edge reduces latency compared to sending data to the cloud.
📋 What You'll Learn
Create a dictionary called devices with device names as keys and their data sizes in MB as values
Create a variable called cloud_latency_per_mb set to 100 milliseconds
Calculate the total latency for each device if data is sent to the cloud (data size * cloud latency per MB)
Calculate the total latency for each device if data is processed at the edge with a fixed latency of 50 milliseconds
Print the latency comparison for each device showing cloud latency and edge latency
💡 Why This Matters
🌍 Real World
Edge computing is used in smart homes, factories, and self-driving cars to make devices respond faster by processing data nearby instead of sending it far away to the cloud.
💼 Career
Understanding latency and edge computing helps DevOps engineers optimize IoT systems and improve user experience by reducing delays.
Progress0 / 4 steps
1
Create the devices data dictionary
Create a dictionary called devices with these exact entries: 'Thermostat': 5, 'SecurityCamera': 20, 'SmartLight': 1
IOT Protocols
Need a hint?

Use curly braces to create a dictionary with device names as keys and data sizes as values.

2
Set cloud latency per MB
Create a variable called cloud_latency_per_mb and set it to 100 (milliseconds)
IOT Protocols
Need a hint?

Assign the number 100 to the variable cloud_latency_per_mb.

3
Calculate latencies for cloud and edge
Create two dictionaries called cloud_latency and edge_latency. Use a for loop with variables device and size to iterate over devices.items(). Calculate cloud latency as size * cloud_latency_per_mb and edge latency as a fixed 50 milliseconds for each device.
IOT Protocols
Need a hint?

Use a for loop to fill both dictionaries with calculated latencies.

4
Print latency comparison
Use a for loop with variable device to iterate over devices.keys(). Print the device name, cloud latency, and edge latency in this exact format: Device: Thermostat, Cloud Latency: 500 ms, Edge Latency: 50 ms
IOT Protocols
Need a hint?

Use an f-string inside the print statement to format the output exactly.