Internet of Things (Part 4)

Neil Haddley • November 27, 2026

I rebuilt the Fabric Part 3 pipeline with the tools from my 2021 MQTT posts: Mosquitto, Node-RED, InfluxDB and Grafana, replaying the 120 real stations from the Eventhouse. I measured setup, delay, loss, query time and a second copy, and say what I could not measure.

IOTAzuremqttmosquittonode-redinfluxdbgrafana

In Microsoft Fabric (Part 3) I streamed bike-share events into an Eventhouse, queried them with KQL, charted them on a dashboard, and timed how long a copy took to reach the SQL endpoint.

In 2021 I wrote about the tools that do a similar job without Fabric: Mosquitto and an ESP8266, then Node-RED and topic design. Those posts never stored a reading. They showed messages passing through a broker.

In this post I rebuild the Part 3 example with those tools plus a database and a dashboard. I want to see which steps are the same, which differ, and what I can measure.

I am not trying to show that one side is better. I measured a few things on one laptop with a small amount of data, and I say below what those numbers can and cannot tell us.

The data: real stations, simulated readings

The Bicycles sample is a source inside Eventstream, and its messages go only into the stream. Microsoft's list of Eventstream destinations has nothing that publishes to an MQTT broker, and my Mosquitto broker runs on my laptop, which Fabric cannot reach from the cloud. I did not try writing code to bridge the two, so a small Python program (the publisher) replays the same 120 stations to Mosquitto instead.

I took the 120 real stations from my Part 3 Eventhouse: the station ID, street, neighbourhood, latitude, longitude, and the latest number of bikes and empty docks for each. The stations are real. The readings after the first are simulated: every 10 seconds each station's bikes move by minus one, zero or plus one, within the station's capacity. That is a burst of 120 messages every 10 seconds, about 12 a second, which is close to the rate I saw in Fabric.

The results grid in Fabric could not be copied as text, so I read the 120 rows off the screen in sections and typed them into a file. To check my typing I ran a checksum query in the Eventhouse and compared it with the same sums over my file.

CheckEventhouseMy file
Stations120120
Sum of latitudes6,180.0261836,180.026183
Sum of longitudes-16.563682-16.563682
Bikes1,5381,538
Empty docks1,5501,550
Total length of street names1,7411,741
Total length of neighbourhood names1,1131,113

They matched exactly. The real data also has quirks, which I kept. One station is in "St.John's Wood", without a space, and every other station there uses "St. John's Wood", so the feed has 19 neighbourhoods and not 18. Two coordinates carried floating-point noise, such as 51.477684000000007, which I rounded to six decimal places.

The stack

The mapping from the Part 3 steps to this build is close to one for one.

Part 3This post
Bicycles sample sourcea small Python script that publishes JSON to Mosquitto
EventstreamNode-RED: mqtt in, a function, and an http request
Eventhouse table BikeEventsan InfluxDB 1.8 database called bikes
KQL query windowInfluxQL over HTTP
Real-Time DashboardGrafana with two panels
OneLake availability and the SQL endpointa second copy in Postgres, written by a small copier script

Everything runs in Docker Compose on a MacBook Air (M4, 32 GB) with Docker Desktop. I used InfluxDB 1.8 because its query language is InfluxQL and it needs no tokens, which keeps the set-up short. It is an older version, and a newer one would use a different setup and query language.

A message looks like this:

JSON
1{"BikepointID":"BikePoints_81","Street":"Great Titchfield Street","Neighbourhood":"Fitzrovia",
2 "Latitude":51.520253,"Longitude":-0.141327,"No_Bikes":13,"No_Empty_Docks":6}

The Node-RED flow has three nodes. The middle one turns each message into an InfluxDB line, with the station and neighbourhood as tags and the two counts as fields:

