Why Edge
Sending every reading to a distant cloud causes delay (latency), uses bandwidth, costs money and fails when the network drops. Edge computing processes data on the device or on a nearby gateway. Real-time systems, such as a robot that must stop, a heart monitor that must alarm or a machine that must shut down, cannot wait for a round trip of tens or hundreds of milliseconds.
Edge Tasks
- Filtering: drop readings that did not change or are invalid.
- Aggregation: send an average or summary at intervals.
- Local decisions: compare with a threshold and act at once.
- Protocol translation: convert local protocols to MQTT or HTTP.
- Local inference: run a small machine-learning model, TinyML, for example to detect a fall or a faulty machine.
- Buffering: keep data during an outage and send later.
- Privacy: anonymise or keep raw data, such as video, on site.
Edge, Fog and Cloud
The edge (device and gateway) gives the fastest response and the least data. The fog (local servers or base stations) gives regional processing. The cloud gives large-scale storage, training of models and long-term analytics. A common design is: decide at the edge, learn in the cloud; the cloud trains a model and sends it back to the edge.
Challenges
Edge devices have limited power, memory and processing, need security (they are physically exposed), must be updated remotely and managed at scale, and must be synchronised with the cloud.
Definition: TinyML. The running of small machine-learning models directly on low-power microcontrollers at the edge, so that devices can make intelligent decisions locally without sending raw data to the cloud.
Table 3.4: Edge versus cloud processing
| Feature | Edge | Cloud |
|---|---|---|
| Latency | Milliseconds | Tens to hundreds of milliseconds |
| Bandwidth need | Low (summaries) | High (raw data) |
| Works offline | Yes | No |
| Compute and storage | Limited | Very large |
| Best for | Real-time decisions | Training, long-term analytics |
Example 3.4: Latency and bandwidth saving
Problem: A moving robot at 2 m/s must react to an obstacle. A cloud round trip takes 120 ms and an edge decision takes 8 ms. A vibration sensor samples 1,000 times per second at 2 bytes each; the edge sends a 20-byte summary every 10 seconds. Find the distance travelled during each delay and the bandwidth saving.
Solution:
- Distance by cloud = 2 × 0.120 = 0.24 m (24 cm). Distance by edge = 2 × 0.008 = 0.016 m (1.6 cm).
- Raw rate = 1,000 × 2 = 2,000 bytes per second.
- Summary rate = 20 / 10 = 2 bytes per second.
- Reduction = 2,000 / 2 = 1,000 times.
Result: The edge reacts after 1.6 cm instead of 24 cm and sends 1,000 times less data.
speed, cloud, edge = 2.0, 0.120, 0.008
print("Cloud distance (cm):", speed * cloud * 100)
print("Edge distance (cm):", speed * edge * 100)
raw, summary = 1000 * 2, 20 / 10
print("Bytes/s raw:", raw, "| summary:", summary)
print("Reduction:", raw / summary, "times")
Output
Cloud distance (cm): 24.0
Edge distance (cm): 1.6
Bytes/s raw: 2000 | summary: 2.0
Reduction: 1000.0 times
Common mistakes
- Using the cloud for decisions that need millisecond response.
- Sending all raw data when a summary is enough.
- Forgetting to secure and update edge devices.
- Loading heavy models on very small microcontrollers.
Key takeaways
- Edge: low latency, low bandwidth, offline, privacy.
- Tasks: filter, aggregate, decide, translate, infer, buffer.
- Decide at the edge, learn in the cloud.
- TinyML runs small models on microcontrollers.
Practice questions
- Why is edge computing used for real-time control?
- Name two edge tasks.
- What is TinyML?
Answers to the practice questions
- It avoids the cloud round-trip delay.
- Filtering and local decision making (also aggregation, buffering).
- Running small machine-learning models on low-power microcontrollers.
Sources
- Official BCA syllabus Internet of Things, course code 25BCA406DS01, Unit III
