Live data from Hacker News

“Streaming vs. Batch” Is a Wrong Dichotomy, and I Think It's Confusing

morling.dev

11–20 of 45 posts

Re: “Streaming vs. Batch” Is a Wrong Dichotomy, and I Think It's Confusing

#11
From skimming the article, it seems that this is a munging of the terms in directions that just aren't meaningful.

I've had the following view from the beginning:

- Batches are groups of data with a finite size, delivered at whatever interval you desire (this can be seconds, minutes, hours, days, or years between batches).

- Streaming is when you deliver the data "live", meaning immediately upon generation of that data. There is no defined start or end. There is no buffering or grouping at the transmitter of that data. It's constant. What you do with that data after you receive it (buffering, batching it up, ...) is irrelevant.

JMHO.

Re: “Streaming vs. Batch” Is a Wrong Dichotomy, and I Think It's Confusing

#12

From skimming the article, it seems that this is a munging of the terms in directions that just aren't meaningful. I've had the following view from the beginning: - Batches are groups of data with a finite size, delivered at whatever interval you desire (this can be seconds, minutes, hours, days, or years between batches). - Streaming is when you deliver the data "live", meaning immediately upon generation of that da…

The lines blur though when you start keeping state between batches, and a lot of batch processing ends up requiring that (joins, deduplication, etc).

Re: “Streaming vs. Batch” Is a Wrong Dichotomy, and I Think It's Confusing

#13
post #10

It's quite amazing how none of the comments have bothered reading the article, but are also commenting about something completely unrelated to its title. The article rightfully says that it's not a question of streaming OR batching, because you can stream batches.

Because the author is lost in peculiarities of the systems he happens to work with that he is redefining the terms (see all the discussion around "push" and "pull"). That's gonna run into this problem. His problem is one of data transfer and a better fit for what hes looking for is probably "polling" versus "interrupt" driven.

Interrupts are a hardware feature on CPUs. You could have software that is effectively checking for events on each tick (clock cycle), and emulates interrupts. But that's what polling is.

Re: “Streaming vs. Batch” Is a Wrong Dichotomy, and I Think It's Confusing

#14

From skimming the article, it seems that this is a munging of the terms in directions that just aren't meaningful. I've had the following view from the beginning: - Batches are groups of data with a finite size, delivered at whatever interval you desire (this can be seconds, minutes, hours, days, or years between batches). - Streaming is when you deliver the data "live", meaning immediately upon generation of that da…

The lines blur though when you start keeping state between batches, and a lot of batch processing ends up requiring that (joins, deduplication, etc).

No, it really doesn't. The definition of "streaming", to me, can be boiled down to "you send individual data as soon as it's available, without collecting into groups."

Batching is, by definition, the gathering of data records into a collection before you send it. Streaming does not do that, which is the entire point. What happens after transmission occurs, on reception, is entirely irrelevant to whether the data transfer mode is "streaming."

Re: “Streaming vs. Batch” Is a Wrong Dichotomy, and I Think It's Confusing

#15
I think the article was getting at this at the end - different use cases naturally call for either a point-in-time snapshot (optimally serviced by pull) or a live-updating view (optimally serviced by push). If I am gauging the health of a system, I'll probably want a live view. If I am comparing historical financial reports, snapshot. Note that these are both "read-only" use cases. If I am preparing updates to a dataset, I may well want to work off a snapshot (and when it comes time to commit the changes, compare-and-swap if possible, else pull the latest snapshot and reconcile conflicts). If I am adjusting my trades for market changes, live view again.

If I try to service a snapshot with a push system, I'll have to either buffer an unbounded number of events, discard events, or back-pressure up the source to prevent events from being created. And with push alone, my snapshot would still only be ephemeral; once I open the floodgates and start processing more events, the snapshot is gone.

If I try to service a live view with a pull system, I'll have to either pull infrequently and sacrifice freshness, or pull more frequently and waste time and bandwidth reprocessing unchanged data. And with pull alone, I would still only be chasing freshness; every halving of refresh interval doubles the resource cost, until the system can't keep up.

