AMQP · Study deck

MQTT and AMQP: Operational Tradeoffs

MQTT and AMQP are not rivals so much as tools for different parts of the route.

Broker Bex is your guide for this deck.

mqttcases
Broker Bex, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Compare AMQP and MQTT: Evaluate the strengths and weaknesses of each protocol for IoT scenarios
  • Select Appropriate Protocols: Justify the choice between AMQP, MQTT, and CoAP based on quantified application requirements
  • Design Hybrid Architectures: Construct systems that use MQTT for devices and AMQP for backend integration, specifying the protocol bridge configuration
  • Evaluate Protocol Overhead: Calculate message size, bandwidth consumption, and cost trade-offs for competing protocol choices
iotclass.org

Major section

In 60 Seconds

The reading may be replaced by a newer one.

  • The repair order must be kept, routed to the right team, and marked when work is complete.
  • The two services use different sets of message rules.
  • The system designer should not choose from a feature list alone.
  • A live room reading may favour a light path and the newest value.
iotclass.org

Major section

In 60 Seconds (continued)

A work order may need a durable waiting place and a clear final result.

  • They should know which message was sent, which receiver was stopped, what remained after restart, and which result counts as a pass.
  • If they cannot reproduce it, the design claim is too broad.
  • A status fact can become a work request.
iotclass.org

Major section

In 60 Seconds (continued)

In practice, many IoT architectures use both: MQTT at the device edge for sensor telemetry and AMQP in the backend for reliable message routing between services.

  • This order makes it clear which new need caused a more complex choice.
  • A one-user test can become a shared service.
  • This simple comparison leaves out many delivery and routing options.
iotclass.org

Major section

Phoebe's Field Notes: 5000 mAh Is Not One Number of Watt-Hours

The mathematical gist.: A 5000 mAh label states charge, not energy: multiply 5 Ah by voltage to obtain watt-hours.

  • At 3.70 V the pack stores 18.5 Wh, while at 1.20 V it stores 6.00 Wh.
  • The chapter's protocol comparison is different.

Numbers to remember

3.70 VAt 3.70 V the pack stores 18.5 Wh
18.5 WhAt 3.70 V the pack stores 18.5 Wh
1.20 Vwhile at 1.20 V it stores 6.00 Wh.
iotclass.org

Major section

AMQP vs MQTT Showdown

"Which is better -- AMQP or MQTT?" asked Temperature Terry. The microcontroller shook his head. "Wrong question, Sammy!

  • It's like asking whether a bicycle or a truck is better.
  • It depends on what you need to carry!".
  • Max summed it up: "Use MQTT for simple sensor-to-cloud communication where battery life matters.

Why it matters

A tiny temperature sensor with limited battery can use MQTT because the messages are small and the protocol is simple.

iotclass.org

Major section

AMQP vs MQTT Showdown (continued)

"MQTT is like a bicycle," explained the LED. "It's lightweight, simple, and perfect for quick trips.

  • "AMQP is like a delivery truck," added the battery. "It's heavier and more complex, but it can route packages to dozens of different warehouses using exchange rules.
  • If you need a message to go to exactly three specific systems based on complicated rules -- like 'all temperature alerts above 50 degrees on floor 2' -- AMQP handles that on the server side.".
  • Many real IoT platforms actually use both -- MQTT at the edge, AMQP in the backend!".
iotclass.org

Major section

Protocol Selection Decision Tree

The chosen leaf should therefore be recorded with the constraint that caused it and revisited when that constraint changes.

  • MQTT excels at scale and simplicity, while AMQP provides rich enterprise features like routing and transactions.
Decision tree for selecting between MQTT and AMQP protocols based on device constraints, routing complexity, and transaction requirements
Decision tree for selecting between MQTT and AMQP protocols based on device constraints, routing complexity, and transaction requirements
iotclass.org

Deck summary

Key takeaways

The reading may be replaced by a newer one.

  • A work order may need a durable waiting place and a clear final result.
  • In practice, many IoT architectures use both: MQTT at the device edge for sensor telemetry and AMQP in the backend for reliable message routing between services.
  • The mathematical gist.: A 5000 mAh label states charge, not energy: multiply 5 Ah by voltage to obtain watt-hours.
  • "Which is better -- AMQP or MQTT?" asked Temperature Terry. The microcontroller shook his head. "Wrong question, Sammy!
iotclass.org

Retrieval practice

Recall check 1 of 2

Broker Bex says: answer from memory, then check your reasoning.

Q1Per this chapter's Common Misconception section, what is the key difference between MQTT QoS 2 and AMQP transactions?

AMQTT QoS 2 guarantees exactly-once, duplicate-free delivery to the broker, but offers no atomicity or rollback if processing fails after receipt; AMQP transactions provide atomic commit/rollback across multiple operations
BMQTT QoS 2 and AMQP transactions are functionally identical -- both roll back automatically on any processing failure
CAMQP transactions only guarantee delivery to the broker, while MQTT QoS 2 provides atomic commit/rollback across services
DNeither MQTT QoS 2 nor AMQP transactions offer any delivery guarantee; both require the application to implement retries manually
Show answer

Answer: A MQTT QoS 2's exactly-once handshake only protects the hop from device to broker.

iotclass.org

Retrieval practice

Recall check 2 of 2

Broker Bex says: answer from memory, then check your reasoning.

Q2A developer says: 'I'll use AMQP for my 20,000 water meter sensors because it has better QoS than MQTT.' Based on the comparison table above, which specific characteristic makes this choice problematic?

AAMQP has no QoS levels at all, so it cannot offer the delivery guarantees MQTT provides for meter readings
BAMQP's 8-byte frame header and feature-rich complexity make it poorly suited for high-volume telemetry
CMQTT cannot connect to cloud brokers and only reaches local brokers, so 20,000 meters cannot reach a cloud backend
DAMQP and MQTT have identical overhead, so the choice makes no practical difference
Show answer

Answer: B The comparison table highlights two critical mismatches: AMQP's 8-byte frame header versus MQTT's 2-byte minimum, and AMQP's 'feature-rich' complexity versus MQTT's 'simple' design.

iotclass.org

Print reference

Answers

Answer key.

  1. A · MQTT QoS 2's exactly-once handshake only protects the hop from device to broker.
  2. B · The comparison table highlights two critical mismatches: AMQP's 8-byte frame header versus MQTT's 2-byte minimum, and AMQP's 'feature-rich' complexity versus MQTT's 'simple' design.
iotclass.org