Distributed real-time systems frequently maintain redundant state across multiple platforms. A typical architecture might route events through Kafka, process them in Flink, cache results in Redis, and persist to a database as the source of truth. Some applications add vector stores to the mix. While this separation of concerns enables independent scaling and operational flexibility, it introduces costs in CPU cycles, network traversals, and data freshness that extend well beyond what memory pricing alone captures.

Not all state duplication warrants scrutiny. Replicas provide failure protection, checkpoints enable recovery, and durable event logs preserve history—these copies justify their overhead. The problematic copies are different: "The copies to question are those maintained largely because processing happens in one system and applications read the results from another."

Consider a fraud-detection system tracking transaction velocity on a payment card over five minutes. Flink maintains the keyed state needed for this calculation, but a fraud-scoring service must retrieve the result. Since Flink deprecated its Queryable State feature in version 1.18 and its internal state isn't designed for general-purpose queries, the typical solution publishes the count to Redis. This creates a dedicated serving layer with its own scaling and operational overhead. Each update requires serialization, network transmission, and processing before consumers see it, and the values in Flink's working state and Redis may diverge.

Where consistency gets complicated

Synchronizing state across availability zones introduces additional complexity. Imagine a payment system serving reads from asynchronous replicas distributed across multiple zones to minimize cross-zone traffic. A refund transaction completes, but the update hasn't yet reached all replicas. A service reading from a stale replica might see the original transaction as unrefunded and issue a second refund, resulting in duplicate payment to the customer.

This risk exists wherever application logic makes decisions based on asynchronously replicated state, regardless of whether processing and storage run on the same platform. The immediate problem combines replica lag with application code that fails to atomically check and update the state authorizing the refund. If the refund invokes an external payment service, that service must also implement idempotent request handling to prevent retries from duplicating the refund.

A separate processing-and-serving design introduces an additional delay: export lag, the time between when the processor calculates an updated value and when the serving store receives it. This differs from replica lag within the serving store itself. During export lag, a wave of fraudulent transactions might be scored against stale counts. Both export lag and replica lag can leave applications reading outdated data, but neither should be conflated with the check-then-act race condition that could trigger the duplicate refund.

Hazelcast can eliminate the separate publication step for workloads where computation runs directly on stored state. Its entry processors can atomically update individual map entries on the cluster member holding the relevant key. However, this doesn't automatically guarantee strong consistency during network partitions. Applications requiring stronger coordination can use appropriately configured data structures in Hazelcast's Raft-based CP subsystem, though this doesn't make ordinary IMaps strongly consistent or atomic with external payment services. Separate processing and storage systems can also implement strongly consistent coordination.

The cost of moving state

Memory typically dominates conversations about in-memory architectures, yet CPU and networking expenses can prove equally significant. A 2025 paper from UC Berkeley and Databricks, Rethinking the Cost of Distributed Caches for Datacenter Services, analyzed caching economics using synthetic workloads, Meta traces, and production data from Databricks' Unity Catalog. Using Google Cloud pricing assumptions of approximately $17 per vCPU-month and $2 per gigabyte-month of memory, researchers determined that adding in-memory caching reduced operating costs by a factor of three to four, with CPU savings outweighing the expense of additional RAM.

This study doesn't directly compare Hazelcast against Flink and Redis; rather, it compares caching with no caching. Its remote-versus-linked-cache comparison does support the narrower finding that communication and serialization consume CPU. The paper also revealed that per-read version checks for stronger consistency could eliminate much of the cost benefit, making equivalent consistency requirements essential for fair comparisons.

A 2019 Google paper, Fast Key-Value Stores: An Idea Whose Time Has Come and Gone, reported a 40% reduction in p99.9 latency for ProtoCache, a component of a Google application, after transitioning from a remote key-value store to an architecture colocating application logic with in-memory state.

A simple calculation illustrates the memory cost of maintaining two equivalent working sets. At the paper's assumed memory price, 400 GB would cost roughly $800 monthly in memory alone, excluding backups, checkpoints, and other infrastructure. Maintaining equivalent amounts in both processing and serving tiers would double this figure, though Flink's intermediate state and published Redis results can differ substantially.

