Duplicated Streaming State Costs
Justy and Cody examine a Hazelcast-sponsored New Stack article arguing that duplicated streaming state—processing state in Flink plus a serving copy in Redis—costs more than memory bills show, with CPU, network, freshness, and consistency risks. Cody tests the technical argument; Justy asks who should actually care and whether it changes anything practical.
Transcript
Justy So there’s this New Stack piece about duplicated streaming state, and the headline is basically that your memory bill isn’t showing the real cost of keeping state in Flink and then copying it into Redis just so your app can read it. I’m curious if you think this is actually a thing teams are paying for, or if it’s just infrastructure navel-gazing.
Cody It’s a real thing, but the article overgeneralizes. The core example is sound: Flink holds keyed state for a windowed count, Queryable State got deprecated in 1.18, so teams publish to Redis and read from there. That’s a genuine extra hop. But the cost argument gets fuzzy fast.
Justy Right.
Cody They lean on a 2025 Berkeley and Databricks paper about distributed cache economics, plus an old Google ProtoCache latency number. The cache paper compared caching versus no caching, not Flink versus Redis. It found three to four times cost savings because CPU savings beat extra RAM. That tells you something about caching in general, not about whether your Flink-to-Redis pipeline is bleeding money.
Justy Oh interesting.
Cody And they do this illustrative math where 400 gigabytes of memory is about eight hundred dollars a month, and doubling it is sixteen hundred. But they’re careful to say that’s memory arithmetic, not a measured Hazelcast saving. My read is the mechanism is real, but the numbers they wave around don’t prove the specific case.
Justy So who should actually care? If you’re a small team running one streaming job, this feels like the kind of thing you file under “optimize later.”
Cody Exactly. The article’s own threshold is basically long-lived keyed jobs, multiple jobs recomputing the same aggregates, and a cloud bill nobody can explain. If that’s not you, refactoring to co-locate compute and state probably costs more than it saves.
Justy But there’s a consistency angle too that feels more urgent than the bill. The refund example—a customer gets paid twice because a replica lagged behind—is the kind of bug that ships to production and actually hurts people.
Cody Yes, and the article is careful to separate export lag from replica lag from a check-then-act race. That matters. Duplicate refunds aren’t caused by the duplicated state alone; they’re caused by deciding without atomically checking and updating the authorizing state. You can have one platform and still get double-paid if your refund paths aren’t coordinated.
Justy So the practical take isn’t “delete Redis.” It’s “know which copies you’re maintaining and why, and don’t confuse lag with a race condition.”
Cody Right. And if you’re going to co-locate, Hazelcast’s entry processors can update a map entry atomically on the member holding the key, but that doesn’t make everything strongly consistent during partitions, and it doesn’t make a map update atomic with an external payment service. You still need idempotency on the refund path.
Justy Mm-hm.
Cody The article’s strongest point is probably the update-path count. Separate systems can mean four or five serialization or network steps for one read-modify-write. Co-located can get that down to one. That’s not a precise cost measure, but it’s a useful way to trace where CPU and network actually go.
Justy I think that’s the part that lands for builders. You don’t need a total-cost model to look at your architecture and count hops.
Cody Yeah. Provisional read: duplicated state isn’t automatically waste, but it’s a copy you should be able to justify. The evidence supports the mechanism and the consistency risks; it does not support the headline as a universal tax on streaming.
Justy Nice. We did a whole episode on state duplication back when we talked about Kafka and Flink RocksDB, and this is basically the same fight from the serving side.
Cody Round two of the same argument. I’ll take it.
Justy That’s it for this one. We’ll catch you next time on Exploring Next.