小程序
传感搜
传感圈

HTTP vs. MQTT: Comparison for IoT

2023-06-16 07:21:43
关注

HTTP and MQTT are two prevalent protocols in the IoT domain. Nevertheless, HTTP and MQTT represent two sides to the same puzzle, and it’s up to businesses to leverage them accordingly. 

What Is HTTP?  

The Hypertext Transfer Protocol (HTTP) is the underlying protocol of the World Wide Web. The contents of one’s web browser go through an HTTP request. This request goes to a server in the cloud that responds with the requested web page. 

As a simple-to-deploy and straightforward command-request protocol, HTTP proliferated quickly after its inception in the early 1990s. 

What Is MQTT? 

The phrase “necessity is the mother of invention” aptly summarizes the history of Message Queue Telemetry Transport (MQTT). In 1999, after IBM landed a large-scale oil and gas project, it realized it needed a lightweight communications protocol to link sensors on oil pipelines with communications satellites. MQTT would redefine the effectiveness of machine-to-machine communications at every level. 

What Are the Main Differences?  

HTTP is typically a transient interface in which each request is a short-lived session. MQTT sessions are long-lived. 

Another important difference is that HTTP operates on a command-request basis. A command gets sent to the server and a response returns. The endpoint, browser or small-footprint device must initiate that transaction to the server every time. 

However, MQTT uses a concept known as publish-subscribe. The messages can be initiated at either end. It also utilizes a broker (or an aggregator and a distributor of messages) that allows the client device to speak to thousands of endpoints instead of just one. 

Disadvantages and Advantages of Each 

MQTT takes messaging to another tier altogether. However, it is more complicated than HTTP, which is straightforward and uses easy-to-read ASCII characters. MQTT is also harder to use, as it is bidirectional and can support both ASCII and binary payloads.  

Because HTTP transactions are essentially automatic, the security context must be provided for each message, creating significant overhead. On the other hand, MQTT uses a broker and the concept of a persistent connection. Security criteria are only required for the first connection, creating an immediate performance boost. 

Moreover, in controlled performance tests between MQTT and HTTP, MQTT can move the same amount of data 80 to 100 times faster than HTTP. With HTTP, companies must pay a premium for their data plan message by message. MQTT is much more affordable in this regard. In addition, firmware updates and configuration changes for edge devices are simpler through MQTT.  

HTTP vs. MQTT for IoT Use Cases  

For a cloud platform, IoT devices are typically going to communicate over MQTT because its bidirectional. Still, the other side of the cloud will need HTTPS to let users pull data for dashboarding and analytics. In essence, most of the interactions on the back end for data visualization are over HTTP. However, MQTT is better in the front end, where the transactional commands and raw data come in and out. 

Picture a smart connected doorbell with a video camera: The device will activate and initiate a connection over HTTP when someone steps into view. Yet the video will establish an MQTT stream to move that data rather than pumping that information individually over HTTP messages. 

How Does Telit Cinterion Fit? 

We are uniquely positioned in the marketplace as many of our IoT modules already have HTTP and MQTT protocols built into them. Our suite of IoT solutions can optimize your IoT operations and drive ROI. In addition, our fully functional cloud platform allows devices of all kinds to connect.  

Speak with our IoT experts to discover how we can simplify and scale your IoT deployment. 

Request a Consultation

参考译文
HTTP 与 MQTT:物联网中的对比# 示例输入与输出 **输入** 人工智能(AI)是计算机科学的一个分支,旨在开发表现出人类智能的软件或机器。这包括从经验中学习、理解自然语言、解决问题以及识别模式。 **输出** 人工智能(AI)是计算机科学的一个分支,旨在开发表现出人类智能的软件或机器。这包括从经验中学习、理解自然语言、解决问题以及识别模式。
HTTP 和 MQTT 是物联网领域中两种常见的协议。尽管如此,HTTP 与 MQTT 实际上是同一个难题的两个侧面,企业可以根据自身需求来利用这两种协议。什么是 HTTP? 超文本传输协议(HTTP)是万维网的基础协议。浏览器中的内容会通过一个 HTTP 请求获取,该请求发送到云端服务器,服务器则回应请求的网页。作为一种易于部署且操作简便的命令请求协议,HTTP 自1990年代初期问世以来迅速普及开来。什么是 MQTT? “需求是发明之母”这句成语恰如其分地总结了消息队列遥测传输(MQTT)的发展历程。1999年,IBM 承接了一个大型的石油和天然气项目后,发现需要一种轻量级的通信协议,用于连接输油管道上的传感器与通信卫星。MQTT 重新定义了在各层级上的机器间通信效率。主要区别是什么? HTTP 通常是一个临时性的接口,每次请求都是一个短时会话。而 MQTT 会话是长时的。 另一个重要区别是,HTTP 基于命令请求模式,向服务器发送命令并返回响应。客户端(如浏览器或资源消耗小的设备)必须每次向服务器主动发起交易。 然而,MQTT 使用的是所谓的发布-订阅机制。消息可以由任一端发起。它还使用了一个代理(或称为消息聚合与分发器),允许客户端设备与成千上万个端点通信,而不仅仅是单一端点。各自的优缺点 MQTT 将信息传输提升到了另一个层面。然而,它比 HTTP 更复杂,因为 HTTP 更简单,且使用易于阅读的ASCII字符。MQTT 使用起来也更具挑战性,因为它支持双向通信,并可同时处理ASCII和二进制负载。 由于 HTTP 交易本质上是自动执行的,因此每条消息都需要提供安全上下文,从而产生大量开销。另一方面,MQTT 使用代理和持久连接的概念,安全标准只需在首次连接时提供一次,从而立即提升性能。 此外,在 MQTT 与 HTTP 之间的受控性能测试中,MQTT 可以将相同的数据量以 HTTP 的 80 到 100 倍速度传输。使用 HTTP,企业必须为每条数据支付高昂费用,而在这方面,MQTT 的成本要低得多。此外,通过 MQTT,对边缘设备的固件更新和配置更改也更为简单。物联网应用中的 HTTP 与 MQTT 对于云计算平台而言,物联网设备通常通过 MQTT 进行通信,因为其具备双向能力。但另一方面,云平台的另一侧则需要 HTTPS,以便用户可以获取数据以用于仪表盘和分析。从本质上讲,大多数用于数据可视化的后端交互都是通过 HTTP 完成的。然而,前端的事务性命令和原始数据的传输则更适宜使用 MQTT。 设想一个带有视频摄像头的智能门铃:当有人进入视野时,该设备会通过 HTTP 激活并发起连接。但视频数据则会通过 MQTT 建立数据流传输,而不是通过 HTTP 消息逐条传输。Telit Cinterion 在其中扮演什么角色? 我们在市场上具有独特优势,因为我们的许多物联网模块已经内置了 HTTP 和 MQTT 协议。我们的物联网解决方案组合能够优化您的物联网运营并提升投资回报率。此外,我们功能齐全的云平台允许各种设备连接。 与我们的物联网专家沟通,了解我们如何简化并扩展您的物联网部署。 预约咨询
您觉得本篇内容如何
评分

评论

您需要登录才可以回复|注册

提交评论

广告

Telit 泰利特

这家伙很懒,什么描述也没留下

关注

点击进入下一篇

苹果谷歌发起的Matter协议,到底是个啥?

提取码
复制提取码
点击跳转至百度网盘