replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

The question setting here is little bit misleading, because actually these protocols cannot at all be compared together. They are like TCP and IP, layers above each other. [1]

Websockets is a low level protocol to provide things that its 'competitor' RESTful http that is on same level does not provide: an always open channel without need for open and close on every request. [2]

MQTT provides a light weight way to publish or subscribe data. The confusion may be that those subscription are some sort of channels, but that is different type of channel. To make a constant open connection in MQTT you need Websockets AND MQTT at same time.

In IoT, as well in any design, you have to select if you need a stream or not (WebSockets vs RESTful) and about MQTT you may have to think whether you want a subscription and publishing mechanism on your app.

On some circumstances you may consider MQTT over WebSockets, if any common thing is around. [3]

Answer to the question:

You say you have a setup of a Rasperry Pi and several sensors around the place. If the sensors are far from Rasperry with their own controllers, you can use MQTT to collect the data. To store data to cloud, send the data in HTTP. In the cloud provide data through rest. [4]

For websockets there is no need, but if you find it useful, do use it.

Sources:

[1] https://www.quora.com/What-are-the-pros-and-cons-of-WebSockets-versus-MQTT-as-real-time-web-infrastructure-for-the-Internet-of-Things

[2] https://www.pubnub.com/blog/2015-01-05-websockets-vs-rest-api-understanding-the-difference/

[3] http://stackoverflow.com/questions/30624897/direct-mqtt-vs-mqtt-over-websockethttps://stackoverflow.com/questions/30624897/direct-mqtt-vs-mqtt-over-websocket

[4] http://www.theinternetofthings.eu/antonio-grasso-mqtt-vs-http-what-best-protocol-iot

The question setting here is little bit misleading, because actually these protocols cannot at all be compared together. They are like TCP and IP, layers above each other. [1]

Websockets is a low level protocol to provide things that its 'competitor' RESTful http that is on same level does not provide: an always open channel without need for open and close on every request. [2]

MQTT provides a light weight way to publish or subscribe data. The confusion may be that those subscription are some sort of channels, but that is different type of channel. To make a constant open connection in MQTT you need Websockets AND MQTT at same time.

In IoT, as well in any design, you have to select if you need a stream or not (WebSockets vs RESTful) and about MQTT you may have to think whether you want a subscription and publishing mechanism on your app.

On some circumstances you may consider MQTT over WebSockets, if any common thing is around. [3]

Answer to the question:

You say you have a setup of a Rasperry Pi and several sensors around the place. If the sensors are far from Rasperry with their own controllers, you can use MQTT to collect the data. To store data to cloud, send the data in HTTP. In the cloud provide data through rest. [4]

For websockets there is no need, but if you find it useful, do use it.

Sources:

[1] https://www.quora.com/What-are-the-pros-and-cons-of-WebSockets-versus-MQTT-as-real-time-web-infrastructure-for-the-Internet-of-Things

[2] https://www.pubnub.com/blog/2015-01-05-websockets-vs-rest-api-understanding-the-difference/

[3] http://stackoverflow.com/questions/30624897/direct-mqtt-vs-mqtt-over-websocket

[4] http://www.theinternetofthings.eu/antonio-grasso-mqtt-vs-http-what-best-protocol-iot

The question setting here is little bit misleading, because actually these protocols cannot at all be compared together. They are like TCP and IP, layers above each other. [1]

Websockets is a low level protocol to provide things that its 'competitor' RESTful http that is on same level does not provide: an always open channel without need for open and close on every request. [2]

MQTT provides a light weight way to publish or subscribe data. The confusion may be that those subscription are some sort of channels, but that is different type of channel. To make a constant open connection in MQTT you need Websockets AND MQTT at same time.

In IoT, as well in any design, you have to select if you need a stream or not (WebSockets vs RESTful) and about MQTT you may have to think whether you want a subscription and publishing mechanism on your app.

On some circumstances you may consider MQTT over WebSockets, if any common thing is around. [3]

Answer to the question:

You say you have a setup of a Rasperry Pi and several sensors around the place. If the sensors are far from Rasperry with their own controllers, you can use MQTT to collect the data. To store data to cloud, send the data in HTTP. In the cloud provide data through rest. [4]

For websockets there is no need, but if you find it useful, do use it.

Sources:

[1] https://www.quora.com/What-are-the-pros-and-cons-of-WebSockets-versus-MQTT-as-real-time-web-infrastructure-for-the-Internet-of-Things

[2] https://www.pubnub.com/blog/2015-01-05-websockets-vs-rest-api-understanding-the-difference/

[3] https://stackoverflow.com/questions/30624897/direct-mqtt-vs-mqtt-over-websocket

[4] http://www.theinternetofthings.eu/antonio-grasso-mqtt-vs-http-what-best-protocol-iot

added 460 characters in body; added 4 characters in body
Source Link
mico
  • 4.3k
  • 1
  • 14
  • 27

The question setting here is little bit misleading, because actually these protocols cannot at all be compared together. They are like TCP and IP, layers above each other. [1]

Websockets is a low level protocol to provide things that its 'competitor' RESTful http that is on same level does not provide: an always open channel without need for open and close on every request. [2]

