Recommendation: CBOR (with Binary as alternative for extreme constraints)
Analysis by factor:
1. Bandwidth/Cost: - Binary is smallest (576 KB/day) but CBOR (2.6 MB/day) is acceptable for Wi-Fi - If using cellular IoT (paid per MB), Binary saves ~$2/month vs CBOR
2. Development Time: - JSON: Fastest development, easy debugging - CBOR: Moderate (libraries available for most platforms) - Binary: Longest development, custom parsing code needed
3. Interoperability: - JSON: Universal, any system can parse - CBOR: Standardized (RFC 8949), growing IoT adoption - Binary: Proprietary, requires documentation
4. Debuggability: - JSON: Human-readable, easy to troubleshoot - CBOR: Can convert to JSON for debugging - Binary: Requires hex dump analysis, error-prone
5. Schema Evolution: - JSON/CBOR: Easy to add new fields without breaking parsers - Binary: Version byte needed, all endpoints must update together
Key insight: Format choice isn’t just about bytes—consider the full development lifecycle including debugging, maintenance, and future requirements.