Skip to main content

Data Processing Does Not Belong in the Message Broker

Struggling with delivery, architecture alignment, or platform stability?

I help teams fix systemic engineering issues: processes, architecture, and clarity.
→ See how I work with teams.


Apache Kafka made event streaming practical at scale. Pushing data processing into the streaming platform creates recovery, scaling, and isolation problems in production. Vendor documentation, Kafka improvement proposals, and migration case studies point to the same architectural boundary: streaming platforms handle durable transport, processing engines handle state and checkpoints. Separating them leads to systems that scale and recover cleanly.

Kafka changed the industry by making event streaming practical at scale. Durable logs, ordering, fan-out, and backpressure turned event-driven systems from fragile prototypes into mainstream infrastructure.

Where things get messy is when teams push data processing into the streaming platform itself: Kafka Streams, ksqlDB, broker-side transforms. It starts as convenience and ends as operational coupling. Not because engineers are doing it wrong, but because the streaming layer and the processing layer solve different problems.

The evidence is public: vendor documentation, Kafka KIPs, and real migration stories.

The boundary in one picture

Coupled: Processing inside the platform Transport and processing share cluster resources Kafka / Redpanda brokers Logs, ordering, replication, fan-out Kafka Streams / ksqlDB / Transforms State, queries, joins, aggregations X Recovery time grows with state size X Cannot scale processing independently X Resource contention across workloads Separated: Dedicated processing engine Transport and compute scale independently Kafka / Redpanda / KafScale Durable log, routing, backpressure Apache Flink / Spark / Wayang Checkpoints, state snapshots, isolation OK Seconds-to-recover with checkpoints OK Scale processing without scaling brokers OK Workload isolation by design
When processing lives inside the streaming platform, scaling and recovery get coupled to the broker fleet.

1. Replay-based state recovery does not age well

Kafka Streams restores state by replaying changelog topics. Simple mechanism, but recovery time grows with state size.

"Kafka Streams restore[s] the corresponding state store by replaying the changelog topic."

Confluent: Stateful fault tolerance in Kafka Streams

This becomes a production problem when state is large and failures are not hypothetical.

"Kafka Streams lacks a checkpointing mechanism for quick restoration after total system failures, leading to long recovery times."

Volt Active Data: Top 3 Kafka Streams Challenges
Recovery behavior as state grows Kafka Streams (replay) Minutes to hours Apache Flink (checkpoints) 5-10 seconds Bar width = recovery time. Transparency shows growth with state size. Replay scales with changelog. Checkpoints stay close to constant.

Processing engines like Apache Flink use checkpoint-based recovery. Benchmarks routinely show recovery in seconds even with large state.

2. Exactly-once semantics are narrower than most assume

Kafka's exactly-once is scoped to read-process-write within Kafka. The read and process phases are still at-least-once.

"Using transactions enables Exactly Once Semantics (EOS) ... (The read and process have at least once semantics)."

Spring Kafka: Exactly Once Semantics

Once your pipeline writes to databases, calls APIs, or touches external systems, you need idempotency and deduplication. Kafka transactions do not extend across system boundaries.

Kafka transaction boundary (exactly-once here) Read Process Write to Kafka Outside Kafka (at-least-once) Database API call You handle idempotency here

The scalability side is documented too. Before Kafka 2.5, exactly-once required one transactional producer per input partition.

"The simplest solution is to create a separate producer for every input partition ... This architecture does not scale well as the number of input partitions increases."

Apache Kafka KIP-447

3. ksqlDB migration stories show the operational limits

ksqlDB made stream processing approachable through SQL. The hard part is running it long enough that schema changes, resource contention, and pipeline lifecycle become daily concerns.

Riskified published their migration story: schema evolution that required dropping and recreating streams, resource isolation issues on shared clusters, and the path to managed Flink.

"ksqlDB's approach to schema evolution didn't automatically incorporate newly added fields."

AWS Big Data Blog: Riskified's journey to Flink (May 2025)

The same story highlights isolation as a platform feature rather than an application responsibility.

"Managed Flink provides true job isolation by running each streaming application in its dedicated cluster."

AWS Big Data Blog

4. Vendors draw boundaries around broker-side processing

Redpanda's Data Transforms documentation is explicit about what broker-side processing should and should not do:

"Transforms have no external access to disk or network resources ... Only single record transforms is supported ... For aggregations, joins, or complex transformations, consider using ... Apache Flink ... Up to 8 output topics are supported ... Transforms have at-least-once delivery."

Redpanda docs: Data Transforms
Capability Broker transforms Processing engine Single-record transforms OK OK Joins and aggregations No OK External system access No OK Checkpoint-based recovery No OK Workload isolation No OK Exactly-once to external systems No OK
Broker-side transforms are intentionally limited. The boundary exists because brokers are not processing engines.

