Try It: Edge vs Cloud Cost Calculator
Try Change Edge message reduction (%), then press Calculate.
Observe Press Calculate and compare Monthly cost, Monthly savings, and Payback.
Explain Describe how message reduction changes Monthly savings when you press Calculate.
Calculate
Reset
Technical boundaries. The simplified cost model applies one payload size and a rounded message-reduction percentage to all retained edge messages. Gateway cost is spread over 36 months.
Explore a simplified cost model. It applies one payload size and a rounded message-reduction percentage to all retained edge messages; its default results therefore differ from the worked example, which uses 150-byte aggregates and 250-byte alerts.
viewof epSensors = Inputs. range ([1000 , 100000 ], {value : 10000 , step : 1000 , label : "Number of sensors" })
viewof epInterval = Inputs. range ([5 , 300 ], {value : 30 , step : 5 , label : "Reporting interval (sec)" })
viewof epPayload = Inputs. range ([50 , 1000 ], {value : 250 , step : 50 , label : "Payload size (bytes)" })
viewof epCellCost = Inputs. range ([0.01 , 1.0 ], {value : 0.10 , step : 0.01 , label : "Cellular cost ($/MB)" })
viewof epReduction = Inputs. range ([50 , 99 ], {value : 97 , step : 1 , label : "Edge message reduction (%)" })
viewof epGwCost = Inputs. range ([100 , 2000 ], {value : 500 , step : 100 , label : "Gateway cost ($)" })
viewof epGwCapacity = Inputs. range ([100 , 2000 ], {value : 500 , step : 100 , label : "Sensors per gateway" })
epCalc = {
let msgsPerHour = epSensors * (3600 / epInterval);
let msgsPerMonth = msgsPerHour * 24 * 30 ;
let cloudBwMB = (msgsPerMonth * epPayload) / (1000 * 1000 );
let cloudBwCost = cloudBwMB * epCellCost;
let cloudProcCost = msgsPerMonth * 0.000002 ;
let cloudTotal = cloudBwCost + cloudProcCost;
let edgeMsgsMonth = msgsPerMonth * (1 - epReduction / 100 );
let edgeBwMB = (edgeMsgsMonth * epPayload) / (1000 * 1000 );
let edgeBwCost = edgeBwMB * epCellCost;
let edgeProcCost = edgeMsgsMonth * 0.000002 ;
let numGateways = Math . ceil (epSensors / epGwCapacity);
let gwMonthly = (numGateways * epGwCost) / 36 ;
let edgeTotal = edgeBwCost + edgeProcCost + gwMonthly;
let savings = cloudTotal - edgeTotal;
let savingsPct = ((savings / cloudTotal) * 100 );
let paybackDays = (numGateways * epGwCost) / (savings) * 30 ;
return {msgsPerMonth, cloudBwMB, cloudTotal, edgeMsgsMonth, edgeBwMB, edgeTotal, savings, savingsPct, numGateways, gwMonthly, paybackDays};
}
html `<div class="arch-result">
<div class="arch-calculator-output">
<div class="arch-calculator-card">
<strong>Cloud-only</strong>
<div>Messages/month: ${ (epCalc. msgsPerMonth / 1e6 ). toFixed (1 )} M</div>
<div>Bandwidth: ${ (epCalc. cloudBwMB / 1000 ). toFixed (1 )} GB</div>
<div>Monthly cost: $ ${ epCalc. cloudTotal . toFixed (0 )} </div>
</div>
<div class="arch-calculator-card">
<strong>Edge processing</strong>
<div>Messages/month: ${ (epCalc. edgeMsgsMonth / 1e6 ). toFixed (1 )} M</div>
<div>Bandwidth: ${ (epCalc. edgeBwMB / 1000 ). toFixed (2 )} GB</div>
<div>Monthly cost: $ ${ epCalc. edgeTotal . toFixed (0 )} </div>
</div>
<div class="arch-calculator-card">
<strong>Decision signal</strong>
<div>Monthly savings: $ ${ epCalc. savings . toFixed (0 )} ( ${ epCalc. savingsPct . toFixed (0 )} %)</div>
<div>Gateways needed: ${ epCalc. numGateways } </div>
<div>Payback: ${ epCalc. paybackDays . toFixed (0 )} days</div>
</div>
</div>
</div>`
Back to the chapter