Telemetry synchronization
ThingsBoard Edge stores all telemetry locally and pushes it to the server through rule chains. You control which data is synchronized, in which direction, and how it is stored on each side. This gives you precise control over bandwidth and data retention on the server.
For an overview of how telemetry synchronization works, see Telemetry synchronization.
Configuring attribute sync from Edge to the server
Section titled “Configuring attribute sync from Edge to the server”The default Edge Root Rule Chain already sends attribute changes to the server: the message type switch node routes Attributes Updated and Attributes Deleted to a push to cloud node, and Post attributes goes through Save Client Attributes to another push to cloud node. If you built your own Edge rule chain, add these connections. The Attributes scope field of the push to cloud node (Server attributes in the default chain) applies when the message does not carry its own scope: attributes that devices post arrive on the server as server attributes unless you change it to Client attributes.
Data storage on the server
Section titled “Data storage on the server”Which database tables the server updates depends on the save time series node in the server rule chain. In the node settings, under Processing settings, select Advanced and set the Latest values strategy:
| Latest values strategy | Tables updated | Use it when |
|---|---|---|
| On every message | ts_kv (history) and ts_kv_latest (latest values) |
Dashboards on the server must show the current device state next to historical charts. |
| Skip | ts_kv only; ts_kv_latest stays unchanged |
The server is used only for historical analysis or reporting, and the current state is monitored on Edge. |
Configuring attribute sync from the server to Edge
Section titled “Configuring attribute sync from the server to Edge”To send attribute changes from the server to Edge, add a push to edge node to the root rule chain of the server. Connect the message type switch node to it with the Attributes Updated and Attributes Deleted labels, then click Apply changes. The attribute scope is set in the Attributes scope field of the push to edge node.
Data storage on Edge
Section titled “Data storage on Edge”Edge always keeps a local copy of the data it receives from devices or from the server. This enables offline operation and local processing.
- When a device sends data to Edge: Edge writes the telemetry to its local database first. Then the rule chain decides whether to push it to the server through the push to cloud node. In the default Edge Root Rule Chain, the message type switch node routes Post telemetry to save time series, and save time series connects to push to cloud with the Success label, so every telemetry message is sent to the server. Remove or filter that connection to keep some data on the Edge only.
- When an Edge Event arrives from the server: The Edge rule chain processes the event and stores it according to the save time series node settings. The same two Latest values strategies apply as on the server: On every message writes to
ts_kvandts_kv_latest, which Edge dashboards need to show the current value next to historical data. Skip writes only tots_kv, which is enough for audit or logging scenarios where the current state is not needed locally.
Was this helpful?