Edge vs cloud

A systematic comparison of running on the device and in the cloud: latency, bandwidth, privacy, cost and reliability.

Beginner9 min read

Educational draft content that needs expert review before it is used as an academic reference. Specifications, versions and licences change; check the official source. No experimental result is shown here unless it was actually run.

Learning objectives

  • Compare edge and cloud on five axes
  • Compute total latency for each option
  • Describe the hybrid system and when it is used

Neither option is always better; the decision balances conflicting factors. Total latency in the cloud = upload time + server inference time + return time, and it depends on network quality. On the edge latency is the local inference time only, which depends on the device’s power.

Bandwidth: sending full video or audio is expensive while sending a small result is cheap. Privacy: keeping sensitive data on the device lowers transport and storage risk but does not remove the need to secure the device itself. Cost: the cloud is a recurring operating cost; the edge is upfront hardware plus maintenance and updates.

Reliability: the edge works without a network, but updating models on thousands of devices is a real engineering challenge. In practice many systems are hybrid: a small local model filters and the cloud handles the hard cases.

Diagram

Two inference paths: device and cloudA schematic showing on-device inference happening locally, while the cloud path includes sending data over the network, inference and returning the result.Sensor anddeviceOn-device model(edge)Cloud(server)localupload over the networkthe result returnsEdge latency = local inference | Cloud latency = upload + RTT + inference + return
Schematic, not a measurement.

Terminology (with Arabic equivalents)

Round-trip time (RTT)زمن الذهاب والعودة
Hybridنظام هجين
Offloadingتفريغ الحمل إلى السحابة
Break-evenنقطة التعادل

Worked example

Assume (teaching defaults only): a 200 KB image, a network with 8 Mbps upload and a 60 ms RTT, cloud inference of 20 ms, and on-device inference of 90 ms. Cloud latency ≈ 200×8/8000 s = 200 ms sending + 60 + 20 = 280 ms, while the device takes 90 ms. The result changes if the network or the device changes; try the interactive calculator.

Code snippet

PythonDefaults for learning
def cloud_latency_ms(payload_kb, uplink_mbps, rtt_ms, server_ms):
    upload_ms = payload_kb * 8 / (uplink_mbps * 1000) * 1000
    return upload_ms + rtt_ms + server_ms

def edge_latency_ms(device_ms):
    return device_ms

# Hypothetical teaching values, not measurements
print(cloud_latency_ms(200, 8, 60, 20), edge_latency_ms(90))

An illustrative snippet that was not executed in the lab environment; check library versions in their official documentation before use.

Check yourself

  1. Which of the following often increases cloud latency but does not affect edge latency?

    • Network speed and round-trip time
    • Model size on the device
    • Device battery capacity
    • File encoding
    Answer and explanation

    Network speed and round-trip time — The network only enters cloud latency.

  2. What is the advantage of a hybrid system?

    • It removes the need for updates
    • It combines edge speed with cloud capacity
    • It reduces the number of models to one
    • It needs no network at all
    Answer and explanation

    It combines edge speed with cloud capacity — A small local model filters, and the cloud handles the hard cases.

  3. A real challenge for the edge is:

    • Being unable to run any model
    • Updating models on a large number of devices
    • Having no small model at all
    • Response time always being high
    Answer and explanation

    Updating models on a large number of devices — Fleet management and model updates are an operational challenge.

References

Suggested reading (links not verified yet)

  • Shi et al. (2016). Edge Computing: Vision and Challenges. IEEE Internet of Things Journal Not verified

Image and audio processing in the experiments runs inside your browser. Your images and audio are never uploaded and conversations are not stored. Privacy