viewof num_sensors = Inputs.range([100, 10000], {
label: "Number of Sensors:",
step: 100,
value: 1000
})
viewof sensor_cost = Inputs.range([1, 50], {
label: "Cost per Sensor ($):",
step: 1,
value: 2
})
viewof central_server_cost = Inputs.range([10000, 500000], {
label: "Central Server Cost ($):",
step: 10000,
value: 100000
})
distributed_total = num_sensors * sensor_cost
distributed_latency = "1-10ms"
central_latency = "100-500ms"
cost_ratio = (central_server_cost / distributed_total).toFixed(1)
cost_savings = ((central_server_cost - distributed_total) / central_server_cost * 100).toFixed(0)
html`<div style="font-family: Arial, sans-serif; padding: 20px; background: #f8fbfd; border: 1px solid #cbd5e1; border-radius: 14px; color: #17324d;">
<h3 style="margin: 0; color: #17324d;">Distributed vs Centralized Computing Economics</h3>
<p style="margin: 6px 0 18px; color: #52677a;">Compare local edge processing against sending every sensor event to one central server.</p>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;">
<div style="background: #ffffff; padding: 16px; border-radius: 10px; border-left: 5px solid #0f766e;">
<h4 style="margin: 0 0 12px; color: #0f766e; font-size: 1.05em;">Distributed IoT</h4>
<div style="margin: 10px 0;">
<div style="font-size: 0.85em; color: #52677a;">Total cost</div>
<div style="font-size: 1.8em; font-weight: 700; color: #0f766e;">$${distributed_total.toLocaleString()}</div>
<div style="font-size: 0.85em; color: #64748b;">${num_sensors.toLocaleString()} sensors x $${sensor_cost}</div>
</div>
<div style="margin: 10px 0;">
<div style="font-size: 0.85em; color: #52677a;">Latency</div>
<div style="font-size: 1.25em; font-weight: 700; color: #1d4ed8;">${distributed_latency}</div>
</div>
<div style="margin: 10px 0;">
<div style="font-size: 0.85em; color: #52677a;">Resilience</div>
<div style="font-size: 1em; color: #334155;">High: failures stay local</div>
</div>
</div>
<div style="background: #ffffff; padding: 16px; border-radius: 10px; border-left: 5px solid #dc2626;">
<h4 style="margin: 0 0 12px; color: #991b1b; font-size: 1.05em;">Centralized Server</h4>
<div style="margin: 10px 0;">
<div style="font-size: 0.85em; color: #52677a;">Total cost</div>
<div style="font-size: 1.8em; font-weight: 700; color: #991b1b;">$${central_server_cost.toLocaleString()}</div>
<div style="font-size: 0.85em; color: #64748b;">1 central server</div>
</div>
<div style="margin: 10px 0;">
<div style="font-size: 0.85em; color: #52677a;">Latency</div>
<div style="font-size: 1.25em; font-weight: 700; color: #1d4ed8;">${central_latency}</div>
</div>
<div style="margin: 10px 0;">
<div style="font-size: 0.85em; color: #52677a;">Resilience</div>
<div style="font-size: 1em; color: #334155;">Low: one failure can stop service</div>
</div>
</div>
</div>
<div style="margin-top: 16px; padding: 14px; background: #fff7ed; border-radius: 10px; border-left: 5px solid #ea580c;">
<div style="font-size: 1em; font-weight: 700; color: #9a3412; margin-bottom: 8px;">Economic analysis</div>
<div style="font-size: 0.95em; color: #334155; line-height: 1.55;">
Cost ratio: centralized is <strong>${cost_ratio}x more expensive</strong><br>
Cost savings: distributed saves <strong>${cost_savings}%</strong><br>
Distributed processing can lower latency for some workloads; compare measured end-to-end latency in the chosen architecture.<br>
Resilience: service can continue even if ${Math.floor(num_sensors * 0.1).toLocaleString()} sensors fail
</div>
</div>
<div style="margin-top: 12px; font-size: 0.95em; color: #334155;">
<strong>Key insight:</strong> when edge chips cost under $5, distributed computing becomes both cheaper and faster for many IoT workloads.
</div>
</div>`Distributed vs Centralized Computing Economics
Distributed vs Centralized Computing Economics
animation
iot
systems
Try Change Cost per Sensor ($):, then press Calculate cost savings.
Observe After Calculate cost savings, compare Total cost, Cost ratio, and Cost savings.
Explain Explain why Calculate cost savings changes when the number of sensors increases.
Technical boundaries. Distributed total cost is sensor count multiplied by sensor cost, compared with one central server cost. Latency values are fixed; compare measured end-to-end latency in the chosen architecture.