MQTT vs HTTP for IoT device connectivity: What are the real tradeoffs in production environments?

We’re designing a new IoT deployment with 1,000+ sensors and trying to decide between MQTT and HTTP for device connectivity to Cloud IoT Core. I’ve read the documentation, but looking for real-world experiences.

Our use case: Battery-powered environmental sensors sending readings every 5 minutes. Network conditions vary from excellent WiFi to spotty 3G/4G. Data payload is small (50-100 bytes per message).

MQTT seems better for publish-subscribe patterns and connection persistence, but HTTP is simpler to implement and debug. What have people found regarding bandwidth efficiency, battery consumption, and connection reliability in production deployments? Are there specific scenarios where one protocol significantly outperforms the other?

Consider your scaling plans too. MQTT persistent connections mean your Cloud IoT Core registry needs to handle 1,000+ concurrent connections. This is fine for Cloud IoT Core (designed for this), but impacts your connection limits and costs. HTTP is stateless so scaling is more predictable. That said, MQTT’s connection reuse means fewer authentication handshakes, which reduces latency for subsequent messages by 200-500ms compared to HTTP’s per-request authentication.

Connection persistence is where MQTT really shines, especially on spotty networks. With HTTP, every network hiccup means reconnection overhead. MQTT’s persistent connection with QoS levels handles intermittent connectivity gracefully. However, HTTP is stateless which makes it easier to scale horizontally and debug. If your sensors have reliable connectivity and you value simplicity over efficiency, HTTP might be acceptable. But for battery-powered devices on cellular, MQTT is the clear choice.

From battery consumption perspective, MQTT wins hands down for your use case. HTTP requires establishing a new TCP connection for each message (unless you implement connection pooling), which is expensive on cellular networks. MQTT maintains a persistent connection with minimal overhead. In our testing with similar battery-powered sensors, MQTT devices lasted 40% longer than HTTP-based ones. The keep-alive mechanism is far more efficient than reconnecting every 5 minutes.

Bandwidth efficiency strongly favors MQTT for small payloads. HTTP has significant overhead - headers alone are typically 200-400 bytes per request. For your 50-100 byte payload, you’re sending 3-8x more data than necessary. MQTT headers are 2-4 bytes. Over cellular networks where data costs money, this adds up quickly. We calculated ~$12/month per device savings on cellular data when we switched from HTTP to MQTT for 500 sensors.

After deploying both protocols in production IoT systems, here’s my comprehensive analysis:

MQTT Publish-Subscribe: Pub-sub model is MQTT’s killer feature. Devices subscribe to topics and receive messages pushed from the server without polling. This is transformative for command-and-control scenarios. Your sensors can receive configuration updates, firmware notifications, or operational commands instantly without wasting battery on polling. HTTP requires request-response, so devices must periodically GET a commands endpoint, consuming battery even when no commands exist.

HTTP Request-Response: HTTP’s stateless request-response is simpler to reason about and debug. Each message is independent, which makes error handling straightforward. If a request fails, retry it. With MQTT, connection state management is more complex - you need to handle disconnection, reconnection, and message queue management. However, this complexity is largely handled by mature MQTT libraries.

Bandwidth Efficiency: The numbers are stark for small payloads:

  • MQTT: 2-4 byte header + payload = 52-104 bytes total
  • HTTP: 200-400 byte header + payload = 250-500 bytes total

For your 50-100 byte payload, MQTT uses 5-10x less bandwidth. At 1,000 devices sending every 5 minutes (288 messages/day/device), that’s:

  • MQTT: ~30MB/day total
  • HTTP: ~150MB/day total

On cellular networks at $0.10/MB, you’re looking at $3/day vs $15/day - $4,380/year savings with MQTT.

Battery Consumption: Battery life differences are dramatic:

  • HTTP: Each message requires TCP handshake (3 packets), TLS handshake (4-6 packets), HTTP request/response (2 packets), TCP teardown (4 packets) = 13-15 packets per message
  • MQTT: Initial connection (handshake once), then 2 packets per message (publish + ack)

Radio power consumption dominates battery usage. Reducing packet count by 6-7x translates to 30-50% longer battery life in real deployments. For battery-powered sensors, this is the difference between 2-year and 3-year battery life.

Connection Persistence: MQTT persistent connections handle network instability gracefully. When connectivity drops:

  • MQTT: Connection state maintained, messages queued (QoS 1/2), automatic reconnection with session resume
  • HTTP: Each message is independent, requires full reconnection and authentication, no built-in queueing

On spotty 3G/4G, MQTT’s resilience is invaluable. We measured 15% message loss with HTTP on poor networks vs <2% with MQTT QoS 1.

Latency Considerations: MQTT has lower latency for subsequent messages:

  • First message: MQTT and HTTP similar (~500ms including authentication)
  • Subsequent messages: MQTT ~50ms, HTTP ~300ms (due to connection reestablishment)

For your 5-minute interval, latency difference is negligible. But for real-time alerts or high-frequency sensors, MQTT’s advantage grows.

Implementation Complexity: Both protocols have excellent client library support:

  • MQTT: Paho (Python, Java, C), Eclipse Mosquitto
  • HTTP: Standard libraries in all languages

Implementation effort is comparable. MQTT requires understanding QoS levels and connection management, but this is well-documented. HTTP is more familiar to web developers but requires implementing retry logic and message queueing manually.

Operational Considerations:

  • Debugging: HTTP easier (curl, Postman, browser dev tools), MQTT requires MQTT clients (mqtt-spy, MQTT Explorer)
  • Monitoring: Both well-supported in Cloud IoT Core metrics
  • Scaling: MQTT requires connection limit planning, HTTP scales more predictably
  • Security: Both support TLS, certificate-based auth equally secure

Recommendation for Your Use Case: For battery-powered sensors on variable network conditions sending small payloads, MQTT is the clear winner:

  • 30-50% longer battery life
  • 80% bandwidth reduction
  • Better handling of network instability
  • Bidirectional communication for device management
  • Lower operational costs (cellular data)

HTTP makes sense when:

  • Devices have reliable power (wall-powered)
  • Network is consistently excellent
  • Team has limited MQTT expertise and can’t invest in learning
  • Integration with existing HTTP-based systems is critical
  • Payloads are large (>1KB) where header overhead is negligible

For 1,000+ battery-powered sensors on cellular, the efficiency gains of MQTT far outweigh the slightly higher learning curve. The bandwidth and battery savings will pay for the implementation effort within the first year.