Scenario: A logistics company operates 10,000 delivery trucks with GPS trackers reporting every 30 seconds. Backend dashboard shows real-time locations, route optimization service processes historical tracks, and compliance system logs all movements.
Calculating 5-year TCO (cellular data at $0.05/MB):
Option A: HTTP REST polling (baseline):
Payload: JSON {"lat": 37.7749, "lon": -122.4194, "speed": 45, "timestamp": 1706140800}
HTTP overhead: ~320 bytes (headers + JSON) per request
Messages: 10,000 trucks × 2,880/day = 28.8M messages/day
Monthly data: 28.8M × 320 bytes × 30 days = 276 GB/month
Monthly cost: 276 GB × $0.05/MB × 1024 = $14,131/month
5-year cost: $14,131 × 60 = $847,860
Option B: MQTT (QoS 1, persistent sessions):
Payload: JSON (same 90 bytes), MQTT header 2 bytes, topic 20 bytes
Total: 112 bytes per message
TCP handshake amortized over 2,880 daily messages: 180 bytes / 2,880 = 0.06 bytes/message
Monthly data: 28.8M × 112 × 30 = 96.8 GB/month
Monthly cost: 96.8 GB × $51.20 = $4,956/month
5-year cost: $4,956 × 60 = $297,360
Option C: CoAP (NON messages, CBOR payload):
Payload: CBOR {lat: 37.7749, lon: -122.4194, spd: 45, ts: 1706140800} = 28 bytes
CoAP header: 4 bytes, UDP: 8 bytes, IPv6: 40 bytes
Total: 80 bytes per message (no connection setup)
Monthly data: 28.8M × 80 × 30 = 69.1 GB/month
Monthly cost: 69.1 × $51.20 = $3,538/month
5-year cost: $3,538 × 60 = $212,280
Decision: CoAP with CBOR
Savings vs HTTP: $847,860 - $212,280 = $635,580 over 5 years Savings vs MQTT: $297,360 - $212,280 = $85,080 over 5 years
Additional benefits:
- Battery backup in trucks lasts 18 hours (CoAP) vs 8 hours (MQTT) during alternator failure
- No broker infrastructure cost (MQTT would require $500/month for 10K concurrent connections)
- Multicast fleet-wide commands:
coap://[ff02::fd]/command/update reaches all trucks on subnet