The Missing Link in Factory Data: Why a Unified Namespace Isn’t Enough | UNS to Lakehouse — Part 1
From the publisher’s feed, collected in the ZeroLabs newsroom.
A modern bottling line can produce millions of sensor readings a day. So why is it still so hard to answer a simple question like “Why did our scrap rate go up last month?”In my previous posts, we focused on getting the core tools of a data platform up and running: Kafka, Airflow, NiFi, Spark and Superset. With this post, I’m starting a new series in a domain where those tools meet a very different kind of data: industrial data coming straight from the factory floor.The industrial world has found an elegant way to share this data in real time, called the Unified Namespace (UNS). But real time is only half the story. In this first part, we’ll look at where factory data comes from, what the Unified Namespace solves, and the gap it leaves behind. Let’s dive in.A quick note for AI buildersIf you’re finding these breakdowns useful, you can support my work on Ko-fi. It helps me keep publishing practical, in-depth AI engineering content.Want to go deeper? Here are a few resources I’ve built:The Claude Code Kit: Set Up Claude Code Like the Top 1% — for developers who want to get more out of Claude Code.RAG Engineering: From Basics to Advanced — a guide to building more advanced retrieval-augmented generation systems.Agentic AI: From Basics to Advanced — a playbook for learning and building agentic AI systems.For more practical, noise-free AI breakdowns, subscribe to AI Engineering Simplified. Now, back to the article.Where Factory Data Is Born?Picture a bottling line. Each machine on that line, the filler, the capper, the labeler, has sensors attached to it. Those sensors are wired to small, rugged industrial computers called PLCs (Programmable Logic Controllers). A PLC runs the machine’s logic, for example: “if the temperature goes above 80°C, stop the motor.”From there, data travels upward through a set of layers that the industry describes with the ISA-95 model:Levels 0–1, Sensors and PLCs: Raw values, often at millisecond resolution.Level 2, SCADA and HMI: The control screens operators watch all day.Level 3, MES (Manufacturing Execution System): Work orders, batches, quality checks.Level 4, ERP: Orders, costs, inventory. The business side.Next to these layers there’s usually a historian, a specialized database that stores sensor values as time series.These systems talk to each other using industrial protocols. Older ones like Modbus or Siemens S7 are simple but cryptic. A value might arrive as DB10.DBW4 = 812, and you’d need a separate document to know that this means “filler pressure on line 2.” Newer protocols like OPC UA can carry names, units and structure along with the value itself.The Spaghetti ProblemIn a traditional factory, every system is connected directly to the others. SCADA talks to the PLCs, the historian talks to SCADA, MES talks to the historian, the reporting tool talks to MES… Every new system means a handful of new point-to-point integrations, and every machine replacement risks breaking a chain somewhere.As data engineers, this probably sounds familiar. It’s the same pain we’ve felt with tightly coupled data pipelines, just with PLCs instead of microservices.Enter the Unified NamespaceThe Unified Namespace replaces this spaghetti with a single hub. Every system publishes its data to a central broker, almost always an MQTT broker, and anyone who needs that data simply subscribes to it. If you’ve worked with Kafka topics, the idea will feel natural.The magic is in the naming. Data is published under a meaningful, hierarchical address that mirrors the plant structure:acme-plant/filling-area/line-2/filler/pressure → 812 mbarAnyone reading this topic knows exactly what the value is and where it comes from. There’s one namespace for the entire plant, which is why it’s called unified.On top of plain MQTT, many plants use Sparkplug B, an open specification from the Eclipse Foundation that standardizes payloads and adds something really important: state. When a device connects, it publishes a birth message describing its metrics. When it disconnects, a death message is published. This lets subscribers tell the difference between “no data because the value didn’t change” and “no data because the machine is offline.” Keep this in mind, because we’ll come back to it with real measurements later in the series.So, What’s Missing?The UNS is fantastic at answering one question: what is happening right now?But factories also ask questions like:Why did our scrap rate go up last month?What did the vibration sensor look like in the two weeks before this bearing failed?How much energy does it cost us to produce one bottle?Which customer order was produced on which line, at what time, and at what quality?These questions need history, and they need that history joined with business data from MES and ERP. A UNS by design carries the current state, not the past. Historians do store the past, but they are often closed, expensive systems, frequently licensed per tag, and getting their data out and joining it with ERP data can be painful. Meanwhile, the data scientists and analysts who could answer these questions often don’t have easy access at all.So the scrap rate question from the very beginning isn’t hard because the data doesn’t exist. It’s hard because the data lives in the wrong places, in the wrong shape, for the people asking.Three Ways to Keep History TodayLet’s look at the main options plants use today:1. Historians (AVEVA PI and similar)✅ Built for industrial time series, mature and reliable❌ Often proprietary and costly, hard to query from modern data tools, data stays in a silo2. Time-series databases (InfluxDB, TimescaleDB and similar)✅ Fast for recent sensor queries, open-source options available❌ Not designed to be the place where you join sensor data with ERP orders and quality records at scale3. Open lakehouse (Apache Iceberg on object storage)✅ Cheap storage, open format, readable by Spark, Trino, DuckDB, Snowflake and more, lives next to business data❌ Not designed for high-frequency, tiny writes out of the box. Needs careful design for sensor dataThe lakehouse option is the most interesting one for us data engineers, and the one this series will focus on. It’s also worth saying that these options aren’t mutually exclusive. Many plants will keep a historian or a time-series database for operational use and add a lakehouse for analytics. But building that lakehouse layer is not as simple as it sounds.Why “Just Write MQTT to Iceberg” Isn’t That SimpleAt first glance, the solution looks trivial: subscribe to the broker, write everything to an Iceberg table, done.In practice, sensor data comes with some very specific challenges:Losing context. The topic acme-plant/filling-area/line-2/filler/pressure is just a string. Store it as-is, and a query like “average pressure across all line-2 machines” becomes slow and awkward. The hierarchy needs to become real columns and a smart partitioning strategy.Narrow or wide tables? One row per measurement is flexible but produces billions of rows. One column per sensor is analysis-friendly, but the schema changes every time a sensor is added. Which one wins, and when?What does silence mean? No data for 10 minutes might mean the value didn’t change, or the machine was offline. Ignore Sparkplug’s birth and death messages, and your uptime calculations can quietly go wrong.Late and out-of-order data. When the network drops, edge devices buffer their data and send it in a burst when they reconnect, sometimes hours later. That data has to land in the right place in time.The small files problem. Thousands of tiny messages per second, written naively, turn an Iceberg table into millions of tiny files, and queries slow to a crawl.None of these challenges are new on their own, but there’s surprisingly little practical, measured guidance on solving them together, specifically for factory data. That’s the gap I want to explore.The Questions This Series Will AnswerHere’s what we’ll investigate, with real experiments and published numbers:How much space does raw sensor data actually take when stored in Parquet?Narrow vs. wide vs. hybrid tables: which design works best for typical factory queries?How often should we commit to Iceberg to balance data freshness and query speed?How far can a Python ingestion pipeline go before it becomes the bottleneck?How wrong do analytics get when we ignore Sparkplug’s state messages?Can we turn raw signals into meaningful events like “Filler on line 2 was down from 14:02 to 14:19”, and test those rules on historical data before going live?All experiments will run on the same reproducible setup, and every script and raw result will be published on GitHub.The Unified Namespace solved a real problem for factories: getting live data out of silos and into one well-organized place. But live data is only half the story. To answer questions about scrap, downtime, energy and quality, that data needs to become history, sitting right next to the business data that gives it meaning. That bridge is surprisingly under-documented, and over this series we’ll measure it, learn from it and build it in the open. In the next part, we’ll start with the foundation for every experiment: a virtual factory that publishes realistic sensor data over MQTT.Thanks for reading, and see you in Part 2, where our virtual factory comes to life.The Missing Link in Factory Data: Why a Unified Namespace Isn’t Enough | UNS to Lakehouse — Part 1 was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.