Episode Summary We tend to think about infrastructure in physical terms: wires, pylons, transformers, steel and copper. But modern systems - especially energy systems - are held together by something less visible and just as critical: the messaging layer. In this episode, we trace the hidden history of how machines learned to talk to machines. From Wall Street trading floors to oil pipelines in the desert, from telecom switches in Sweden to rage-coded weekends in Silicon Valley, this is the story of frustration-driven innovation. We explore: * Why synchronous “telephone-style” software broke at scale * How publish/subscribe became the software equivalent of a system bus * Why RabbitMQ, Kafka, NATS, and MQTT exist - and what specific pain each one was born to solve * The architectural tradeoffs between smart brokers and dumb pipes * Why replayability, liveness, and reliability are fundamentally different goals * How modern systems increasingly combine all of these tools * And why the next architectural leap will come from today’s friction points This episode isn’t about choosing the “best” messaging system. It’s about understanding why each one exists, and what happens when you use the wrong tool for the wrong kind of problem. Key Concepts * Messaging as the nervous system of physical infrastructure * Subject-based addressing and decoupling * Smart broker vs. dumb broker architectures * Append-only logs and replayability * Control planes vs. data planes * Edge constraints and low-power networks * Friction as a signal for architectural evolution Mentioned Systems & Ideas * TIBCO and the original information bus * AMQP and the open-standard rebellion * RabbitMQ and Erlang’s “let it crash” philosophy * Kafka and the log as the source of truth * NATS and the “dial tone” model * MQTT and constraint-driven protocol design * ZeroMQ, Pulsar, Redis Streams (briefly) The Invisible Grid How Messaging Systems Became the Nervous System of Modern Infrastructure Close your eyes for a moment.(Not if you’re driving - but mentally.) When we talk about infrastructure, we picture the physical grid: copper wires, transformers humming in empty fields, pylons cutting across landscapes. It’s tangible. You can touch it. You can see it rust. You can watch a tree fall on it. If that grid fails, everything stops. But there is another grid - one we almost never visualize. An invisible grid, running inside software.A nervous system made of messages. And just like the physical grid, when this system clogs, desynchronizes, or collapses, the lights go out anyway - no matter how much copper is in the ground. Modern energy systems, financial markets, cloud platforms, and industrial control loops don’t merely use software. They depend on it at the level of physics. Signals must arrive on time. Control decisions must propagate. State must remain coherent across thousands or millions of moving parts. This post is about how we got here. Not as a clean, planned evolution - but as a genealogy of frustration. The Original Sin: The Telephone Call Early software systems communicated the same way humans did: by calling each other directly. Application A opens a connection to Application B, waits for it to respond, sends data, and blocks until it hears back. This is synchronous coupling - the software equivalent of a phone call. It works fine for two systems. It collapses at scale. On a trading floor - or an energy grid - one event must fan out to many consumers: risk engines, dashboards, control systems, settlement layers. In the telephone model, the sender must call each one, sequentially. If any receiver is slow or unavailable, everything backs up. Latency accumulates. Failure cascades. In finance, you go bankrupt. In energy, you destabilize the grid. This brittleness created the first great insight. The Software Bus: Publish, Don’t Call In the mid-1980s, an engineer looked at a computer motherboard and asked an uncomfortable question: Why is software dumber than hardware? A CPU doesn’t “call” the graphics card. It broadcasts onto a system bus. Whoever is listening picks up the signal. The sender doesn’t care who receives it - or if anyone does at all. That idea became publish/subscribe. Instead of sending data to addresses, you publish it to subjects. Instead of knowing who consumes it, you just agree on what it means. This decoupling was revolutionary. It gave us the first real software nervous system. And it worked - so well that it created the next problem. When Middleware Ate the Budget By the early 2000s, large enterprises had dozens of incompatible messaging systems. Each vendor had its own protocol, its own servers, its own licensing model. Banks were spending absurd portions of their IT budgets not on business logic - but on plumbing. The rebellion that followed wasn’t technical at first. It was economic. Why don’t we have a TCP/IP for messaging? That question led to open standards. And open standards led to open source. RabbitMQ and the Power of “Let It Crash” RabbitMQ emerged from a near-perfect alignment between problem and tool. The problem: routing messages reliably, flexibly, transactionally. The tool: Erlang - a language built for telecom switches that cannot go down. Erlang’s philosophy is radical: don’t prevent failure - contain it. Instead of one giant program sharing memory (where one bug burns the house down), Erlang runs millions of tiny isolated processes. If one crashes, a supervisor instantly replaces it. Failure becomes routine. Boring. Managed. RabbitMQ embodies this mindset. It is a smart broker: it routes, retries, buffers, tracks acknowledgements, and guarantees delivery. It is a post office. And like all post offices, it has limits. Kafka and the Log That Changed Everything When LinkedIn tried to track everything, the post office model broke. Too much sorting. Too much state. Too much overhead. The breakthrough was deceptively simple:Stop routing messages. Start recording history. Kafka treats data as an append-only log - an immutable sequence of events. Producers write to the end. Consumers read at their own pace. The broker doesn’t track who’s done what. This aligns perfectly with disk physics. Sequential writes are fast. Replays are free. History becomes an asset. In this model: * The log is the source of truth * Databases are just materialized views * You can replay the past with new intelligence Kafka isn’t a post office. It’s a newsstand. NATS and the Dial Tone Then came cloud platforms, microservices, and another frustration. Messaging systems had become pets - delicate, stateful, needy. But cloud infrastructure demands cattle - replaceable, disposable, boring. NATS was born from that tension. Its original design was ruthless: * No persistence * No buffering for slow consumers * No guarantees beyond “best effort right now” If you’re too slow, you’re dropped. If no one’s listening, the message vanishes. This sounds dangerous - until you realize what it’s for. Control planes. Heartbeats. Service discovery. Real-time signals where the latest state matters more than history. NATS is not a database. It’s a dial tone. MQTT: Innovation Under Constraint The most elegant designs often come from the harshest constraints. MQTT was built for oil pipelines in the desert, running over satellite links so slow and expensive that saving two bytes mattered. The result was a protocol stripped to its bones: * Tiny headers * Persistent low-power connections * Explicit handling of unreliable networks * A “last will and testament” for dead devices Years later, the same properties made MQTT perfect for smartphones. From oil rigs to billions of pockets. Today, MQTT is the language of the edge. Synthesis: No Winners, Only Tradeoffs There is no perfect messaging system. Each of these tools exists because an engineer hit a wall: * Too slow * Too heavy * Too expensive * Too fragile They encode those frustrations into architecture. That’s the real lesson. Modern systems don’t pick one. They compose: * MQTT at the edge * Kafka for history and analytics * NATS for control and coordination * RabbitMQ for transactional work Different pipes for different fluids. The Real Question Every major evolution in messaging came from irrita… This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit frahlg.substack.com
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
SPEAKER_03Frederick, I want you to close your eyes for a second. Well, not if you're driving or operating heavy machinery, but, you know, mentally close them.
SPEAKER_02Right.
SPEAKER_03You run sourceful energy. Your day to day is probably spent obsessing over the grid. big physical grid.
SPEAKER_00The one you can see.
SPEAKER_03The one you can see. The copper wires, the massive high voltage pylons that stretch across the landscape, the transformers that are just, you know, humming in a field somewhere in the middle of nowhere. That is the circulatory system of the modern world.
SPEAKER_00It's tangible. You can touch it. You can see it rust. You can see a tree fall on a line.
SPEAKER_03Exactly. And if that physical grid breaks, I mean, the lights go out, factories stop, and society basically just hits a pause button. But here's the observation we really need to land today right at the top. Okay. There is a parallel grid, an invisible one. Well, it's the nervous system running inside all the software that manages your physical grid. And just like the electrical grid, if this digital nervous system gets clogged or it overloads or it desynchronizes, your business logic simply stopped.
It doesn't matter how much copper you have in the ground if the signal telling a
SPEAKER_03battery to discharge just doesn't get there.
SPEAKER_00And the stakes are identical. I mean, increasingly so. If the software grid fails, the physical grid fails. We see this all the time with distributed energy resources. The physics at this point actually relies on the data.
SPEAKER_03Right. So we've pulled together a whole stack of research here. We're looking at the history of TyBCO, the engineering internals of RabbitMQ, some of the academic papers behind Kafka, the specs for Nats and MQTT, and the story that emerges. It's not a clean, straight line. We planned this perfectly from day one.
SPEAKER_00Not at all. It's a history of anger.
SPEAKER_03It is. It's a history of rage coding.
SPEAKER_00It really is. I mean, you look at the big leaps and almost every single major advance in how machines talk to machines happened because some brilliant engineer was just having a terrible week.
SPEAKER_03A truly awful week.
SPEAKER_00Yeah. They were fighting bureaucracy or they were fighting physics or they were fighting vendor lock-in. And they finally just snapped and said, there have to be a better way.
SPEAKER_03So today, Frederick, that's what we're going to do. We're going to trace that genealogy of frustration. We're going from the trading floors of Wall Street in the 80s all the way to oil pipelines in the desert that kind of by accident gave us the Internet of Things.
SPEAKER_00And we're going to decode the architectural tradeoffs, the big ones. Smart brokers versus dumb pipes. We'll look at why a weird telecom language called Erlang was the magic bullet for RabbitMQ. why LinkedIn basically had to turn the database inside out to invent Kafka. And why a guy trying to save two bytes of data while he was in the shower invented
SPEAKER_03the protocol that probably runs your smart meter right now.
SPEAKER_00Yeah, that's a great story.
SPEAKER_03The goal here is simple. You're making strategic decisions about the sourceful stack every day. You need to know which tool to use, sure, but I think it's more important to know why that tool exists. Because if you use a tool that was born from one specific frustration to solve a completely different problem. You're just going to create a whole new world of frustration for yourself and for your team.
SPEAKER_00It's like you don't use a hammer to drive a screw.
SPEAKER_03Yeah. And you probably shouldn't use a log-based broker for transient RPC calls. Okay, let's dive in. Section one, the origins. We have to start in the dark ages. Before we had these elegant message buses, how did software actually talk to software?
SPEAKER_00Painfully. I mean, just painfully. The model was essentially the telephone call. We call it synchronous coupling and computer science term. If application A wanted to send a price update to application B, had to open a direct connection... wait for B to metaphorically pick up the phone, hand over the data, and then wait for B to say, okay, got it, thanks.
SPEAKER_03Which sounds fine if it's just you and me talking right now. Simple enough.
SPEAKER_00Sure. For a conversation between two entities, it works. But now imagine a trading floor. Or even better, imagine your grid. It's sourceful. You get a price event coming in from the energy market. That one piece of data, that one price tick needs to go everywhere. It needs to go to the risk engine, the compliance logger, the trader's dashboard, the battery management system, and the settlement system all at once. In the telephone model, application A has to call them one, by one,
by one.
SPEAKER_00It's a telephone chain, like that game you played in elementary school.
SPEAKER_03Exactly. And the problem with the telephone chain is baked right into the physics of it. If the second person in that chain doesn't pick up... The whole thing just stops.
SPEAKER_00The line is busy.
SPEAKER_03It halts. Your first application, the publisher, is just sitting there, spinning its wheels, maybe waiting for a timeout. It's incredibly brittle.
SPEAKER_00And the latency accumulates. I mean, think about it. If every call takes 100 milliseconds and you have 10 systems to notify... The last system in the chain gets that critical data a full second late.
SPEAKER_03In high frequency trading, a second is an eternity. You're not just late, you're dead.
SPEAKER_00You're bankrupt.
SPEAKER_03And for energy grid balancing, a second can be the difference between frequency stability and, well, and a blackout.
SPEAKER_00It's the same stakes. And this is the world that brings us to Vive Kranadeve.
SPEAKER_03The man, the myth, the legend. An MIT and Harvard grad comes to the U.S. with barely a dollar to his name. And in the mid-80s, he has this epiphany while staring at a computer motherboard.
SPEAKER_00Right. He's looking at the actual hardware architecture. And he has this realization that when the CPU wants to send data to the graphics card, it doesn't call... the graphics card. It doesn't pick up a tiny little phone. So what does it do? It puts the signal on the system bus. It's a shared copper pathway that's just there. The CPU just shouts, hey, here's some data. And it puts it on the bus. And the graphics card is listening. The hard drive is listening. The network card is listening. Whoever needs that specific piece of data just grabs it.
SPEAKER_03The CPU doesn't know or care who grabs it. It just broadcasts.
SPEAKER_00You publish it. And Renadivi looks at this and asks the billion dollar question, why is our software so stupid?
SPEAKER_03Right. Why are we making point-to-point phone calls in software when the hardware figured this out ages ago? Why don't we have a software bus?
SPEAKER_00And that single question birthed PBCO, the information bus. Tebe.
SPEAKER_03This was the absolute revolution. And the core idea here, the technical term, is subject-based addressing.
SPEAKER_00That's the key concept. Instead of sending data to an IP address, which is a location, right, it's like a house number, you send data to a subject. You publish a message and you tag it usdurfx.rate or gridfrequency.gz.
SPEAKER_03You're not sending it to anyone.
SPEAKER_00You're not. You don't know who's listening. You might not even care if anyone is listening. You just shout it into this digital void.
SPEAKER_03And the network itself does the magic.
SPEAKER_00Well, back then, the infrastructure did. They used a network feature called multicast. The network hardware itself would replicate the packet to anyone on the network who would raise their hand and said, hey, I'm subscribed to grid frequency H-E-Z.
SPEAKER_03This was the birth of decoupling. And for you, Frederick, this is the foundational concept of modern architecture. It's huge. The sender and the receiver do not need to know that the other exists. They just need to agree on the subject matter.
SPEAKER_00The contract is the topic name, not the address of the machine.
SPEAKER_03So TIBCO becomes massive. They were the undisputed kings of the trading floor. If you walked into a bank in 1995, TIBCO was running the entire show. But of course, that success creates a whole new problem.
SPEAKER_00The curse of success.
SPEAKER_03Yeah. By the early 2000s, you have these huge banks like JP Morgan, and they're spending incredible eye-watering amounts of money on this stuff.
SPEAKER_00I think one of the sources we looked at mentioned that at one point, JPMorgan was spending something like 30% of its entire IT budget just on what they called middleware, just on the plumbing to move data around.
SPEAKER_0330%. That's insane.
SPEAKER_00And the worst part, none of it talked to each other. It was a complete tower of babble.
SPEAKER_03Right. The IBM MQ system couldn't talk to the TIDCO bus. And the TBCO bus couldn't talk to the weird custom C++ scripts some other team wrote. It was a mess. Right.
SPEAKER_00So this is where John O'Hara at JPMorgan comes in around 2003. He looks at this vendor locked fragmented mess and says, this is ridiculous. We solve this for networking. We have TCPIP.
SPEAKER_03Right. It doesn't matter if you have a Dell network card or an Intel network card. The packets just flow.
SPEAKER_00Exactly. So he asks, why don't we have a TCPIP for messaging?
SPEAKER_03Yeah.
SPEAKER_00He wanted a standard wire protocol.
SPEAKER_03He wanted to commoditize the plumbing.
SPEAKER_00He wanted to break the vendor lock-in. That was the whole point. If everyone speaks the same language, AMQP, I can swap out my expensive IBM server for a cheaper open-source one tomorrow, and my application code doesn't have to change one bit.
SPEAKER_03It was an open-standard rebellion, really. Led by the banks who were tired of writing the checks, they wanted to turn this proprietary magic into a boring utility.
SPEAKER_00It was. And that standard, that AMQP specification, eventually fell into the hands of some very, very interesting people over in London.
SPEAKER_03And this brings us right to section two, the open source rebellion. Let's talk about RabbitMQ. I love this story because it literally starts with a piece of paper in a desk drawer.
SPEAKER_00It does. We're in London, in the area they were starting to call Silicon Roundabout. You've got these two guys, Alexis Richardson and Matthias Redstock. Alexis gets his hands on a draft of this AMQP specification from the banks. He thinks it's interesting, so he hands it to Matthias, his technical co-founder. And Matthias, the brilliant engineer, immediately sees the potential and starts coding. No. He puts it in his bottom desk drawer.
SPEAKER_03He just puts it away.
SPEAKER_00Yeah, he just puts it away and sits on it. But he's thinking about it. And a few weeks later, he opens the drawer, pulls out the spec, and says to Alexis, you know, it would be quite easy to implement this in Erlang.
SPEAKER_03Okay, stop right there. Erlang. For the non-coders listening in, or even for you, Frederick, who might just know it by reputation, why was Erlang the magic word here? Erlang. Because usually when you hear about high performance financial software, you think C++ or Java.
SPEAKER_00This is such a crucial piece of engineering context. Erlang wasn't just another programming language. It was built by Ericsson, the Swedish telecom giant, way back in the 1980s. Right. And it was designed for one and only one specific purpose, to run telephone switches.
SPEAKER_03Hardware that absolutely positively cannot fail.
SPEAKER_00Hardware that needs what they call nine nines of reliability. That's 99.9999999% uptime. And that equates to about, what, 31 milliseconds of downtime per year? It's insane.
SPEAKER_03How do they even achieve that?
SPEAKER_00Through a philosophy that sounds completely terrifying at first. It's called let it crash.
SPEAKER_03Okay, that sounds bad. If I'm Frederick and I'm running an energy grid, the last thing I want to hear from my software vendor is, oh yeah, our philosophy is let it crash.
SPEAKER_00I know, it sounds totally counterintuitive, but it's brilliant. In a language like Java or C++ All, you spend most of your time writing defensive code. You're trying to predict and catch every possible error so the program doesn't stop. You wrap everything in bubble wrap.
SPEAKER_03But you can't predict everything.
SPEAKER_00You can't. And when you miss something in Java, the whole Java virtual machine might panic. It might have a fatal error. And that brings down your entire application. The whole thing dies.
SPEAKER_03I've heard this called the shared house analogy.
SPEAKER_00That's a great way to think about it. A Java program is like a giant mansion. All the different threads of execution are living in the same house. They share the kitchen. They share the bathrooms. That's the shared memory. If one thread accidentally sets the kitchen on fire, maybe it throws a segmentation fault or has a memory leak.
SPEAKER_03The whole house burns down. Everybody dies.
SPEAKER_00Everybody dies. The whole application is gone. Now, Erlang is completely different. Erlang is like a village of tiny, individual, indestructible concrete bunkers. Bunkers. We call them processes, but they're not heavy OS processes. They're incredibly lightweight. You can have millions of them running on one machine. Each bunker has its own tiny slice of memory. It doesn't share anything. If one process panics and dies, only that one bunker implodes. The explosion is completely contained.
SPEAKER_03So the bunker next door doesn't even feel the vibration.
SPEAKER_00Doesn't even notice. And here's the magic part. There's another process called a supervisor, whose only job is to watch the other processes. The millisecond a bunker dies, the supervisor notices, and instantly spins up a fresh, clean replacement in the exact same spot. It's like the Hydra from mythology. Cut off one head, another grows back instantly. So the system heals itself. Instantly and automatically. Yeah. So Matthias Raidstock saw this AMQP spec.
SPEAKER_03Right. Back to the desk drawer.
SPEAKER_00And he realized that the AMQP spec, which describes these things called exchanges, routing messages to queues, it looked exactly like a telephone exchange routing calls. The problem domain was a perfect match for the language he knew. Erlang was literally built to do what AMQP wanted to do.
SPEAKER_03The architecture of the problem matched the architecture of the language.
SPEAKER_00Perfectly. It was a beautiful synergy. So they built it.
SPEAKER_03And built it fast.
SPEAKER_00Unbelievably fast. They built RabbitMQ version 1.0 in just two and a half months. Two guys in London building a full-featured enterprise-grade message broker in mere weeks because they chose exactly the right tool for the job.
SPEAKER_03That is just insane efficiency. So let's talk about the architectural model of RabbitMQ. We mentioned Smart Broker earlier.
SPEAKER_00Yes. Let's use an analogy. Think of the RabbitMQ server as the post office. It is a very, very smart central entity.
SPEAKER_01Okay, the post office.
SPEAKER_00You, the publisher, drop a message in the mailbox. You trust the post office to do all the hard work. It'll read the address, route it through various sorting centers, maybe retry delivery if the mail truck breaks down, buffer the mail if the recipient isn't home. And finally, put it in the specific correct mailbox of the recipient.
SPEAKER_03And once it's delivered and the person takes it out of the mailbox.
SPEAKER_00The post office forgets about it. The job is done. They don't keep a copy. And the consumer, the person receiving the mail, is dumb in this model.
SPEAKER_03What do you mean by dumb?
SPEAKER_00They just open their mailbox and say, give me my work. They don't need to know how the litter got there. They don't care about the sorting centers or the trucks. All the routing logic is centralized in the smart broker.
SPEAKER_03This sounds, well... It sounds ideal. It's reliable. It's flexible. Why would we ever need anything else?
SPEAKER_00Because the post office has a physical limit. Sorting mail is hard work. It takes CPU cycles. It takes memory management. If you suddenly dump a billion letters on that post office in one hour...
SPEAKER_03The sorters go on strike. The whole system gets backed up.
SPEAKER_00The system chokes. It becomes a bottleneck. And that very problem brings us to the year 2010, to the big data paradigm shift, and to the crisis at LinkedIn.
SPEAKER_03Section three, the big data paradigm shift.
SPEAKER_00I bet you, Kafka.
SPEAKER_03Oh, yeah. LinkedIn in 2010 was just drowning in data.
SPEAKER_00They were. They were trying to track absolutely everything. Every user click, every profile view, every search query, every internal system metric, every log file. They called it digital exhaust.
SPEAKER_03And they tried using the existing tools, right? They tried the post office model?
SPEAKER_00They did. They tried using ActiveMQ, which is another AMQP-style broker. They looked at RabbitMQ. But these smart brokers, they were doing too much work for message. When you're trying to track a billion clicks a day, you can't afford the overhead of a post office meticulously sorting every single one and tracking individual acknowledgments. It was, as the sources say, overkill for features, but insufficient for throughput. That's the perfect summary. Plus. And so enter J. Kreps, Neha Narkay, and Joon Rao, the engineers at LinkedIn who decided to basically burn the
playbook and start over
SPEAKER_00from first principles.
SPEAKER_03And this is where we get Apache Kafka. Now, J. Kreps wrote this famous blog post, The Log, What Every Software Engineer Should Know About Real-Time Data's Unifying Abstraction.
SPEAKER_00It's a seminal text. It's one of those papers that just fundamentally changes how you see data. If you haven't read it, Frederick, you really should. So let's dive into the log, because when I hear the word log, I think of a text file.
SPEAKER_03You know, system.log, full of error messages, system crash at 2 p.m. That is not what he means here, is it?
SPEAKER_00No, not at all. He's talking about the log as a data structure. A fundamental, ordered, append-only sequence of records. Think of it like a ledger in accounting or an infinite roll of paper tape.
SPEAKER_03Okay, an infinite tape.
SPEAKER_00You can only ever write to the end of the tape. You never go back and erase a line from the middle. You just write the next event and the next one and the next one. It's an immutable history of everything that has ever happened.
SPEAKER_03Why is that a better model for high throughput? Why is append-only so fast?
SPEAKER_00Physics. It comes down to the physics of hard drives. Even modern SSDs, but especially the spinning Rust disks they had in 2010, are incredibly blindingly fast if you just write sequentially.
SPEAKER_03You're not jumping around.
SPEAKER_00You're not seeking. If you just keep appending data to the end of a file, the disk head doesn't have to move. You can write hundreds of megabytes per second. But if you have to jump all over the disk of random access, the drive has to physically move ahead. And that is thousands of times slower. Kafka was built to align with how disks actually work.
SPEAKER_03So if RabbitMQ is a smart broker, Kafka is a dumb broker.
SPEAKER_00In a way, yes. The popular term is dumb broker, smart consumer. If RabbitMQ is the post office, Kafka is a newsstand.
SPEAKER_03A newsstand. OK, I like this. Unpack that for me.
SPEAKER_00The publisher, the newspaper company, prints a newspaper. That's the message. And just drums a big stack of them at the newsstand every morning. The newsstand doesn't know who is going to read them. It doesn't deliver them to specific houses. It just holds the stack. Its only job is to guarantee the stack is there and that the papers are in the correct chronological order.
SPEAKER_03It's just a big, passive repository of data. Here's the fire hose. Come and drink.
SPEAKER_00Exactly. And the consumers, the readers, come to the newsstand. One person might show up at 6 a.m. and grab the paper the second it lands. Another person might come by three days later and ask for a back issue. The newsstand doesn't care who reads it or when they read it.
SPEAKER_03And this is critical, right? The newsstand doesn't track what page you're on.
SPEAKER_00Boom. That is the key architectural difference. In RabbitMQ, the broker is stateful. It tracks, did you, consumer A, successfully process this message? Yes. Okay, I'll delete it now. In Kafka, the consumer is responsible for its own state. The consumer tracks its own progress. I have read up to offset 500. Okay, now I'm on offset 501.
SPEAKER_03Yeah.
SPEAKER_00The broker is stateless from the consumer's perspective. Okay.
SPEAKER_03And this allows for something that the post office model, RabbitMQ, just fundamentally can't do, replayability.
SPEAKER_00This is huge. For sourceful energy, Frederick, I really want you to pay close attention to this part because this could be a game changer. Go on. Imagine you have an algorithm that's running on your live data stream and is detecting grid instability or maybe patterns of power theft. It's working great. But then next month, one of your data scientists comes up with a better algorithm, a much more accurate model.
SPEAKER_03OK. In the RabbitMQ world, the old data is gone. The messages were processed and deleted. You can only run the new model on new data going forward.
SPEAKER_00Correct. But in the Kafka world, the data is still on the tape. It's still on the newsstand. The retention period might be seven days or 30 days or even forever. Frederick's team can spin up a new consumer with the new smarter algorithm pointed at the beginning of the log from last week and replay the entire history through the new model.
SPEAKER_03So he can travel back in time. He can reanalyze past events with new intelligence.
SPEAKER_00He can correct the past. He can ask new questions of old data. This is what J. Kreps means by turning the database inside out. The log, the stream, is the true source of truth. Any database you have is just a temporary materialized view of that log. And if you don't like that view, you can always rebuild a new one from the original immutable log.
SPEAKER_03There's another technical detail here that gets thrown around a lot. Zero copy. It's like this holy grail of speed in engineering circles. How did Kafka get so fast at moving data from disk to the network?
SPEAKER_00This is some pure, beautiful kernel-level optimization. So normally when data comes off a disk to be sent over the network, it's a bureaucratic process. It has to be copied from the disk into the kernel's memory space, then copied up into the application's memory space, what we call user space, and then copied back down into the kernel's networking buffer to go to the network card.
SPEAKER_03That's a lot of copying for the same bytes.
SPEAKER_00It's a lot of lifting. It's inefficient. Kafka skips the bureaucracy.
SPEAKER_03How? How?
SPEAKER_00It uses a specific Unix system call called sent file. It simply tells the operating system, hey, see this data in the disk page cache. I want you to shove it straight onto the network card. Don't even bother showing it to me in my application memory. The data goes directly from the kernel's disk cache to the kernel's network socket buffer. The application doesn't even touch it. It's zero copy. And that's how they achieve that insane disk saturating throughput.
SPEAKER_03Okay, so this is incredible. We have the sophisticated smart router with RabbitMQ. We have the massive replayable fire hose with Kafka. It feels like we've covered the main bases. But as cloud computing got more complex, as we moved to microservices and containers, another frustration started to bubble up.
SPEAKER_00Yes, the frustration of one Derek Collison.
SPEAKER_03Section four, radical simplicity, the birth of gnats.
SPEAKER_00So Derek Collison is a bit of a legend in this space. He worked on Tibby CEO back in the day. He was an engineer at Google. And around 2010, the same time Kafka was being invented, he was at VMware. He was building Cloud Foundry.
SPEAKER_03Which was one of the first big successful platforms as a service, kind of a precursor to Kubernetes in some ways.
SPEAKER_00Exactly. And he was using RabbitMQ as the internal message bus to coordinate all the moving pieces of Cloud Foundry. But Derek felt it was too heavy. There's a famous quote where he called it a pet, not cattle.
SPEAKER_03Pet, not cattle. What does that mean? In the cloud world, cattle are servers you can just shoot and replace without a thought.
SPEAKER_00They're anonymous and disposable. A pet is a server you've named that you have to feed and groom and take special care of. He felt RabinMQ needed too much special attention. And apparently one Friday, it locked up again.
SPEAKER_03This is the infamous rage coding incident.
SPEAKER_00It's a classic engineer moment. He leaves work on a Friday, just completely frustrated. He says to his team, I don't want to build another TyBCO server. He goes home, and over a single weekend...
SPEAKER_03He writes the first version of NATS.
SPEAKER_00In Ruby.
SPEAKER_03In 48 hours. From scratch. He comes back to the office on Monday morning, rips RabbitMQ out of the entire Cloud Foundry code base, and drops in his brand new NATS server.
SPEAKER_00That must have given the project managers a collective heart attack.
SPEAKER_03Oh, I'm sure. And Alexis Richardson over at RabbitMQ probably wasn't too happy either. But the thing is, it worked. It was fast and it was simple.
SPEAKER_00So what made NAT so different? What is this dial tone philosophy that Derek talks about? Derek wanted a messaging system that was like a dial tone on an old landline phone. When you pick up the receiver, you don't wonder if the dial tone will be there. You don't configure it. You don't wait for it to boot up. It's just there. It's instant. It's simple. It always works.
SPEAKER_03But to get that level of simplicity, he made a pretty radical tradeoff, one that scares a lot of traditional enterprise architects.
SPEAKER_00He did. He removed persistence entirely. The original Nats was pure fire and forget.
SPEAKER_03What does that mean exactly? It means if you send a message and there's no one currently subscribed and
SPEAKER_00listening to that subject, the message is just gone. Poof. Dropped on the floor. Into the void.
SPEAKER_01Wow. Okay.
SPEAKER_00And, maybe even more controversially, if a consumer's listening but they're too slow and they can't keep up with the publisher, Nats clicks them off.
SPEAKER_03It just disconnects them.
SPEAKER_00Ruthlessly. NATS is designed to prioritize the health of the entire system over the health of any individual client. In the RabbitMQ world, if you have a slow consumer, the broker starts buffering messages for it. If that buffer gets too full, the broker might start pushing back on the publisher, telling it to slow down. The whole system gets sluggish to accommodate the slow kid in the class.
SPEAKER_03And NATS just kicks the slow kid out of class.
SPEAKER_00Exactly. It says you're a drag on the system. You're causing a backlog. Goodbye. And it drops the connection.
SPEAKER_03So what kind of use case is that good for? It sounds dangerous.
SPEAKER_00It's designed for control planes, for heartbeats, for service discovery, for situations where the latest message is the only one that matters.
SPEAKER_03Can you give an example?
SPEAKER_00Sure. Think about a temperature sensor in one of your facilities. It's sending a reading every single second. 72 degrees. 72.1 degrees. Now imagine the network connection for monitoring dashboard drops for five seconds and then comes back. Do you really want to receive those five old stale readings from five seconds ago?
SPEAKER_03No, that's old news. It's actually harmful. I just want to know that the temperature is 73 degrees right now.
SPEAKER_00Exactly. Processing the old data creates a backlog, and it delays you from understanding the current reality. So for those use cases, NATS prioritizes liveness over completeness. It's all about speed and simplicity. And it is ridiculously fast. The original Ruby version did 150,000 messages a second. The rewrite in Go does something like 18 million.
SPEAKER_03They did eventually add persistence back in, right? Because sometimes you do want the history. You can't just throw everything away.
SPEAKER_00They did. They realized that while fire and forget is perfect for control planes, a lot of people wanted to use the simplicity and speed of NATS for data streams too. So they added a new layer on top called Jetstream.
SPEAKER_03Jetstream.
SPEAKER_00Jetstream is persistence, but it's completely opt-in. you can still use the lightweight, blazing fast core NATs for your ephemeral messaging. But for certain subjects where you need durability, you can tell the server, hey, for this one, please keep a copy on disk. It's an attempt to get the best of both worlds, to keep that lightweight dial tone feel while adding the durability of a Kafka-style stream.
SPEAKER_03Okay, so we've got the enterprise bus, the open source router, the big data fire hose, and the lightweight dial tone. That covers a lot of ground, but there's one more environment we absolutely have to talk about. And for you, Frederick, at Sourceful Energy, this might be the most relevant one for the actual hardware you have out there in the field.
SPEAKER_00Right. We need to go to Section 5, Constraint-Driven Innovation, the world of MQTT.
SPEAKER_03This story is fantastic. It takes us back in time, and it takes us out to the desert.
SPEAKER_00It does. It's 1999. The company's Phillips 66, and they have thousands of miles of oil pipelines running through remote areas. They need to get sensor data pressure, flow rate, temperature from these pipelines back to a central control center. And how are they connecting these things in the middle of nowhere in 1999? Satellites. And we're not talking about your fancy new Starlink satellites. We're talking 1999 VA sat links. They were incredibly expensive and they were often charged by the bite.
SPEAKER_00The latency was high and the bandwidth was, well, it was around 300 baud.
SPEAKER_03300 baud. That is painfully, painfully slow. I think I can read faster than that.
SPEAKER_00It's a trickle. It's barely a drip. And the existing protocols at the time, like IBM's own MQ series, had these huge verbose headers. The packaging around the actual data could be thousands of bytes. If you just wanted to send a single temperature reading, maybe four bytes of data, you'd have to wrap it in this giant package. It would clog the line for seconds and cost a fortune.
SPEAKER_03So IBM sends one of their engineers, Andy Stanford Clark, and he meets up with a guy named Arlen Nipper from a partner company.
SPEAKER_00And the two of them just became completely obsessed with optimization. There's this great anecdote where Andy Stanford Clark would come back from taking a shower and announce to the team, I figured out how to save two bytes.
SPEAKER_03Two bytes. Most engineers today wouldn't even notice two bytes.
SPEAKER_00But when you're paying by the byte and your connection is 300 baud, two bytes is a massive victory. They paired the protocol down to the absolute bare minimum bone. The entire MQTT header is just two bytes.
SPEAKER_03That's microscopic.
SPEAKER_00It is pure signal. Yeah. There's almost no noise. Yeah. They built in features specifically designed for these shoddy networks, networks that break all the time.
SPEAKER_03Like the last will and testament feature.
SPEAKER_00This is such a cool and elegant feature for the Internet of Things. Imagine one of your sensors on the grid dies. Maybe the battery fails or a bulldozer cuts the fiber line. It doesn't have time to send a message saying goodbye. I'm dying. It just vanishes. So the central server doesn't know if the sensor is dead or if it's just quiet
SPEAKER_03because nothing is happening.
SPEAKER_00Right. It's ambiguous. So an MQTT, when a device first connects to the broker, it can hand the broker a sealed envelope, a last will and testament. And it says, if I disconnect ungracefully, if you stop hearing my heartbeat and I haven't sent a clean logout message, please open this envelope and publish this message on my behalf to this alert topic. So the system knows immediately that the device is confirmed dead, not just silent.
SPEAKER_03The broker acts on behalf of the dead device.
SPEAKER_00Exactly. It can publish a message that says, alarm, sensor 4 is offline. It allows the system to be smarter and more reactive than the individual fragile devices at the edge.
SPEAKER_03Now, for about a decade, MQTT was just this obscure niche industrial protocol, you know, SCADA systems, oil rigs, things like that. Until... Facebook. The consumer validation. It's 2011. Facebook is trying to build Facebook Messenger for mobile phones. But back then, mobile phone batteries were terrible and 3G networks were unreliable. Right. And using the standard web protocol, HTTP... was a battery killer. It required the phone to constantly pull the server, waking up the radio every few seconds to ask, do I have a new message yet? Do I have a new message yet?
SPEAKER_00It keeps the radio on, which is the biggest power drain on a phone. Drain the battery in just a few hours. So the engineers at Facebook went looking for a better way. And they found this obscure protocol from the oil and gas industry. Because MQTT was designed for battery-powered sensors in the desert, it was perfect for battery-powered iPhones on a spotty 3G network. It maintains a tiny, persistent, low power connection. The phone just sleeps until the server pushes a message down to it. And as the line goes, overnight,
it went from oil rigs to 800 million pockets.
SPEAKER_00It's the de facto protocol of the edge. For sourceful energy, Frederick, if you have solar inverters, smart meters, battery controllers, sensors in basements with bad Wi-Fi MQTT is the language they should be speaking. It's designed to survive in conditions where Kafka or RabbitMQ would simply time out and fail. So, okay, we've covered the history, we've met all the characters, now section six, synthesis.
SPEAKER_03We need to put this all together into a coherent toolbox for Frederick.
SPEAKER_00Right. How do you look at the landscape as it stands today? And we should probably briefly mention that there are other players just to show
SPEAKER_03the full landscape isn't just these four.
SPEAKER_00Absolutely. For example, you have zero MQ.
SPEAKER_03Which is funny because it isn't really a message queue, is it?
SPEAKER_00The name is a classic bit of nerd humor. It means zero broker. It's actually a library for building your own messaging patterns directly into your applications. It's for when you want raw speed between two programs and you absolutely do not want a central server in the middle acting as a bottleneck or a single point of failure.
SPEAKER_01Sockets on steroids is the phrase I always hear.
SPEAKER_00That's what it is. It was created by another one of these fascinating philosopher engineers, Peter Hinchins, who believed in absolute minimalism and distributed intelligence.
SPEAKER_03And what about Pulsar? That's a newer name that comes up a lot.
SPEAKER_00Apache Pulsar is the big modern challenger to Kafka. Came out of Yahoo. Its main architectural innovation is the separation of compute from storage.
SPEAKER_03What does that mean?
SPEAKER_00In Kafka, the broker machine is responsible for both handling network connections and storing the data on its local disk. They are tightly coupled. In Pulsar, the brokers that handle connections are a separate layer from the storage nodes that actually hold the data. This lets you scale them independently and gives you some really nice features for things like geo-replication. It's often seen as a more cloud-native Kafka.
SPEAKER_03And finally, Redis. People use Redis for messaging all the time.
SPEAKER_00Yeah, Redis is primarily an in-memory cache, a key value store. But because it's already in so many people's tech stacks and it's incredibly fast, they started using it for messaging. The feature called Redis Streams is basically them stealing the log idea directly from Kafka and implementing it inside the cache.
SPEAKER_03Okay, so let's connect all these dots. Frederick is sitting there. He's looking at his architecture diagram. He sees this invisible backbone we talked about. How does he choose?
SPEAKER_00Here's the cheat sheet. And the key thing to remember is that it's not about which one is best in a vacuum. It's about matching the tool to the friction it was originally designed to solve.
SPEAKER_03Okay, let's break it down by need. Give me the use case.
SPEAKER_00All right. If you need complex routing and transactional reliability, You have a job that absolutely must be done. Maybe you need to route it based on message headers. You need to ensure only one worker processes it. You use RabbitMQ. It's the smart broker. You use the post office.
SPEAKER_03Got it.
SPEAKER_00If you need massive history, replayability, and analytics, you're ingesting millions of data points from your grid every minute, and you want to run new machine learning models on that data next month, you use Kafka. It's the distributed log. You use the newsstand.
SPEAKER_03That makes sense. Keep going.
SPEAKER_00If you need low latency control and microservice communication, you have 50 small services chattering back and forth. You need heartbeats. You need fast request reply for internal APIs. You use NATs. It's the dial tone.
SPEAKER_03And last, the edge.
SPEAKER_00And if you are talking to the real world, to your sensors, your inverters, your devices out in the field on spotty, unreliable networks, use MQTT.
SPEAKER_03Perfect. That's a great summary. But you mentioned something earlier, the convergence.
SPEAKER_00Yes. And this is where it gets really interesting for anyone building a system today. They are all stealing from each other.
SPEAKER_02How so?
SPEAKER_00Well, Kafka realized that people sometimes just want a simple work queue, so they're adding features like share groups to mimic that. RabbitMQ realized that people loved the replayable stream idea from Kafka, so they build RabbitMQ streams. Nats, as we said, added persistence with Jetstream.
SPEAKER_03So everything is becoming a hybrid of everything else.
SPEAKER_00Exactly. The lines are blurring, which can be confusing. But this is why understanding the origin story, the DNA of the tool, is so important. RabbitMQ can do streams now, but it was born to route. It will probably never be as efficient at pure sequential log appends as Kafka. And Kafka can sort of do queues, but it feels clumsy compared to the elegance of RabbitMQ for that task. My advice is to stick to the tool's DNA for your most critical paths.
SPEAKER_03And for a modern, complex stack like Sourceful Energy.
SPEAKER_00You probably use all of them. All of them? Really? It's an incredibly common and powerful pattern. You use MQTT at the edge on all your field devices. That becomes the protocol for the last mile. All those MQTT brokers feed their data into a central Kafka cluster for injection, long-term storage, and big data analytics. Okay. Then, when your analytics platform finds an important insight in that Kafka data, it triggers an action by sending a message to a microservice via NATs. And maybe that action is to create a complex billing task that
needs guaranteed
SPEAKER_00transactional processing. So it drops that job into a RabbitMQ queue for a worker to pick up.
SPEAKER_03So it's not a winner-take-all competition. It's an ecosystem.
SPEAKER_00It is. It's about using the right pipe for the right kind of fluid at the right point in the system. Let's wrap this all up with some final thoughts for Frederick to take away. I think the single most important takeaway from this whole history is that there is no perfect messaging system. Every single one of these tools we've discussed, TPCO, Rabbit, Kafka, Nats, MQTT, was born out of a very specific frustration. An engineer hit a wall, the existing tools were too slow or too heavy or too expensive or just too damn complex, so they built something new.
SPEAKER_03And they're all ultimately just software. They're maintained by humans.
SPEAKER_00That's the other thing. These massive industrial systems, they can feel like these immutable forces of nature, but they're not. They are the direct result of Derek Collison having a really bad Friday, or Jay Kreps hating his ETL pipeline, or Andy Stanford Clark trying to save two bites in the shower. They're human artifacts. So Frederick, here is our provocative closing thought for you to chew on. If the entire history of messaging is defined by frustration with the current
SPEAKER_03limits, what is the current frustration in your stack?
SPEAKER_00Where are your engineers rage coding right now? What part of the system makes them sigh when they have to work on it? Where are they fighting the infrastructure instead of building business value? Because that friction point, that's not just a nuisance to be filed in a backlog.
SPEAKER_03That is the signal that the next evolution is needed. Maybe you're not going to go invent a new global protocol over the weekend.
SPEAKER_00Spotting that friction is where the next big leap in your own company's architecture will come from. Moving from that brittle telephone chain to a truly resilient nervous system only happens when you finally get tired of accepting the busy signal. The invisible backbone keeps the lights on, and for sourceful energy, that's quite literal.
SPEAKER_03Frederick, thanks for letting us do this deep dive into your stack.
Coordinated with Fredrik, Episode 127. Forty-two minutes on how a company gets its price: what a multiple counts, why the same krona can be worth seven years in one company and twenty-seven in another, how a rise in...
Fifty minutes on two runs a day apart: the rest of Vancouver, and the road from ten Helium gateways to physics first. An interview with Lily. On Thursday I answered her questions in English; on Friday I went back to...
Thirty-seven minutes on two runs a day apart: the two years after the money came in, and home. An interview with Lily. I answered her questions in Swedish while running; the English voice you hear is my cloned voice...
Thirty-nine minutes on the two years before a term sheet arrived on my birthday, and what it took to turn it into money. An interview with Lily. I answered her questions in Swedish on a fifteen-kilometre run; the...
This episode started in a car. A clear October day, low sun, the drive from Kalmar to Stockholm. I could have flown, and it would have been faster. But the hours in the car are a different kind of time. The car keeps...