"Polling" method (often called "short polling" method)
Imagine that you have a database somewhere in the internet cloud. In other words, we have a server on the Internet with a database and an application implemented there that allows reading or saving data.

Suppose you have access to this database. You and your device have the right to modify or read the data stored in the database. Usually you acquire this right when you register as the user of this database. During this process your device gets the unique ID.
How does the polling mechanism work?

The mechanism is based on a "client-server" model, where the client is always the initiator of the request. The IoT device has a proper client software application that periodically communicates with the database (e.g. every 1 second). These are very short server connections (HTTP requests). The IoT sends current data to the database and asks if there are any commands for it. The controlling device performs very similar operations. It is equipped with a client application also. The application read data from the database periodically (e.g. every 1 second). Moreover it sends commands to the database for the IoT device. Of course the commands can be sent at any time. For example, if you want to control a lamp, it is enough for your control application to connect to the database only when you want to turn the lamp on or off, it does not have to do more often.
Summarizing the presented method in a few words, it can be said that the easiest way to obtain up-to-date information from the server database is periodic server polling. For example, we can request up-to-date data once every 2 seconds. Along with the request for this service, we can also send data to the server.
While the polling method is the most basic way to solve the problem of communicating with IoT devices, its disadvantages are also obvious:
• the polling mode is not useful if you need to communicate with a device in real time (Data is passed with a delay dependent on time interval between subsequent requests sent to the server).
• this mode causes a lot of network traffic (Even if there are no new data, the server is constantly bombarded with requests).
Since the polling method is the most obvious way of communication, I have prepared a few examples of its use. A list of them is below.
Recommended sources and utilities:
• Internet of Things