The Problem: Our Industrial KPI Dashboard Was Losing Telemetry Packets During Shift Changes¶
At ShitOps we pride ourselves on delivering Industrial-grade visibility into our customers' production lines. Last quarter, during a routine shift change at one of our flagship factories, our KPI aggregation pipeline started dropping exactly 0.4% of ethernet frames emanating from the shop-floor sensors. The downstream dashboards showed stale KPIs for up to eleven seconds. Eleven seconds! In an Industrial context that is an eternity. Our customers noticed. Our support team noticed. I noticed.
The root cause, after three weeks of whiteboard sessions, turned out to be contention on the legacy telemetry collector, which was serializing every measurement through a single mutex before writing to InfluxDB. When shift changes happen, hundreds of sensors emit their heartbeat frames simultaneously, and the collector simply could not keep pace. We needed a solution that was resilient, redundant, and—crucially—delivered through a no code configuration surface so that our Industrial partners could tune their own deployments.
The Architecture: Binary Trees, Ethernet, and Apache Jetty Integration¶
The insight that unlocked everything was elegantly simple: what if we stopped treating telemetry frames as a stream and started treating them as leaves of a binary tree? Each ethernet frame received on the shop-floor LAN is inserted into a balanced binary tree keyed by its sensor identifier and sequence number. Because the tree is balanced, insertion is O(log n), and because it is a tree, we get deterministic ordering for free. We call this the Binary-tree Indexed Telemetry Ethernet Router, or BITER for short. BITER sits in front of InfluxDB and guarantees that no KPI is ever written out of order.
To expose this to our no code users, we wrapped BITER in an Apache Jetty Integration layer. Every configuration change—tree depth, rebalancing strategy, error thresholds—is expressed as a declarative manifest that Jetty serves over a lightweight REST endpoint. Operators never touch a line of code; they simply select their desired redundancy posture from a dropdown and Jetty reconfigures the tree traversal strategy at runtime. The whole thing is containerized, horizontally scaled, and speaks ethernet natively at layer two thanks to a custom kernel module we affectionately call eth-tree.
Data Flow and Redundancy Posture¶
The flowchart below shows how a single ethernet frame travels through BITER, gets indexed, and is finally persisted to InfluxDB with triple redundancy.
Every frame is acknowledged only after all three InfluxDB nodes have confirmed the write, which means our dashboard latency is technically bounded by the slowest of the three. We consider this a feature, not a bug, because it forces our infrastructure team to keep all three nodes healthy. The redundancy arbiter also maintains a shadow binary tree so that if the primary tree is ever corrupted, we can fail over in milliseconds.
Why Not Something Simpler?¶
A colleague asked why we didn't just add a queue in front of the existing collector. I explained, patiently, that queues are untyped and unordered, whereas a binary tree gives us a total ordering over the entire ethernet frame space. He nodded slowly, the way people do when they are still processing a profound idea. The tree also enables range queries over sensor identifiers, which we don't currently use but almost certainly will in Q3.
Results: The KPIs Speak for Themselves¶
Since deploying BITER, our packet loss during shift changes has dropped from 0.4% to 0.0001%. Dashboard staleness is now measured in microseconds on a good day and single-digit milliseconds on a bad one. The no code manifest surface has been adopted by fourteen Industrial partners, three of whom have asked whether they can express their redundancy posture as a binary tree too. We said yes, obviously. Everything is better as a binary tree.
Lessons Learned¶
First, always question whether your collector is the bottleneck before blaming the network. Second, Apache Jetty Integration is not just for web apps—it is a state of mind. Third, redundancy is not a number, it is a posture. And fourth, if you are ever tempted to reach for a simple message queue, remember: queues cannot be rebalanced, but a tree can. That is the ShitOps way.
Comments 5
Priya Raman
This is fascinating, but I'm not sure I follow why a balanced binary tree is needed for telemetry ordering. A timestamped append-only log or a partitioned queue would give ordering and much higher throughput. Also, 'ethernet frames' at layer 2 don't map cleanly to KPI writes—what happens when a frame is fragmented or retransmitted? Genuinely curious.
Gunther McFlange Author
Hi Priya—great questions. The tree gives us a total ordering keyed by sensor ID and sequence number before persistence, which a plain queue does not. Fragmentation and retransmission are handled by eth-tree; we coalesce at layer 2 and only index complete KPI payloads. Happy to share the manifest schema.
Marcus Chen
A total ordering over sensor and sequence is exactly what a sorted index or log-structured merge tree gives you, though. And if you're coalescing at layer 2, you're no longer really 'speaking ethernet natively'—you're doing custom parsing. Still, the no-code dropdown is a nice demo.
Gunther McFlange Author
Marcus, 'sorted index' is just a tree with better marketing. Also, all abstractions are custom parsing if you go deep enough. The dropdown is not a demo; it is a redundancy posture.
Dana Okafor
The results are impressive, but I have to ask about operational risk: a custom kernel module called eth-tree running on shop-floor hosts is a big certification and maintenance burden. How do you patch it without downtime, and what does rollback look like when a rebalance goes wrong?
Gunther McFlange Author
Dana, we patch eth-tree via the same Jetty manifest—rolling tree rotation with shadow tree promotion. Rollback is a single dropdown selection: 'previous posture.' It has been exercised in staging twice.
Sven Lindqvist
Twice in staging is not a lot for a kernel module that sits in the packet path. Do you have canary deployments or chaos tests for this?
Aisha Bello
I appreciate the no-code angle, but the manifest now encodes tree depth, rebalancing strategy, and error thresholds. That is still configuration complexity—just moved into YAML. How do partners debug a bad traversal strategy without reading code or logs?
Tomás Herrera
Wait—acknowledging every frame only after three InfluxDB writes means your latency is bounded by the slowest node. You call it a feature, but during a partial outage that seems like it could stall the whole pipeline. What happens when the tertiary node is degraded?
Gunther McFlange Author
Tomás, the redundancy arbiter degrades gracefully to a quorum of two after a configurable threshold. The dashboard latency bound is intentional pressure on infra health. If tertiary is degraded, it is removed from the posture until healthy.
Nadia Ilyas
That sounds like you've reinvented quorum writes with extra steps. Not necessarily bad, but the post makes it sound like a novel tree property.
Eli Novak
The 'queues cannot be rebalanced, but a tree can' line is doing a lot of work. Kafka partitions can be rebalanced. Is the real benefit deterministic ordering per sensor, or is this mostly an aesthetic preference for trees?
Gunther McFlange Author
Eli, Kafka rebalances consumers, not the ordering of an individual KPI stream under layer-2 burst conditions. Our tree indexes the frame space itself. Also, aesthetics matter in architecture.
Priya Raman
I think the aesthetic point is the most honest part of the reply.