Beyond memory, synchronization work itself carries overhead. Each update must be serialized, transmitted, and processed, and both platforms require monitoring, scaling, and maintenance. Tracing a single read-modify-write operation reveals the scope: with separate systems, an event might be ingested, keyed state updated, the result serialized and published, then written to the serving store before an application reads it—potentially four or five serialization or network steps for one update. Running computation where state resides can reduce this to a single step. While not a precise cost measure, mapping the path of an update helps identify where CPU time and network resources disappear.

A complete total-cost comparison must account for node counts, instance types, licensing, discounts, and equivalent managed-versus-self-managed deployments. The $800 figure represents memory arithmetic, not a total-cost estimate or measured Hazelcast savings.

Bringing computation closer to the data

Hazelcast provides one approach to moving processing nearer to stored data. Rather than shuttling information between separate systems, it distributes data across cluster members by key and can execute computations on the member holding that key. Backup copies protect against member failures.

Hazelcast offers two strategies depending on processing type. Hazelcast's Jet engine can maintain internal state for windowed stream calculations and publish results to a distributed map that applications read. The intermediate state and result-publication step still exist on the same platform; processing, map writes, and backups may involve traffic between members. Kafka can remain the durable event log in either design, and the database of record can remain in place.

For applications needing to update stored values directly, Hazelcast provides entry processors. These execute code against the map entry itself rather than calculating a result elsewhere and copying it across. The transaction counter example could use an entry processor maintaining per-minute transaction counts in a distributed map, with the application summing the five most recent buckets to calculate the total. This eliminates the need for a timer to expire transactions, though results would be accurate to the minute rather than the second. The application would still need to handle late or duplicate events.

Entry processors should remain lightweight, since long-running operations can block other work on the same partition. Network traffic still occurs between clients and the cluster, and Hazelcast maintains backup copies. Serialization costs also depend on the map's in-memory format: the default BINARY format stores serialized values, while OBJECT can reduce conversion work for entry processing. For workloads suited to this approach, the key difference is the absence of a separate processing tier that must continuously publish updates to the serving store.

When separate systems make sense

Keeping processing and storage apart offers one major advantage: each can scale independently. Consider an application running complex decision rules that produce little more than a yes-or-no answer. It might require substantial CPU capacity but minimal storage. A separate processing tier lets teams add compute resources without expanding serving infrastructure.

Other applications hold large amounts of state but perform relatively little processing. Placing both workloads on one cluster may yield limited savings, particularly if CPU-intensive tasks compete with latency-sensitive reads. Separate platforms also enable independent deployments, workload isolation, and access to specialized processing features. Hazelcast can offer some of that flexibility within a single cluster through lite members, which handle compute tasks without storing data, allowing teams to dedicate regular members to storage and add compute capacity separately.

For certain workloads, keeping processing and storage on entirely separate platforms will remain the right choice. However, when applications frequently read and update the same state, Hazelcast can reduce data movement between systems.

What to measure before making the switch

Start by profiling the existing deployment. How much CPU time goes into application logic versus serializing data or communicating across the network? How much state is actually duplicated between processing and serving?

Average response times alone won't reveal the full picture. A system might perform well most of the time but degrade considerably on certain requests. This is why examining p99 and p99.9 request latency matters, along with throughput and end-to-end latency—the time from event arrival to result readability, including any export lag.

Run the comparison using the same workload, the same end-to-end latency target, and the same durability guarantees. Failure testing is equally important: measure recovery time, replay behavior, duplicate handling, and correctness during node failures and network partitions. Backup copies and recovery mechanisms add to the infrastructure bill.

For some applications, independently scaling processing and storage will remain superior. Others may discover they're paying to move data between systems when they could perform the same work directly against application-accessible state. Not every copy is unnecessary—replicas protect against failures, checkpoints support recovery, and stream processors need intermediate state. The copies worth questioning are those maintained largely because processing and serving happen in different systems.