MQTT is one of the most popular protocol when it comes to IoT and communications between nodes. It is based on the principe of publisher - subscriber. A broker, which can be seen as a server, is responsible to route all messages from a publisher to all registered subscribers. It provides advanced functions like a last will and testament options, as well as 3 different quality of service levels.
A MQTT system is composed at least of 3 nodes so that it is useful (well, a broker alone or a broker + publisher or even a broker + subscriber would definitely work, but it won’t really useful…) :
Broker : kind of the server, routes messages from publisher to subscriber(s), manages quality of services, …
publisher : typically a sensor, publishes data most likely formatted as a JSON string on a topic.
subscriber : get all messages of the topic(s) it is subscribed to, typically a node on the cloud that will store data in a database.
The topics are kind of communication channels that each client can subscribe to.