viewof samplingRateHz = Inputs.range(
[1, 1000],
{
label: "Sampling Rate (Hz)",
value: 100,
step: 10,
format: x => x < 10 ? `${x} Hz` : `${x} Hz (${x} samples/sec)`
}
)
viewof numberOfSensors = Inputs.range(
[1, 1000],
{
label: "Number of Sensors",
value: 500,
step: 10,
format: x => x.toLocaleString()
}
)
viewof bytesPerSample = Inputs.select(
[1, 2, 4, 8, 16],
{
label: "Bytes per Sample",
value: 4,
format: x => `${x} bytes ${x === 4 ? '(float32)' : x === 2 ? '(int16)' : x === 8 ? '(float64)' : ''}`
}
)
viewof edgeCompressionRatio = Inputs.range(
[1, 200],
{
label: "Edge Processing Compression Ratio",
value: 100,
step: 10,
format: x => `${x}:1 (${(100/x).toFixed(1)}% sent)`
}
)Data Volume and Edge Calculator
Data Volume and Edge Calculator
animation
applications
requirements
Try Change Sampling Rate (Hz), then press Calculate data volume.
Observe Watch Raw data volume and After Edge Processing after pressing Calculate data volume.
Explain Describe how Calculate data volume uses compression to reduce annual cloud costs.
Technical boundaries. The calculation uses 86400 seconds per day and $0.10 per GB for cloud ingestion. Architecture recommendations depend on raw daily data volume.
Calculate daily data volume and edge processing savings:
dataVolumeCalculation = {
// Raw data calculation
const bytesPerSecond = samplingRateHz * numberOfSensors * bytesPerSample;
const bytesPerDay = bytesPerSecond * 86400; // 86400 seconds per day
// Convert to appropriate units
const gbPerDay = bytesPerDay / (1024 * 1024 * 1024);
const mbPerDay = bytesPerDay / (1024 * 1024);
// Edge processed data
const edgeProcessedBytesPerDay = bytesPerDay / edgeCompressionRatio;
const edgeProcessedMbPerDay = edgeProcessedBytesPerDay / (1024 * 1024);
// Cost calculation ($0.10 per GB standard cloud ingestion)
const cloudCostPerGB = 0.10;
const rawCloudCostPerDay = gbPerDay * cloudCostPerGB;
const edgeCloudCostPerDay = (edgeProcessedBytesPerDay / (1024 * 1024 * 1024)) * cloudCostPerGB;
const annualSavings = (rawCloudCostPerDay - edgeCloudCostPerDay) * 365;
// Architecture recommendation
let archRecommendation, archColor;
if (gbPerDay > 10) {
archRecommendation = "Edge Essential";
archColor = "#E74C3C";
} else if (gbPerDay > 1) {
archRecommendation = "Edge Recommended";
archColor = "#E67E22";
} else if (mbPerDay > 100) {
archRecommendation = "Edge or Cloud";
archColor = "#3498DB";
} else {
archRecommendation = "Cloud Acceptable";
archColor = "#16A085";
}
return {
bytesPerSecond: bytesPerSecond,
mbPerDay: mbPerDay,
gbPerDay: gbPerDay,
edgeProcessedMbPerDay: edgeProcessedMbPerDay,
rawCloudCostPerDay: rawCloudCostPerDay,
edgeCloudCostPerDay: edgeCloudCostPerDay,
annualSavings: annualSavings,
savingsMultiplier: edgeCompressionRatio,
archRecommendation: archRecommendation,
archColor: archColor
};
}html`
<div style="background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%); padding: 24px; border-radius: 8px; color: white; margin: 20px 0;">
<h3 style="margin-top: 0; color: #16A085; font-size: 1.3em;">Data Volume Analysis</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 16px;">
<div style="background: rgba(255,255,255,0.1); padding: 16px; border-radius: 6px; border-left: 4px solid #16A085;">
<div style="font-size: 0.85em; opacity: 0.9; margin-bottom: 4px;">Raw Data Volume</div>
<div style="font-size: 1.8em; font-weight: bold;">${dataVolumeCalculation.gbPerDay >= 1 ? `${dataVolumeCalculation.gbPerDay.toFixed(1)} GB/day` : `${dataVolumeCalculation.mbPerDay.toFixed(0)} MB/day`}</div>
<div style="font-size: 0.75em; opacity: 0.8; margin-top: 4px;">${(dataVolumeCalculation.bytesPerSecond/1024).toFixed(1)} KB/sec</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 16px; border-radius: 6px; border-left: 4px solid #E67E22;">
<div style="font-size: 0.85em; opacity: 0.9; margin-bottom: 4px;">After Edge Processing</div>
<div style="font-size: 1.8em; font-weight: bold;">${dataVolumeCalculation.edgeProcessedMbPerDay.toFixed(0)} MB/day</div>
<div style="font-size: 0.75em; opacity: 0.8; margin-top: 4px;">${edgeCompressionRatio}:1 compression</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 16px; border-radius: 6px; border-left: 4px solid #3498DB;">
<div style="font-size: 0.85em; opacity: 0.9; margin-bottom: 4px;">Annual Cloud Cost Savings</div>
<div style="font-size: 1.8em; font-weight: bold;">$${dataVolumeCalculation.annualSavings >= 1000 ? (dataVolumeCalculation.annualSavings/1000).toFixed(1) + 'K' : dataVolumeCalculation.annualSavings.toFixed(0)}</div>
<div style="font-size: 0.75em; opacity: 0.8; margin-top: 4px;">$${dataVolumeCalculation.rawCloudCostPerDay.toFixed(2)}/day to $${dataVolumeCalculation.edgeCloudCostPerDay.toFixed(2)}/day</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 16px; border-radius: 6px; border-left: 4px solid ${dataVolumeCalculation.archColor};">
<div style="font-size: 0.85em; opacity: 0.9; margin-bottom: 4px;">Architecture</div>
<div style="font-size: 1.4em; font-weight: bold; color: ${dataVolumeCalculation.archColor};">${dataVolumeCalculation.archRecommendation}</div>
</div>
</div>
<div style="margin-top: 20px; padding: 16px; background: rgba(22, 160, 133, 0.2); border-radius: 6px; border-left: 4px solid #16A085;">
<strong style="color: #16A085;">Economic Impact:</strong>
${dataVolumeCalculation.gbPerDay > 10 ? `At ${dataVolumeCalculation.gbPerDay.toFixed(1)} GB/day, edge processing saves \u0024${(dataVolumeCalculation.annualSavings/1000).toFixed(1)}K annually by reducing cloud data transfer ${edgeCompressionRatio}x. This makes edge computing economically essential, not just technically optimal.` : dataVolumeCalculation.annualSavings > 100 ? `Edge processing reduces annual cloud costs by \u0024${dataVolumeCalculation.annualSavings.toFixed(0)}, making the business case for edge infrastructure clear.` : `With only ${dataVolumeCalculation.mbPerDay.toFixed(0)} MB/day, cloud processing is economically viable. Edge computing would be for latency, not cost reasons.`}
</div>
</div>
`