MQTT provides a light weight way to publish or subscribe data. The confusion may be that those subscription are some sort of channels, but that is different type of channel. To make a constant open connection in MQTT you need Websockets AND MQTT at same time.

In IoT, as well in any design, you have to select if you need a stream or not (WebSockets vs RESTful) and about MQTT you may have to think whether you want a subscription and publishing mechanism on your app.

On some circumstances you may consider MQTT over WebSockets, if any common thing is around. [3]

Answer to the question:

You say you have a setup of a Rasperry Pi and several sensors around the place. If the sensors are far from Rasperry with their own controllers, you can use MQTT to collect the data. To store data to cloud, send the data in HTTP. In the cloud provide data through rest. [4]

For websockets there is no need, but if you find it useful, do use it.

Sources:

[1] https://www.quora.com/What-are-the-pros-and-cons-of-WebSockets-versus-MQTT-as-real-time-web-infrastructure-for-the-Internet-of-Things

[2] https://www.pubnub.com/blog/2015-01-05-websockets-vs-rest-api-understanding-the-difference/

[3] http://stackoverflow.com/questions/30624897/direct-mqtt-vs-mqtt-over-websocket

[4] http://www.theinternetofthings.eu/antonio-grasso-mqtt-vs-http-what-best-protocol-iot

The question setting here is little bit misleading, because actually these protocols cannot at all be compared together. They are like TCP and IP, layers above each other. [1]

Websockets is a low level protocol to provide things that its 'competitor' RESTful http that is on same level does not provide: an always open channel without need for open and close on every request. [2]

MQTT provides a light weight way to publish or subscribe data. The confusion may be that those subscription are some sort of channels, but that is different type of channel. To make a constant open connection in MQTT you need Websockets AND MQTT at same time.

In IoT, as well in any design, you have to select if you need a stream or not (WebSockets vs RESTful) and about MQTT you may have to think whether you want a subscription and publishing mechanism on your app.

On some circumstances you may consider MQTT over WebSockets, if any common thing is around. [3]

Sources:

[1] https://www.quora.com/What-are-the-pros-and-cons-of-WebSockets-versus-MQTT-as-real-time-web-infrastructure-for-the-Internet-of-Things

[2] https://www.pubnub.com/blog/2015-01-05-websockets-vs-rest-api-understanding-the-difference/

[3] http://stackoverflow.com/questions/30624897/direct-mqtt-vs-mqtt-over-websocket

The question setting here is little bit misleading, because actually these protocols cannot at all be compared together. They are like TCP and IP, layers above each other. [1]

Websockets is a low level protocol to provide things that its 'competitor' RESTful http that is on same level does not provide: an always open channel without need for open and close on every request. [2]

MQTT provides a light weight way to publish or subscribe data. The confusion may be that those subscription are some sort of channels, but that is different type of channel. To make a constant open connection in MQTT you need Websockets AND MQTT at same time.

In IoT, as well in any design, you have to select if you need a stream or not (WebSockets vs RESTful) and about MQTT you may have to think whether you want a subscription and publishing mechanism on your app.

On some circumstances you may consider MQTT over WebSockets, if any common thing is around. [3]

Answer to the question:

You say you have a setup of a Rasperry Pi and several sensors around the place. If the sensors are far from Rasperry with their own controllers, you can use MQTT to collect the data. To store data to cloud, send the data in HTTP. In the cloud provide data through rest. [4]

For websockets there is no need, but if you find it useful, do use it.

Sources:

[1] https://www.quora.com/What-are-the-pros-and-cons-of-WebSockets-versus-MQTT-as-real-time-web-infrastructure-for-the-Internet-of-Things

[2] https://www.pubnub.com/blog/2015-01-05-websockets-vs-rest-api-understanding-the-difference/

[3] http://stackoverflow.com/questions/30624897/direct-mqtt-vs-mqtt-over-websocket

[4] http://www.theinternetofthings.eu/antonio-grasso-mqtt-vs-http-what-best-protocol-iot

Source Link
mico
  • 4.3k
  • 1
  • 14
  • 27

The question setting here is little bit misleading, because actually these protocols cannot at all be compared together. They are like TCP and IP, layers above each other. [1]

Websockets is a low level protocol to provide things that its 'competitor' RESTful http that is on same level does not provide: an always open channel without need for open and close on every request. [2]

MQTT provides a light weight way to publish or subscribe data. The confusion may be that those subscription are some sort of channels, but that is different type of channel. To make a constant open connection in MQTT you need Websockets AND MQTT at same time.

In IoT, as well in any design, you have to select if you need a stream or not (WebSockets vs RESTful) and about MQTT you may have to think whether you want a subscription and publishing mechanism on your app.

On some circumstances you may consider MQTT over WebSockets, if any common thing is around. [3]

Sources:

[1] https://www.quora.com/What-are-the-pros-and-cons-of-WebSockets-versus-MQTT-as-real-time-web-infrastructure-for-the-Internet-of-Things

[2] https://www.pubnub.com/blog/2015-01-05-websockets-vs-rest-api-understanding-the-difference/

[3] http://stackoverflow.com/questions/30624897/direct-mqtt-vs-mqtt-over-websocket