The complicating real-world factor that this article alludes to is that, historically, push systems lacked the expressiveness to model complex data transformations. (And to be fair, they're up against physical limitations: Many transformations simply require storing the full intermediate dataset in order to compute an incremental update.) So the solution was to either switch wholesale to pull at some point in the pipeline (and try to use caching, change detection, etc to reduce the resource cost and enable more frequent pulling), or, introduce a pulling segment in the pipeline ("windowing" joins, aggregations, etc) and switch back to push after.

It's pretty recent that push systems are attempting to match the expressiveness of pull systems (e.g. Materialize, Readyset), but people are still so used to assuming pull-based compromises, asking questions like "How fresh does this data feed really _need_ to be?". It's analogous to asking "How long does this snapshot really _need_ to last?" - a relevant question to be sure, but maybe doesn't need to be the basis for massive architectural lifts.

Re: “Streaming vs. Batch” Is a Wrong Dichotomy, and I Think It's Confusing

#16
Batch processes IRL tend to “fetch” data, which is nothing like streaming.

For example, I’ve worked with “batch” systems that periodically go do fetches from databases or S3 buckets and then do lots of crunching, before storing the results.

Sometimes batch systems have separate fetchers and only operate vs a local store; they’re still batch.

Streaming systems may have local aggregation or clumping in the arriving information; that doesn’t make it a “batch” system. Likewise streaming systems may process more than one work item simultaneously; still not a “batch”.

I associate “batch” more with “schedule” or “periodic” and “fetch”; I associate “stream” with “continuous” and “receiver”.

Re: “Streaming vs. Batch” Is a Wrong Dichotomy, and I Think It's Confusing

#17
post #7
post #3

Streams have unknown size and may be infinite. Batches have a known size and it are not infinite.

Maybe I'm using the wrong definitions, but I think that's backwards. Say you are receiving records from users and different intervals and you want to eventually store them in a different format on a database. Streaming to me means you're "pushing" to the database according to some rule. For example, wait and accumulate 10 records to push. This could happen in 1 minute or in 10 hours. You know the size of the dataset…

It’s because you’re looking at it from opposing ends.

From the perspective of the data source, in a streaming context, the size is finite — it’s whatever you’re sending. From the data sink’s perspective, it’s unknown how many records are going to get sent in total.

Vice versa, in a batch context, the data source has no idea how many records will eventually be requested, but the data sink knows exactly the size of the request.

That is, whoever is initiating the job knows what’s up, and whoever is targeted just has to deal with it.

But generally I believe the norm is to discuss from the sink’s perspective, because the main interesting problem is when the sink has to deal with infinity (streaming). When then source deals with infinity (batch), it’s fairly straightforward to manage — refuse requests of too large a size and move on. The data isn’t going anywhere, so the sink can fix itself and re-request. You do that with streaming and data starts getting lost

Re: “Streaming vs. Batch” Is a Wrong Dichotomy, and I Think It's Confusing

#18
post #17
post #7

Earlier quoted context omitted.

Maybe I'm using the wrong definitions, but I think that's backwards. Say you are receiving records from users and different intervals and you want to eventually store them in a different format on a database. Streaming to me means you're "pushing" to the database according to some rule. For example, wait and accumulate 10 records to push. This could happen in 1 minute or in 10 hours. You know the size of the dataset…

It’s because you’re looking at it from opposing ends. From the perspective of the data source, in a streaming context, the size is finite — it’s whatever you’re sending. From the data sink’s perspective, it’s unknown how many records are going to get sent in total. Vice versa, in a batch context, the data source has no idea how many records will eventually be requested, but the data sink knows exactly the size of the…

In part I think that is because the sink can run out of memory, the store has already allocated enough memory.

Re: “Streaming vs. Batch” Is a Wrong Dichotomy, and I Think It's Confusing

#19
post #16

Batch processes IRL tend to “fetch” data, which is nothing like streaming. For example, I’ve worked with “batch” systems that periodically go do fetches from databases or S3 buckets and then do lots of crunching, before storing the results. Sometimes batch systems have separate fetchers and only operate vs a local store; they’re still batch. Streaming systems may have local aggregation or clumping in the arriving inf…

[deleted]
Post reply on HN