Relationship between service resources
Data is exchanged via MQTT version 3.1.1. This simplified network protocol for device communication is based on the publisher/subscriber pattern.
For devices and registries to begin exchanging data and commands, you need to log in. You can do this using X.509 certificates or your username and password.
A device is an instance of a physical device, such as a temperature sensor, represented in the service as the device name and its certificate.
Devices are created in a registry. They can send telemetry data to the server, get commands, and interact with other devices in the registry.
A registry is a set of devices that are logically related to each other. Registries can read device data and send commands to them.
The MQTT broker is the central node for exchanging MQTT messages between devices and registries. Data is only exchanged through the broker. It's responsible for receiving and processing messages and controls their delivery to MQTT clients (devices or registries) to ensure the necessary QoS.
MQTT clients are devices and registries that exchange messages containing data or commands. Each message includes a topic, which is a message subject used to classify data and identify the client this data is intended for.
To make sure devices and registries receive each other's messages via the MQTT broker, subscribe them to the appropriate topics.
If you have devices with sensor readings that you need to quickly respond to and you may face network communication problems and a broken connection between your devices and the MQTT broker, you can subscribe your devices and registries to permanent topics.
For example, use permanent topics for temperature sensors on devices that need to be turned off quickly when heated to a certain temperature.
When exchanging messages, Yandex IoT Core supports the following quality of service (QoS) levels for MQTT:
QoS 0: At most once. A message is sent no more than once and there is no guarantee of delivery.
QoS 1: At least once. This level guarantees that a message is delivered to a client at least once. There is a chance of receiving duplicate messages.
For more information about Yandex IoT Core service limits, see Quotas and limits.