
Introduction
The equipment is back to normal. But what happened before it recovered? Without historical records, teams may know the machine's current status but have no reliable way to reconstruct what happened during an incident.
For teams already using MQTT or EMQX Cloud, adding historical data storage and SQL queries shouldn't have to mean deploying and maintaining a separate time-series database. EMQX Tables provides a managed way to persist MQTT telemetry and make it available for historical analysis, extending existing data workflows to support applications.
This blog demonstrates how EMQX Tables helps teams turn MQTT device data into queryable history, investigate equipment anomalies, compare machine performance, and visualize trends in Grafana.
How Do You Reconstruct an Anomaly After the Equipment Recovers?
Consider a simulated production line with four machines. One of them, EXPO-M100, experiences a sharp temperature increase before eventually returning to around 50°C.
The operations team now faces the following questions:
- Was this a brief fluctuation or a recurring period of high temperature?
- Did other machines heat up at the same time?
Neither the latest reading nor a single alarm screenshot can reconstruct the sequence.
This is where queryable device history becomes valuable. It helps teams identify affected machines, understand when abnormal conditions occurred, and determine where to investigate first. It also provides the data foundation for historical charts, operational reports, and downstream applications.
Why MQTT Messaging Alone Isn't Enough for Historical Analysis
MQTT handles message transport. Answering questions later also requires a storage destination, organized fields, and a query interface. Receiving a message at the Broker does not mean its complete history has been stored.
Building this capability independently typically involves connecting an MQTT Broker to a database through a data pipeline, then maintaining the infrastructure, field mappings, and integration logic. This approach offers flexibility but adds operational work, particularly when teams simply need to retain and query equipment telemetry such as temperature and vibration.
EMQX Tables provides a managed alternative. Through EMQX Cloud data integration, teams can persist MQTT data in time-series storage and query historical records using SQL, without deploying and operating a separate time-series database.
Data consistency matters just as much as storage. Equipment identifiers must remain consistent, measurements must use standardized units, and queries and visualizations must apply matching time boundaries. Otherwise, different applications may display individually valid results that cannot be reliably compared.
Demo: From MQTT Messages to Queryable Time-Series Data
We will use a demonstration to show how these pieces work together, from MQTT message ingestion to historical queries and application-level visualization.
The demonstration uses an EMQX Tables Starter test deployment in the international environment on AWS in N. Virginia (us-east-1). A simulator generates the data, which passes through actual running instances of EMQX Neuron and EMQX Broker before entering EMQX Tables.
The process has three main stages:
- Message processing: Device MQTT messages enter EMQX Broker. The rule engine selects relevant topics and extracts and maps the required fields.
- Data persistence: Data integration forwards the processed records to EMQX Tables, where they are stored as time-series data.
- Data access: Applications query the stored records using SQL, while EMQX Cloud provides the interface for managing the Tables deployment and exploring the data.

Figure 1: Data flow illustration
The demonstration stores telemetry in the unified_demo_metrics table. Each record contains the following fields:
machine_id: Identifies the source machine.temperature: Temperature readings in °C.vibration: Vibration readings in mm/s.timestamp: The time field used for queries.source_ts: Preserves the original collection timestamp.
Consistent fields let different applications read the same history instead of each storing its own copy of the messages.
Three Questions Your Device History Can Answer
Once device history is available, teams can move beyond checking the latest readings and start asking more meaningful questions about equipment behavior.
For this demonstration:
- What happened to M100 during this period?
By filtering records by machine ID and time range, then sorting them chronologically, the team can reconstruct M100's temperature history. The results reveal two distinct high-temperature periods, with lower readings between and after them.
Looking at the full sequence rather than just the latest reading makes it possible to identify recurring anomalies and understand how equipment conditions changed over time.
- Did the other machines behave the same way?
Other machines average approximately 51–53°C over the same period, while M100 runs substantially hotter and peaks at 90°C.
SQL calculates average and peak temperatures by machine, allowing the team to compare equipment within the same time window and prioritize M100 instead of inspecting the whole production line one machine at a time.
- Which observations meet the demonstration threshold?
Applying a demonstration threshold of 80°C identifies records across the two high-temperature periods.
The team can then examine vibration readings over the same intervals to see whether temperature changes coincide with other equipment behavior.
This illustrates how conditional filtering can narrow a large dataset to the records most relevant to an investigation. The 80°C threshold is used for demonstration purposes and does not represent an equipment safety standard.

Figure 2: Actual Tables Data Explorer threshold query
In the shared window, M100 temperature is filtered at ≥80°C.
matched_records=124means 124 underlying records match;Total 1means the query returns one summary row. Temperature is in °C and vibration in mm/s.

Figure 3: Actual Tables Data Explorer machine comparison
Each of the four machines has 262 records.
avg_temp_candpeak_temp_cshow average and peak temperature in °C. The time window matches Figure 2.
From time filtering and conditional retrieval to grouped aggregation, these scenarios use the same stored dataset. Changing the query conditions does not require receiving the messages again. Teams can retrieve raw records for review or obtain the summaries an application needs.
Turning Stored Telemetry into Operational Insights
Once telemetry is stored and queryable, teams can use it directly in monitoring and analytics applications. In this demonstration, Grafana connects to EMQX Tables and queries temperature and vibration data to display historical trends across three factory groups. As new records arrive, Grafana refreshes the queries at the configured interval, allowing the charts to reflect updated data without manually exporting records.

Figure 4. Actual Grafana trends
Factory A contains M100/M101, Factory B contains M102, and Factory C contains M103. All show temperature and vibration. The range is October 27, 2026, 23:08:04–23:12:26 CET, corresponding to the Tables query window. The data comes from Tables.
SQL provides a common entry point for database clients, reports, and custom applications to reuse the same fields and query logic. This demonstration verifies the flow from querying EMQX Tables to displaying the results in Grafana. Drivers, SQL compatibility, and permissions for other tools still need to be checked individually.
Start with One Device Dataset
EMQX Tables extends MQTT data workflows with managed time-series storage and SQL-based queries. By making device telemetry available for historical analysis and application integration, it helps teams build on their existing MQTT infrastructure without taking on the operational overhead of a separate time-series database.
For teams already using EMQX Cloud, a practical starting point is to connect one telemetry dataset, define the fields and retention requirements, and explore the queries needed by existing applications. Explore EMQX Tables or follow the quick start to ingest and query data. To discuss your existing architecture, deployment region, or business requirements, contact the EMQX team.
Technical Notes
Scope of analysis: Analyzing MQTT message delivery, acknowledgments (ACKs), and client lifecycle events requires separately collected event data and appropriate data models. These details cannot be reconstructed from device telemetry alone.
Demonstration environment:
- Deployment: International environment on AWS, N. Virginia (us-east-1).
- Components: EMQX Neuron 3.9.4, EMQX Tables Starter, and Grafana 13.2.2.
- Data source: Simulated telemetry from four machines.
- Query window: October 27, 2026, 23:08:04–23:12:26 CET.
- Data volume: 262 records per machine.
- M100: Average temperature 70.53°C, peak temperature 90°C, and 124 records at or above 80°C, distributed across two periods of 67 and 57 records.
- Other machines: Average temperatures of 50.98°C, 51.98°C, and 52.98°C.
SQL queries and Grafana visualizations use matching equipment identifiers, time windows, and measurement units.
Related technical documentation:
- SQL Filtering, Sorting, and Aggregation
- PostgreSQL-Compatible Access
- Grafana Integration (International Environment)