By Andrew Tan
The Hidden Costs of Building Your Own Batch-Streaming Integration Layer
With AI-assisted coding, building your own data pipelines looks cheaper than ever. But the real costs aren't in the initial build—they're in the maintenance, the on-call rotations, and the accumulated complexity that compounds over time.
Here's a conversation that keeps happening:
Engineering Manager: "We need a new data pipeline for the customer analytics project."
Senior Engineer: "I can build that. With Cursor and Copilot, I can have the core logic done in a couple of days."
EM: "What about maintenance?"
SE: "It's just a Python script with some Airflow orchestration. How hard can it be?"
Three months later, the engineer who built it is on vacation, the pipeline is failing silently, and nobody can figure out why the customer segment counts don't match the source system. The "simple Python script" has grown to 2,400 lines, touches three different databases, and has exactly zero documentation about what the business logic is actually supposed to do.
The AI coding revolution has made the build decision feel almost free. What it hasn't changed is the own decision — and that's where most of the cost lives.
The Honest Accounting
When teams estimate the cost of building their own data integration layer, they usually model something like this:
| Cost Item | Estimated |
|---|---|
| Initial development | 2-3 weeks of engineer time |
| Infrastructure | Existing Kubernetes cluster |
| Maintenance | "Just keep it running" |
| Total first-year cost | ~$30K loaded |
Here's what the spreadsheet actually looks like after twelve months:
| Cost Item | Actual |
|---|---|
| Initial development | 4 weeks (scope crept) |
| Infrastructure | $8K/year in compute, storage, network |
| On-call burden | 15-20 hours/month paging, debugging, fixing |
| Schema drift incidents | 3 major, 8 minor (data quality failures) |
| Failed retry handling | Built ad-hoc, never quite right |
| Documentation debt | Still zero, now critical |
| Knowledge silo risk | One engineer understands it |
| Total first-year cost | ~$85K loaded + opportunity cost |
The gap isn't because engineers are bad at estimation. It's because the spreadsheet only captures the work you can see upfront. The real costs accumulate invisibly: the 2 AM pages, the "quick fixes" that become permanent, the subtle data corruption that takes days to detect.
The Two-Pipeline Problem
There's a specific failure mode that hits teams building their own batch-streaming infrastructure: the divergence problem.
You start with batch. It's straightforward. You write a job that runs every hour, extracts data, transforms it, loads it somewhere. Works fine.
Then the business asks for real-time. "Can we get this data in seconds instead of hours?"
So you build a streaming pipeline. Kafka, maybe Flink or Spark Streaming. It consumes the same source data and delivers to the same destination. But the transformation logic is different — streaming has different constraints, different state management, different failure modes. You can't just port the batch code over.
Now you have two pipelines doing roughly the same thing. They produce slightly different results because the batch join is outer and the streaming join is inner, or because the batch job handles late data differently than the streaming window. When someone asks why the numbers don't match, you have to debug both systems.
Six months in, you've got:
- Two codebases to maintain
- Two sets of infrastructure to monitor
- Two failure modes to understand
- Two on-call rotations (or one very unhappy person)
- And one persistent question: why can't we just have one pipeline?

The honest answer: because batch and streaming are genuinely different paradigms, and most DIY stacks aren't built to unify them.
The Hidden Complexity Multipliers
Beyond the obvious costs, there are three complexity multipliers that don't show up in initial estimates:
Schema Evolution
Your source system changes. A column gets renamed. A type gets widened. A new nullable field appears. In a managed platform, this is handled. In your custom pipeline, it's a code change, a deployment, and a prayer that you didn't break downstream consumers.
The real cost isn't the change itself. It's the coordination: notifying every team that consumes this data, updating their schemas, testing the integration, rolling back if something goes wrong. A two-hour code change becomes a two-week project.
Failure Handling at Scale
A simple retry loop is easy. Exponential backoff, a dead letter queue, some alerting — you can build that in an afternoon.
But production failure handling is fractal. What happens when the destination is down for an hour? What happens when a message is too large? What happens when a schema mismatch causes a parse failure? What happens when the same event gets delivered twice? What happens when network partitions create split-brain situations?
Each edge case needs handling. Each handler needs testing. Each test needs maintenance. The "simple retry logic" grows into a distributed systems concern that nobody on the team has deep expertise in.
Observability Gaps
You need to know: Is the pipeline running? Is it keeping up with the source? Are events being processed or dropped? What's the latency? What's the error rate? What's the cost per million events?
Building this visibility isn't just adding a metrics endpoint. It's designing the right metrics, building the dashboards, setting the right alerts (not too noisy, not too quiet), and training the team to interpret them. It's another system to build, maintain, and debug.
When Building Actually Makes Sense
I want to be fair. There are situations where building your own integration layer is the right call:
You have extremely specific requirements that no vendor handles well — unusual data formats, custom security constraints, exotic deployment environments.
You have the team for it — distributed systems engineers who've operated Kafka at scale, who understand exactly-once semantics, who've debugged backpressure problems at 3 AM.
It's a genuine differentiator — the data processing layer is core to your product, not just infrastructure. You're not building a pipeline; you're building a competitive advantage.
You're at a scale where vendor costs exceed build costs — though be honest about what "build cost" includes. Most teams underestimate by 2-3x.
For everyone else, the calculation usually favors buying — if you account for the full cost of ownership.
The Vendor Evaluation That Actually Matters
If you're comparing vendors, the feature matrix is the wrong place to start. Most platforms have similar capabilities on paper. What matters is the operational model:
How do they handle the 2 AM problem? When something breaks in production, who gets paged? Is it your team debugging their infrastructure, or their team debugging your pipeline?
What's the migration path if you leave? Data pipelines are sticky. Understand what it costs to extract your logic and move it elsewhere.
Do they unify batch and streaming? Or will you end up with two pipelines anyway, just in someone else's infrastructure?
What's the real TCO? Include training, integration time, the cost of waiting for features you need, and the opportunity cost of engineering time spent managing the platform.
Where layline.io Fits
I won't pretend this is an unbiased take. At layline.io, we built a platform specifically for teams who've done the honest accounting and decided that building isn't the right call.
The core bet: batch and streaming shouldn't be separate pipelines. They should be the same workflows, the same tooling, the same team. When you need real-time, you don't rebuild. You adjust a configuration.
The operational burden sits with us. Schema evolution, failure handling, observability — that's the platform's job, not yours. Your team focuses on the business logic, not the distributed systems plumbing.
Is it cheaper than building your own? That depends on how honestly you account for the build cost. If you're counting two weeks of development and calling it done, probably not. If you're including the on-call rotation, the maintenance burden, the schema drift incidents, and the opportunity cost of engineers not building product features — then usually, yes.
The Question to Ask
Before your team commits to building, ask this:
"If we build this ourselves, who owns the 2 AM page when it breaks six months from now? And do they know what they're signing up for?"
If the answer is clear and everyone understands the commitment, build away. If there's hesitation, or if the answer is "we'll figure that out later," do the honest accounting. The numbers might surprise you.
Andrew Tan is a serial entrepreneur and founder of layline.io, building enterprise data processing infrastructure that handles both batch and real-time workloads at scale.



