There are a number of factors to be considered when deciding between CoAP and MQTT protocols, and usually it is not an obvious or easy decision. However, there are noticeable differences between the two protocols:
This table summarises some of the main differences between CoAP and MQTT protocols.