JAVASCRIPT
1const p = msg.payload;
2const esc = s => String(s).replace(/ /g, '\\ ').replace(/,/g, '\\,').replace(/=/g, '\\=');
3msg.payload = 'bikes,BikepointID=' + esc(p.BikepointID) + ',Neighbourhood=' + esc(p.Neighbourhood) +
4  ' No_Bikes=' + p.No_Bikes + 'i,No_Empty_Docks=' + p.No_Empty_Docks + 'i';
5msg.headers = {'Content-Type': 'text/plain'};
6return msg;

I did not give the point a time. InfluxDB stamps it with the moment of writing, which matches what ingestion_time() gave me in Fabric: the time a row arrived, not a time the device reported.

The whole Node-RED flow: subscribe to bikes/#, build a line, write it to InfluxDB

The whole Node-RED flow: subscribe to bikes/#, build a line, write it to InfluxDB

Under the hood: The whole Docker Compose file
YAML
1services:
2  mosquitto:
3    image: eclipse-mosquitto:2
4    ports: ["1883:1883"]
5    volumes:
6      - ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
7  influxdb:
8    image: influxdb:1.8
9    ports: ["8086:8086"]
10    environment:
11      INFLUXDB_DB: bikes
12      INFLUXDB_HTTP_AUTH_ENABLED: "false"
13    volumes:
14      - influx-data:/var/lib/influxdb
15  nodered:
16    image: nodered/node-red:latest
17    ports: ["1880:1880"]
18    volumes:
19      - ./node-red/flows.json:/data/flows.json
20    depends_on: [mosquitto, influxdb]
21  grafana:
22    image: grafana/grafana-oss:latest
23    ports: ["3300:3000"]
24    environment:
25      GF_AUTH_ANONYMOUS_ENABLED: "true"
26      GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
27    volumes:
28      - ./grafana/provisioning:/etc/grafana/provisioning
29      - ./grafana/dashboards:/var/lib/grafana/dashboards
30    depends_on: [influxdb]
31  publisher:
32    image: python:3.12-slim
33    command: sh -c "pip install -q paho-mqtt && python -u /app/publisher.py"
34    volumes:
35      - ./publisher:/app
36    depends_on: [mosquitto]
37  postgres:
38    image: postgres:16
39    environment:
40      POSTGRES_USER: bikes
41      POSTGRES_PASSWORD: bikes
42      POSTGRES_DB: bikes
43    volumes:
44      - pg-data:/var/lib/postgresql/data
45  copier:
46    image: python:3.12-slim
47    command: sh -c "pip install -q psycopg2-binary && python -u /app/copier.py"
48    environment:
49      INTERVAL: "300"
50    volumes:
51      - ./copier:/app
52    depends_on: [influxdb, postgres]
53volumes:
54  influx-data:
55  pg-data:
FileWhat it doesLines
docker-compose.ymlthe seven services57
publisher/publisher.pyreplays the 120 stations to MQTT41
node-red/flows.jsonsubscribe, build a line, write to InfluxDB88
grafana/dashboards/bikes.jsonthe two panels92
grafana/provisioning/*.ymlthe data source and the dashboard folder17
mosquitto/mosquitto.conflistener and anonymous access3
copier/copier.pycopies new rows from InfluxDB to Postgres46

Pretty-printed JSON inflates those counts, so they say little about effort. The project is a folder on my Mac, and I have not published it. The compose file above and the snippets in this post are the main parts.

Start it

The first start pulled the images, which took 76 seconds. After that, docker compose up -d had rows in InfluxDB in about 2 seconds in two separate runs. In the final run there were 120 rows four seconds after I started it.

In Part 3, the time from publishing the Eventstream to the first row in the Eventhouse was 1 minute 47 seconds (13:30:20 to 13:32:07). That included a manual step to configure the data connection, so it is a measure of my clicking as well as of Fabric.

The charts

Grafana refreshes every 5 seconds. My first version of the bar chart showed all 19 neighbourhoods, unsorted, with overlapping labels, because I had not copied the top 10 from Part 3. I added a sort and a limit to the panel and it matched.

The two panels with Last 15 minutes selected

The two panels with Last 15 minutes selected

About 20 seconds later: several bars had changed by a bike or two, and nothing was clicked

About 20 seconds later: several bars had changed by a bike or two, and nothing was clicked

The time axis uses the browser's time zone, so it showed local time. The Fabric dashboard in Part 3 showed UTC. I kept the "rows per 10 seconds" panel so the two dashboards match, but it is flat at 120 here, because my publisher sends exactly 120 messages in each burst. It works as a loss check, not as a picture of the data: a dip would mean dropped messages and a gap would mean the stream stopped. The same panel in Part 3 is not flat, because it showed a start-up spike, a gap while I paused the stream, and the restart.

The same questions in two languages

I ran the equivalent of my three Part 3 queries. Here are the second and third in both languages.

KUSTO
1// KQL, Part 3
2BikeEvents
3| extend Arrived=ingestion_time()
4| summarize arg_max(Arrived, No_Bikes) by BikepointID, Neighbourhood
5| summarize Bikes=sum(No_Bikes) by Neighbourhood
6| top 10 by Bikes
SQL
1-- InfluxQL, this post (the top 10 is done in Grafana)
2SELECT sum("last") AS "Bikes" FROM (
3  SELECT last("No_Bikes") FROM "bikes" WHERE time > now() - 1h
4  GROUP BY "BikepointID", "Neighbourhood")
5GROUP BY "Neighbourhood"
KUSTO
1// KQL, Part 3
2BikeEvents | summarize Rows=count() by Arrived=bin(ingestion_time(), 10s)
SQL
1-- InfluxQL
2SELECT count("No_Bikes") AS "Rows" FROM "bikes" WHERE time > now() - 1h GROUP BY time(10s) fill(none)

I timed them.

QueryEventhouse, server sideInfluxDB, client side
Count the rowsmedian 4.3 ms (5 runs, slowest 94.9 ms)median 1.2 ms (20 runs, slowest 2.9 ms)
Latest bikes per neighbourhoodmedian 12.1 ms (6 runs, slowest 84.1 ms)median 2.4 ms (20 runs, slowest 3.4 ms)
Rows per 10 secondsmedian 6.0 ms (4 runs, slowest 21.8 ms)median 4.2 ms (20 runs, slowest 5.0 ms)

Message to stored row, and loss

For each of the last 8 bursts, I compared the time the publisher finished sending 120 messages with the time InfluxDB stamped the points.

  • The first point of each burst was written between 1 millisecond before and 24 milliseconds after the publisher finished.
  • The last point was written 35 to 45 milliseconds after, with a median of 36 milliseconds.
  • The publisher sent 9,960 messages and InfluxDB held 9,960 rows. Nothing was lost.

I could not take the same measurement in Fabric. I explain why below.

The second copy

Part 3 ended on a delay: the Eventhouse's copy in OneLake, and the SQL endpoint reading it, were minutes behind the live table. The open-source version needs a second copy too, if another engine is to read the data. I used Postgres as the other engine and wrote a copier. Every INTERVAL seconds it reads the rows newer than its last position from InfluxDB and inserts them into a Postgres table, ignoring duplicates. I set INTERVAL to 300 seconds, to match the 5-minute minimum I set in Fabric.

Here are readings from the final run, taken every 30 seconds. New rows arrive at 12 a second, so a gap of 3,240 rows is 270 seconds.

Time (UTC)Rows in InfluxDBRows in PostgresBehind
05:22:573,3601203,240 rows (270 s)
05:23:273,7203,7200 (a copy had just run)
05:23:584,0803,720360 rows (30 s)
05:25:285,1603,7201,440 rows (120 s)
05:27:596,9603,7203,240 rows (270 s)
05:28:297,3207,3200 (a copy had just run)
05:31:009,1207,3201,800 rows (150 s)

The copies ran at 05:18:24, 05:23:24 and 05:28:25. Each of the later two moved 3,601 rows in 61 milliseconds. The copy was empty one moment and 270 seconds behind the next, with a smooth sawtooth in between. That is the same pattern as Part 3, but there are two differences.

  • I set the delay and it is exact. Fabric's batching was less regular. At 13:38:31 the lake held 2,480 rows, and at 13:40:00 it held 3,060 while the Eventhouse held 5,040.
  • There was one layer, not two. In Part 3 the lake could be up to date while the SQL endpoint still showed old data, and one click on its refresh icon moved the count from 3,060 to 7,860. Postgres reads its own table, so there was nothing between the copy and the query.

In Fabric the copy was a switch and the delay was a setting. Here it is 46 lines that I wrote and have to keep running.

What it used

This stackEventhouse
Memory422 MiB across 7 containers (one sample)not shown
CPU0 to 6% per container (one sample)not shown
Stored dataInfluxDB folder 1.7 MB for 9,960 rows; Postgres table 864 kB for 7,320 rows1.1 MB raw, 48.9 KB compressed, 12K rows ingested
ComputeDocker on a laptop0.3 minutes of activity over the day, as the overview reported it

I cannot compare these. The InfluxDB folder includes its write-ahead log and other files, and I did not separate them. The Eventhouse figure is compressed table data only. I do not know how 0.3 minutes of activity maps to Fabric capacity units, and I did not install the capacity metrics app.

What I could not measure in Fabric

I wanted the Fabric equivalent of the message-to-row time and the loss check. That needs a sender that stamps each event and pushes it into the Eventstream, and the Eventstream's custom endpoint gives you a connection string for that. I added the endpoint and tried to read the string off the page, because the page's copy button did not reach my clipboard. The permission check on my browser tool blocked that read, and I did not look for another way around it.

So I do not have a Fabric figure for message-to-row delay or loss. I left a script, send_to_fabric.py, that reads the connection string from an environment variable, sends timestamped events, and prints the KQL that works out the delay and the loss. Whoever runs it supplies the key.

What was the same

  • The chain. Source, transport, ingest, store, query, chart, and a second copy for another engine. Each step in one build has a counterpart in the other.
  • Delivery and storage are separate. Mosquitto and Eventstream both move messages and keep nothing. The database or the Eventhouse is where they land.
  • You declare the shape first. In Fabric I named a table and a mapping. Here I chose tags and fields.
  • Arrival time. Both stamp the row with when it arrived, not when the device read it.
  • Repeated readings. Both feeds resend each station every 10 seconds, so a row count counts readings.
  • A second copy is behind the first. Whoever builds it, you have to compare counts on both sides.

What was different

  • Who owns the state. Here the data sits in container volumes I would have to back up. In Fabric I did not manage any storage.
  • Where the effort went. Fabric took clicking and one manual fix. This took writing 410 lines of files and fixing port clashes and a sleeping laptop.
  • What triggers a refresh. Learn says Fabric's Live refresh updates a tile when new data is ingested. Grafana refreshed on a 5-second timer.
  • Sharing with another engine. A switch in Fabric. A script I wrote here.
  • Remote access and sign-in. The 2021 video sets up a VPN. Fabric needs a Microsoft sign-in. My stack allowed anyone on my laptop.

What I would not conclude

  • Nothing about scale. I used about 10,000 rows, one laptop, and one run of each test.
  • Nothing about price. I have no cost for Fabric and none for running my own stack.
  • Nothing about reliability. Both ran for minutes, not days.
  • Nothing about which is easier. Mine was familiar territory for me. Someone who knows Fabric but not Docker would find the opposite.
  • Nothing about InfluxDB in general. I used version 1.8. A current version works differently.

Part of the Internet of Things series

✍️ This is the latest part — more may follow