Confluent made a similar acknowledgment by acquiring Immerok to build a cloud-native Flink offering.

"Confluent signed a definitive agreement to acquire Immerok to accelerate the development of a cloud native Apache Flink offering."

Confluent press release (Jan 2023)

What this means in practice

Streaming platforms are built for durable transport: logs, ordering, fan-out, backpressure. They are not stateful compute engines with fast recovery, checkpoint coordination, and workload isolation.

When you couple transport and processing, scaling and recovery become coupled too. You cannot scale processing without scaling brokers. Compute costs get buried in messaging infrastructure.

Reference architecture: separated concerns Streaming Platform Durable log, ordering Kafka · AutoMQ · KafScale Processing Engine State, checkpoints, isolation Apache Flink · Spark Sinks Databases, lakes, APIs, warehouses Cross-engine orchestration (optional) Apache Wayang: run pipelines across Flink, Spark, other backends
Each layer does one thing well. Wayang orchestrates when pipelines span multiple engines.

The architecture that holds up under growth separates these concerns:

  • Kafka, AutoMQ, or KafScale for transport
  • Apache Flink for stateful stream processing
  • Apache Wayang when pipelines need to run across multiple execution backends

"Apache Wayang aims at decoupling the business logic of data analytics applications from concrete data processing platforms, such as Apache Flink or Apache Spark."

Apache Wayang

Lightweight transformations inside the streaming layer still make sense: filtering, format normalization, simple enrichment. That work belongs close to transport when it stays simple.

Core business logic with state, joins, and external writes does not. That belongs in a processing engine designed to checkpoint state, isolate workloads, and recover predictably.

Where KafScale fits

We built KafScale around this boundary. A streaming platform should focus on transport and durability, running as stateless, schedulable infrastructure rather than embedded compute.

The design keeps brokers free of local state and avoids embedding processing into the broker fleet. Processing belongs in Apache Flink or wherever your workloads need it.

Architecture and docs: kafscale.io
Source: https://github.com/KafScale/platform

Sources

If you need help with distributed systems, backend engineering, or data platforms, check my Services.

Most read articles

Building a Model-Agnostic Multi-Agent System with OpenClaw

Over one week we rebuilt our AI stack around OpenClaw’s multi-agent architecture to avoid provider lock-in and stop wasting premium tokens. By aligning models to tasks, diversifying fallbacks across providers, enforcing minimal tool access, and switching to memory-first workflows with ephemeral sessions, we reduced token usage per task by about 70% and cut our monthly bill by 77% while improving operational resilience. How We Achieved 77% Cost Reduction and Provider Independence Over the past week, we rebuilt our AI infrastructure around OpenClaw’s multi-agent architecture. The result was a 77% cost reduction , provider independence , and a delegation system that routes work to the most cost-effective model for each job. Below is the technical journey of optimizing a 7-agent squad with OpenClaw. The Challenge: Model Provider Lock-In We started with a simple problem: our entire squad defaulted to a single model provider. This created three issues: Cost inefficiency beca...

BacNet => MQTT in Production: The Real Cost of Bridging BACnet to MQTT at Scale

bacnet2mqtt looks simple in a README and expensive in production. Once BACnet polling, reconnection behavior, stale state, and MQTT publishing collide, teams discover they are not deploying a lightweight adapter but operating infrastructure. This article breaks down where bacnet2mqtt works, where it becomes a bottleneck, and which production patterns reduce the operational damage before incidents, backlogs, and silent data loss turn a building integration into a long-running engineering problem. I inherited a building controls integration problem 18 months ago. Three office floors. 217 BACnet sensors covering temperature, occupancy, and HVAC actuators. The data was trapped inside the building automation network while the business wanted analytics, reporting, and compliance visibility in the data platform. The obvious answer looked easy enough: deploy bacnet2mqtt, bridge BACnet into MQTT, and push the stream into the lakehouse stack. The repository made it sound like a w...

Get Apache Flume 1.3.x running on Windows

Since we found an increasing interest in the flume community to get Apache Flume running on Windows systems again, I spent some time to figure out how we can reach that. Finally, the good news - Apache Flume runs on Windows. You need some tweaks to get them running. Prerequisites Build system: maven 3x, git, jdk1.6.x, WinRAR (or similar program) Apache Flume agent: jdk1.6.x, WinRAR (or similar program), Ultraedit++ or similar texteditor Tweak the Windows build box 1. Download and install JDK 1.6x from Oracle 2. Set the environment variables    => Start - type " env " into the search box, select " E dit system environment variables ", click Environment Variables, Select " New " from the " Systems variables " box, type " JAVA_HOME " into " variable name " and the path to your JDK installation into "Variable value" (Example:  C:\Program Files (x86)\Java\jdk1.6.0_33 ) 3. Download maven from Apache 4. Set...