Hazelcast vs Infinispan: Key Differences, Licensing and How to Choose
Hazelcast and Infinispan are the two Java data grids most often compared with each other, because they are built the same way. Both spread data across a cluster of JVMs and keep backup copies on other members. Both run inside your application or as a separate server tier, put a ConcurrentMap API in front of the data, and plug into JCache, Spring Boot and Hibernate. Hazelcast is developed by Hazelcast, Inc. Infinispan is Red Hat's project: it is built into WildFly and Keycloak, Quarkus maintains extensions for it, and Red Hat sells it with support as Red Hat Data Grid.
What separates them in 2026 is what each one gives away and what each one builds on top of the grid. Infinispan has no paid feature tier. Cross-site replication, disk persistence, off-heap storage, TLS and role-based access control are all in the Apache-licensed project, and its server requires authentication out of the box. Hazelcast Community Edition leaves security, persistence and WAN replication to the commercial Enterprise Edition, lost the Raft-based CP Subsystem to Enterprise in version 5.5, and receives no patch releases between minor versions. On top of the grid, Hazelcast has SQL, a stream-processing engine and a wider set of data structures, including queues, topics and ring buffers. Infinispan has Ickle queries with full-text and vector search, fuller JTA transaction support, and an endpoint that speaks the Redis protocol.
As a rule of thumb, start with Infinispan if you run WildFly, Keycloak or Quarkus, or if you need security, persistence or cross-site replication without buying a license. Start with Hazelcast if you need stream processing, SQL over the grid or grid-native queues and topics, or if you already plan to buy Hazelcast Enterprise. If what you need is a distributed cache with locks and sessions for Java services, and Valkey or Redis already runs in your estate, you may not need either; that case has its own section.
Redisson is our product, and we sell neither Hazelcast nor Infinispan. We checked the facts on this page on November 20, 2026, against Hazelcast Platform 5.7.0, the current Community Edition release (May 2026), and Infinispan 16.3.2, released on November 18, 2026. The code samples compile against both, and against Redisson 4.8.0.
Hazelcast vs Infinispan at a Glance
| Hazelcast Platform | Infinispan | |
|---|---|---|
| What it is | In-memory data grid with SQL and a stream-processing engine (the former Hazelcast Jet) | In-memory data grid and key/value store with indexed queries |
| Backed by | Hazelcast, Inc. | Red Hat, which sells it with support as Red Hat Data Grid |
| License | Community Edition: Apache 2.0, plus the Hazelcast Community License for some modules. Enterprise Edition: commercial | Apache 2.0 for everything; no paid feature tier |
| Current release | 5.7.0 (May 2026) | 16.3.2 (November 2026); a minor release every four months |
| Patches for the free edition | None since 5.4; fixes arrive with the next minor version | Public patch releases, such as 16.3.1 and 16.3.2 |
| Java | The Java 17, 21 and 25 LTS releases | 17 for the embedded library and clients; 25 for the server since 16.1 |
| Topology | Embedded member or client/server | Embedded library or Infinispan Server |
| Distribution defaults | 271 partitions, one synchronous backup | 256 segments, two owners (primary and backup), synchronous |
| During a network split | Both sides keep serving unless split-brain protection sets a minimum cluster size; merge policies on heal | Both sides keep serving by default (ALLOW_READ_WRITES); can deny writes or all operations instead; merge policies on heal |
| Strongly consistent locks | CP Subsystem on Raft, with fencing tokens: Enterprise only since 5.5 | Clustered locks limited to the majority partition by default, and strong counters optionally; no Raft, no fencing tokens |
| Transactions | Transactional maps, queues, sets, lists and multimaps; READ_COMMITTED per partition; XA resource | JTA with optimistic or pessimistic locking, READ_COMMITTED or REPEATABLE_READ, full XA |
| Disk persistence | MapStore to your own database; native persistence is Enterprise | Cache stores (file, SQL, JDBC, RocksDB, remote), included |
| Off-heap storage | High-Density Memory Store: Enterprise | OFF_HEAP storage, included |
| Replication between clusters | WAN replication: Enterprise | Cross-site replication, synchronous or asynchronous, active-active: included |
| Security | TLS, authentication and authorization: Enterprise | TLS, authentication and role-based authorization, included; authentication on by default in the server |
| Query and compute | SQL, predicates and indexes, entry processors, executor services, Jet pipelines | Ickle with full-text and vector search, distributed streams, cluster executor |
| Messaging structures | IQueue, ITopic, ReliableTopic, Ringbuffer | None in the Java API; Redis lists and pub/sub through the RESP endpoint |
| Protocols and clients | Own binary protocol; clients for Java, .NET, C++, Python, Node.js and Go | Hot Rod (Java, Go and JavaScript on the current protocol), REST, RESP (Redis) and Memcached |
| Kubernetes and tooling | Operator: Enterprise since 5.5; community Helm charts; Management Center free up to three members | Operator, Helm chart, web console and CLI, included |
The Same Core Model
Both products are peer-to-peer clusters of JVMs that shard data and copy it. Hazelcast divides the data into 271 partitions by default and keeps one synchronous backup of each partition on another member. Infinispan divides a distributed cache into 256 segments and keeps two owners of each entry, written synchronously. The defaults match: Infinispan counts the primary copy in its number of owners, so two owners amount to Hazelcast's one backup. When a member joins or leaves, both move data to rebalance, and both let you keep more copies at the cost of memory and write latency.
Both also let you choose the topology. Embedded, your application instances are the cluster: each JVM holds part of the data in its own heap, and a read of a key it owns never touches the network. Client/server, the grid runs as its own tier and your applications connect to it. Hazelcast's client exposes the same IMap interface as an embedded member, so code moves between the two topologies largely unchanged; only member-side calls such as localKeySet() fail on a client. Infinispan's remote API is RemoteCache, reached over its Hot Rod protocol. It is also a ConcurrentMap, but it has its own configuration and marshalling rules and fewer features than an embedded cache. Hazelcast's own deployment guidance prefers client/server for production, as our Redis vs Hazelcast comparison explains.
For read-heavy data, both offer a near cache that keeps hot entries in the application process: Hazelcast on clients and members, Infinispan on Hot Rod clients. An embedded Infinispan distributed cache can also enable an L1 cache, which holds entries that a member reads but does not own.
Storing your own classes works differently. Hazelcast uses the serializers you register and, for a class it cannot otherwise handle, falls back to Compact serialization by reflection, with no configuration, in Java and .NET; it recommends explicit serializers where performance matters. Infinispan recommends ProtoStream, which is based on Protocol Buffers. Your classes carry @ProtoField annotations, a schema is generated from them, and for remote caches that schema must be registered with the server. Plain Java serialization works only for classes on a deserialization allow list. Expect more setup on the Infinispan side, in exchange for a declared schema that Infinispan's query engine and non-Java clients can also use.
What Each Gives You for Free
Most published comparisons of the two predate the changes below. For a team that will not buy a license, they matter more than any single feature.
Hazelcast: Community Edition and Enterprise Edition
Hazelcast ships two separate distributions, and a Community installation cannot be turned into Enterprise with a license key. Community Edition is free, under the Apache License 2.0 plus Hazelcast's own Community License for some components; the Hibernate plugin, for example, is published under the Community License alone. Enterprise Edition is commercial. Hazelcast's documentation for 5.7 marks these as Enterprise features:
- TLS encryption, member and client authentication, and role-based authorization, which is the whole security chapter
- Disk persistence, which lets a cluster restart from local storage
- WAN replication between clusters
- Rolling upgrades
- The High-Density Memory Store, which keeps data off the Java heap, and the thread-per-core engine
- The Kubernetes Operator, removed from Community Edition in 5.5
- The vector collection, still in beta
- The CP Subsystem, since 5.5
Management Center, Hazelcast's monitoring console, works with Community clusters of up to three members.
The CP Subsystem change catches teams who follow older advice. Hazelcast announced it in March 2024, and the 5.5.0 release notes list "CP Subsystem is now an Enterprise Edition only feature" among the breaking changes for Community users; a Community member now fails fast if CP is configured. The CP data structures, such as FencedLock, IAtomicLong and ISemaphore, are still in the Community API. Without CP members, though, they run in what Hazelcast calls unsafe mode, which "does not provide strong consistency guarantees" and is meant for development and testing.
The other change is patches. Since 5.4, Community Edition gets no patch releases; fixes, CVE fixes included, arrive with the next minor version. On Maven Central, the Community builds are 5.4.0 (April 2024), 5.5.0 (July 2024), 5.6.0 (October 2025) and 5.7.0 (May 2026), with nothing in between. A Community user on 5.5 waited almost fifteen months for the next build with fixes, while Enterprise customers received seven 5.5 patch releases in the same period.
Infinispan: One Edition, Sold With Support
Infinispan has no feature split. Cross-site replication, cache stores, off-heap storage, TLS, authentication and authorization, the web console, the CLI and the Kubernetes Operator are all part of the Apache-licensed project. The server is also secure by default: its default security realm requires users to authenticate, and authorization is switched on with five predefined roles, from admin to monitor. Patch releases are public: 16.3.0 shipped in early October 2026, 16.3.1 on October 20 and 16.3.2 on November 18. The project gives the 16.x line full support, with bug fixes and CVE patches, until six months after 17.0 ships.
Red Hat sells support for Infinispan as Red Hat Data Grid, formerly JBoss Data Grid, currently at version 8.6. Its Java support is wider than the community project's: Red Hat supports the Data Grid 8.6 server on Java 17, 21 and 25, while community Infinispan has required Java 25 for a bare-metal server since 16.1. The community project also moves fast, with a minor release every four months: 16.1 in February, 16.2 in June and 16.3 in October 2026, with 16.4 planned for February 2027.
For a team that will not buy a license, then, Infinispan's free edition is the more complete product. For a team that will, compare Hazelcast Enterprise with a Red Hat Data Grid subscription on the features you need.
Consistency, Split-Brain and Locks
For ordinary cached data, both products favor availability, in the sense of the CAP theorem. During a network partition, Hazelcast keeps serving on both sides unless you configure split-brain protection, which rejects operations while the cluster is smaller than a minimum size, and merge policies reconcile the two sides when the partition heals. Infinispan's default when-split setting is ALLOW_READ_WRITES, which keeps both sides readable and writable and resolves conflicts at merge time. DENY_READ_WRITES refuses operations on any entry whose replicas are not all in the local partition, and ALLOW_READS refuses only the writes. The default merge policy is NONE, with PREFERRED_ALWAYS, PREFERRED_NON_NULL and REMOVE_ALL as alternatives. Infinispan 16.3 also made merges cheaper by comparing a hash per segment, so segments that did not diverge transfer nothing. Our split-brain entry covers the general problem.
For distributed locks, the answer now depends on what you pay for. Hazelcast's FencedLock, IAtomicLong, ISemaphore and CPMap run on the CP Subsystem, which replicates each operation through Raft to a majority of CP members and stays linearizable during a partition. FencedLock implements java.util.concurrent.locks.Lock and returns a fencing token that a protected resource can use to reject a stale writer. It is the strongest lock either product offers, and from 5.5 on it needs Enterprise.
Infinispan's ClusteredLock is a different design. It is non-reentrant, owned by a node and kept in an internal replicated cache, and its methods return CompletableFutures instead of implementing Lock. With the default CONSISTENT reliability, only members in the majority partition can operate on it, and strong counters can be configured the same way. There is no consensus log and no fencing token, so the guarantee is weaker than Raft's, but it comes with the free edition. Our FencedLock entry explains what a fencing token adds, and our Infinispan migration guide shows the lock and counter APIs in code.
On transactions, Infinispan offers more. It supports JTA with optimistic locking by default or pessimistic locking, at READ_COMMITTED or REPEATABLE_READ isolation, with REPEATABLE_READ as the default, and its transaction modes go up to full XA. Hazelcast offers transactional maps, multimaps, queues, lists and sets through a TransactionContext, plus an XAResource for JTA transaction managers. Its isolation level is READ_COMMITTED within a single partition, getForUpdate() gives repeatable reads on a map, and Hazelcast warns that isolation "might be broken" when a transaction spans partitions. MapStore writes do not take part in the transaction.
Persistence, Off-Heap Memory and Cross-Site Replication
On Hazelcast Community Edition, data survives a full cluster restart only if you write it somewhere else. MapStore and MapLoader do that, writing through or behind to a database you run and loading entries on a miss. Native persistence, which restores map and JCache contents, Jet job snapshots and SQL metadata from local disk, is an Enterprise feature, as is the High-Density Memory Store.
Infinispan includes both. Its cache stores (the Soft-Index File Store, SQL, JDBC, RocksDB and remote stores) can persist every entry or take only the ones evicted from memory, and can write through or write behind. OFF_HEAP storage keeps entries as bytes in native memory, out of the garbage collector's way.
Hazelcast's WAN replication, which copies map and cache updates to other clusters in active-passive or active-active setups, is Enterprise only. Infinispan's cross-site replication backs caches up to other sites over the JGroups RELAY2 protocol, synchronously or asynchronously, and supports active-active, for which Infinispan recommends the asynchronous strategy. For a deployment across two regions on free software, that difference alone settles the choice.
Querying, Compute and Stream Processing
Hazelcast puts more processing next to the data. Community Edition includes SQL over maps, executed by the Jet engine; predicates and indexes over your own objects; entry processors that run on the member that owns a key; distributed executor services; and the Jet pipeline API for stream and batch processing. Of the query features, only the vector collection, still in beta, is Enterprise.
Infinispan is stronger at search. Ickle, its JPQL-like query language, runs over indexed or non-indexed caches. Indexes are built with Lucene through Hibernate Search, which gives you full-text queries, and indexed caches also support vector search over embeddings. Infinispan 16.0 added aggregations such as sum and average to indexed queries across the cluster, and 16.3 added an UPDATE statement. For compute, Infinispan offers distributed streams over cache entries, a cluster executor and a functional map API, but no stream-processing engine.
Data Structures and Messaging
Hazelcast's catalog is the wider one. Community Edition has IMap, MultiMap, ReplicatedMap, IList, ISet, IQueue, ITopic, ReliableTopic, Ringbuffer, a PN counter, a Flake ID generator and a cardinality estimator, and Enterprise adds the CP structures. One limit to know before you build messaging on it: a queue or ring buffer lives in a single partition, so one queue does not scale out with the cluster. Our Redis vs Hazelcast page covers Hazelcast's messaging in detail.
Infinispan's Java API is narrower: caches, multimap caches, clustered locks, and strong and weak counters. There is no distributed queue, topic or list. Its RESP endpoint lets any Redis client use lists, sets, sorted sets, hashes and pub/sub against an Infinispan server, with limits, such as RESP3 only and no Streams commands, that the Infinispan guide details. For a work queue or pub/sub between Java services, Hazelcast has the structures built in; on Infinispan you would use the RESP endpoint or a message broker.
Clients, Protocols and Framework Support
Hazelcast uses its own binary client protocol and lists client libraries for Java, .NET, C++, Python, Node.js and Go. Infinispan's native protocol is Hot Rod. Its Java, Go and JavaScript clients support the current protocol version, 4.1, while the C++, .NET and Python clients are on older versions, and Red Hat Data Grid has dropped its .NET client and deprecated the C++ and Node.js ones. Infinispan Server also speaks REST, RESP and the Memcached protocol, so any Redis or Memcached client can reach it.
| Framework | Hazelcast | Infinispan |
|---|---|---|
| Spring Boot caching | Auto-configured when hazelcast-spring is on the classpath; see our Hazelcast cache in Spring Boot guide | Auto-configured from spring.cache.infinispan.config; Infinispan also publishes Spring Boot 4 starters |
| Spring Session | hazelcast-spring-session 4.0.0 (February 2026), published by Hazelcast | Embedded and remote modules (@EnableInfinispanEmbeddedHttpSession, @EnableInfinispanRemoteHttpSession) |
| Hibernate second-level cache | hazelcast-hibernate 5.2.0 (July 2024), built against Hibernate 6.5, under the Hazelcast Community License | infinispan-hibernate-cache-v66 for Hibernate 6.6 and later, tested with Hibernate 7.1 |
| JCache (JSR-107) | Yes | Yes, embedded and remote |
| Quarkus | quarkus-hazelcast-client 4.1.0 (September 2025, built on Quarkus 3.26), published by Hazelcast | Client and cache extensions maintained in the Quarkus project |
| Micronaut cache | micronaut-cache-hazelcast | micronaut-cache-infinispan |
| Vert.x cluster manager | vertx-hazelcast | vertx-infinispan |
If you run WildFly or Keycloak, Infinispan is already in your stack. WildFly's clustering, which covers distributable web sessions, stateful session beans and the Hibernate second-level cache, is built on it, and so are Keycloak's caches. JBoss EAP, Red Hat's supported build of WildFly, uses the same Infinispan subsystem; EAP 8 lists org.infinispan and the Hot Rod client as public modules for applications, while org.infinispan.core and the JDBC and remote cache stores are for the server only. Adding Hazelcast to a WildFly or Keycloak estate means operating a second grid next to the one already there. That was the question in a 2021 thread on Hazelcast's own forum, "Why choose Hazelcast over Infinispan?". Hazelcast's answer cited more data structures, the CP Subsystem, performance, SQL and more client languages, and Community Edition no longer has the CP Subsystem. Keycloak has since added a preview stateless mode that keeps volatile session data in the database instead; the Infinispan guide covers it.
Operations, Upgrades and Java Versions
Hazelcast 5.7 supports the Java 17, 21 and 25 LTS releases. On Community Edition, the Kubernetes Operator is gone since 5.5, the Helm charts have been community-maintained since 5.4, and Management Center covers up to three members. Rolling upgrades are an Enterprise feature, so plan a Community upgrade as a full cluster restart or a move to a new cluster.
Infinispan's embedded library and Hot Rod clients need Java 17, and its server has needed Java 25 since 16.1. The official server container image already bundles Java 25, so the requirement bites only on bare-metal or VM installations that run an older JDK. The console, CLI, Operator and Helm chart come with the project. For upgrades, Infinispan 16.0 committed to upgrading live clusters without downtime across point releases, with minor releases as the stated next step. For larger jumps, a new cluster pulls the data from the old one through a remote cache store over Hot Rod, which works from 11.x onward. The four-month release train also means more upgrades to plan.
Which Is Faster?
We found no current, independent benchmark of the two, and the numbers that still circulate are old. In 2013 Infinispan's blog pointed to a test, run with default settings, that Infinispan won. Hazelcast published its own Infinispan benchmark years ago, and in 2021 a Hazelcast engineer called that report "pretty old". An independent study presented at the ICPE conference in 2017 tested Hazelcast 3.6.1 against Infinispan 8.1.2. It found Infinispan faster for simple retrieval and for most SQL-like queries, and Hazelcast faster for SQL-like queries on small data sets.
Both products have been reworked since. Hazelcast merged Jet into Platform 5 and added a thread-per-core engine for Enterprise. Infinispan 16 runs on virtual threads by default and rewrote its cluster messages in ProtoStream, and 16.3 reports gets 23 to 36 percent faster than before. None of these figures predicts your workload. Topology (embedded reads of locally owned keys skip the network), near caching, the serialization format, the number of synchronous copies and the transaction mode all change the result, so benchmark both with your own objects, access pattern and production topology.
The Same Cache in Code
Here is one member of a small cluster on each side, with a products map that has a ten-minute default TTL, one backup copy and a per-entry TTL on one write. First Hazelcast:
import com.hazelcast.config.Config;
import com.hazelcast.config.MapConfig;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.map.IMap;
import java.util.concurrent.TimeUnit;
public class HazelcastEmbedded {
public static void main(String[] args) {
Config config = new Config();
config.setClusterName("catalog");
config.addMapConfig(new MapConfig("products")
.setBackupCount(1) // the default: one sync backup
.setTimeToLiveSeconds(600)); // map-wide TTL, 10 minutes
// This JVM becomes a cluster member and owns part of the data
HazelcastInstance member = Hazelcast.newHazelcastInstance(config);
IMap<Long, String> products = member.getMap("products");
products.put(1L, "Widget");
products.put(2L, "Gadget", 30, TimeUnit.MINUTES); // per-entry TTL
System.out.println(products.get(1L));
member.shutdown();
}
}
Then Infinispan:
import java.util.concurrent.TimeUnit;
import org.infinispan.Cache;
import org.infinispan.configuration.cache.CacheMode;
import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.manager.DefaultCacheManager;
public class InfinispanEmbedded {
public static void main(String[] args) throws Exception {
GlobalConfigurationBuilder global =
GlobalConfigurationBuilder.defaultClusteredBuilder();
global.transport().clusterName("catalog");
ConfigurationBuilder products = new ConfigurationBuilder();
products.clustering().cacheMode(CacheMode.DIST_SYNC)
.hash().numOwners(2); // the default: primary plus one
products.expiration().lifespan(10, TimeUnit.MINUTES);
// This JVM joins the cluster over JGroups and owns part of the data
try (DefaultCacheManager cacheManager =
new DefaultCacheManager(global.build())) {
cacheManager.defineConfiguration("products", products.build());
Cache<Long, String> cache = cacheManager.getCache("products");
cache.put(1L, "Widget");
cache.put(2L, "Gadget", 30, TimeUnit.MINUTES); // per-entry
System.out.println(cache.get(1L));
}
}
}
The configuration differs more than the API. Hazelcast counts backups and Infinispan counts owners, which is why one backup becomes two owners; both values are the defaults and appear here only to make the copy count visible. Hazelcast sets the default TTL on the map in seconds, and Infinispan sets it as the cache's expiration lifespan. In production you would also configure discovery: Hazelcast's join settings or a discovery plugin, and a JGroups stack for Infinispan.
In client/server mode the two differ more:
import com.hazelcast.client.HazelcastClient;
import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.map.IMap;
import java.util.concurrent.TimeUnit;
import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
public class ClientServer {
static void hazelcastClient() {
ClientConfig config = new ClientConfig();
config.setClusterName("catalog");
config.getNetworkConfig().addAddress("hz-1:5701", "hz-2:5701");
HazelcastInstance client =
HazelcastClient.newHazelcastClient(config);
IMap<Long, String> products = client.getMap("products"); // same API
products.put(2L, "Gadget", 30, TimeUnit.MINUTES);
client.shutdown();
}
static void infinispanClient() {
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.addServers("ispn-1:11222;ispn-2:11222")
.security().authentication() // required by the default realm
.username("app").password("change-me");
try (RemoteCacheManager remote =
new RemoteCacheManager(builder.build())) {
RemoteCache<Long, String> cache = remote.getCache("products");
cache.put(2L, "Gadget", 30, TimeUnit.MINUTES);
}
}
}
The Hazelcast client returns the same IMap as an embedded member, and on Community Edition it needs only the cluster name, because Community Edition has no authentication. Infinispan Server rejects anonymous clients until you change its default security realm, and a remote cache that stores your own classes also needs their ProtoStream schema registered on the server.
A Third Option: Valkey or Redis With Redisson
Teams often reach this comparison while choosing a distributed cache, as in the 2021 forum thread above, and what they need is maps, locks, counters and HTTP sessions behind JCache, Spring and Hibernate, with no code running on the grid. If that describes your usage and Valkey or Redis already runs in your estate, or a managed service would do, Redisson gives Java services the same Java interfaces, from ConcurrentMap and Lock to JCache and the Spring and Hibernate caches, without a grid to operate:
| You use | Hazelcast | Infinispan | Redisson on Valkey or Redis |
|---|---|---|---|
| Map with TTL | IMap | Cache | RMapCache; RMap without TTL |
| Near cache | Near cache | Hot Rod near cache | RLocalCachedMap |
| Lock | FencedLock (CP, Enterprise) | ClusteredLock | RLock; RFencedLock with fencing tokens |
| Atomic counter | IAtomicLong (CP, Enterprise) | StrongCounter | RAtomicLong |
| Queue and topic | IQueue, ITopic | None in the Java API | RBlockingQueue, RTopic; Reliable Queue and Reliable PubSub with acknowledgements in PRO |
| Caching APIs | JCache, Spring Cache, Hibernate | JCache, Spring Cache, Hibernate | JCache, Spring Cache, Hibernate 4 to 7, and Quarkus, Micronaut and MyBatis caches |
| HTTP sessions | Spring Session | Spring Session | Spring Session, Tomcat session manager |
| Replication between clusters | WAN replication (Enterprise) | Cross-site replication | Multi Cluster mode (PRO, active-passive) |
| TLS and authentication | Enterprise | Included | Features of the Valkey or Redis server; no license needed on the client |
import java.util.concurrent.TimeUnit;
import org.redisson.Redisson;
import org.redisson.api.RLocalCachedMap;
import org.redisson.api.RLock;
import org.redisson.api.RMapCache;
import org.redisson.api.RedissonClient;
import org.redisson.api.options.LocalCachedMapOptions;
import org.redisson.api.options.LocalCachedMapOptions.SyncStrategy;
import org.redisson.config.Config;
public class RedissonCatalog {
public static void main(String[] args) throws InterruptedException {
Config config = new Config();
config.useClusterServers()
.addNodeAddress("redis://valkey-1:6379",
"redis://valkey-2:6379");
RedissonClient redisson = Redisson.create(config);
// In place of IMap or Cache: a map with per-entry TTL
RMapCache<Long, String> products = redisson.getMapCache("products");
products.put(2L, "Gadget", 30, TimeUnit.MINUTES);
// In place of a near cache: hot entries kept in this JVM and
// invalidated in every other client when one of them writes
RLocalCachedMap<Long, String> hot = redisson.getLocalCachedMap(
LocalCachedMapOptions.<Long, String>name("products-hot")
.cacheSize(10_000)
.syncStrategy(SyncStrategy.INVALIDATE));
hot.put(1L, "Widget");
// In place of FencedLock or ClusteredLock; the watchdog renews
// the lease while this JVM is alive
RLock lock = redisson.getLock("order:1234");
if (lock.tryLock(5, TimeUnit.SECONDS)) {
try {
// update the order
} finally {
lock.unlock();
}
}
redisson.shutdown();
}
}
Know the limits before you take this route:
- No embedded mode. Redisson is a client. The data lives on Valkey or Redis servers, and only the local cache sits in your JVM.
- No compute on the data.
RExecutorServiceruns tasks on worker JVMs, not on the server that owns a key, so entry processors and distributed streams have no direct equivalent.
If one of those is essential to you, keep a grid. If none is, our guides to moving off Hazelcast and moving off Infinispan map each API in detail, and the in-memory data grid comparison covers the rest of the category. Redisson PRO vs Community Edition lists what the commercial edition adds.
How to Choose
Start from the requirement you can least compromise on:
| If this is true | Look at |
|---|---|
| You need stream processing or SQL next to the data | Hazelcast |
| You need patch releases without a subscription | Infinispan |
| You run WildFly, JBoss EAP or Keycloak and want the grid that is already there | Infinispan |
| You mainly need a distributed cache, locks and sessions for Java services, and Valkey or Redis is already in place | Redisson on Valkey or Redis |
Hazelcast vs Infinispan: Frequently Asked Questions
Is Infinispan Faster Than Hazelcast?
There is no current answer. An independent study from 2017 tested Hazelcast 3.6.1 against Infinispan 8.1.2 and found Infinispan faster for simple retrieval and most SQL-like queries, and Hazelcast faster for SQL-like queries on small data sets. The vendors' own benchmarks are older still, and both products have been reworked since. Measure them with your own objects, access pattern and topology; serialization, near caching and the number of synchronous copies all change the result.
Is Hazelcast Free to Use in Production?
Hazelcast Community Edition is free, under the Apache License 2.0 plus the Hazelcast Community License for some modules. Several things production teams usually need are Enterprise features in version 5.7: TLS, authentication and authorization, disk persistence, WAN replication, rolling upgrades, the Kubernetes Operator and, since 5.5, the CP Subsystem. Community Edition also gets no patch releases. Security fixes arrive with the next minor version, and there was no Community build between July 2024 and October 2025.
Is Infinispan the Same as Red Hat Data Grid?
Red Hat Data Grid, formerly JBoss Data Grid, is Red Hat's supported distribution of Infinispan. The code and features come from the Apache-licensed Infinispan project, and the subscription adds support, long-term maintenance and certified configurations. The current version, Data Grid 8.6, supports its server on Java 17, 21 and 25, while community Infinispan has required Java 25 for a bare-metal server since 16.1.
Does Infinispan Offer Strong Consistency Like Hazelcast's CP Subsystem?
Not through consensus. Infinispan's clustered locks and strong counters can be limited to the majority partition, which is the default for locks, and caches can refuse operations on entries that lost replicas during a split. None of this runs a Raft log, and the locks issue no fencing tokens. Hazelcast's CP Subsystem does run Raft and gives linearizable locks, atomics and semaphores with fencing tokens, but since 5.5 it is an Enterprise feature. On Community Edition those structures run in an unsafe mode meant for development and testing.
Should I Use Infinispan or Hazelcast With Quarkus or Spring Boot?
For Quarkus, Infinispan's client and cache extensions are maintained in the Quarkus project, while Hazelcast publishes its own client extension, last released in September 2025 for Quarkus 3.26. For Spring Boot, both are auto-configured cache providers, both support Spring Session and both have Hibernate second-level cache modules. Infinispan publishes Spring Boot 4 starters, and Hazelcast's Hibernate module was last released in July 2024. Beyond that, decide on licensing, consistency and the data structures you need.
Can I Use Redis Instead of Hazelcast or Infinispan?
For distributed caching, locks, counters, sessions and framework caches, yes. Valkey or Redis with Redisson covers that ground with the same Java interfaces and no grid to operate. It is not a substitute when you need data inside the application JVM, code that runs on the node owning the data, a single structure larger than one node without the PRO edition, or synchronous acknowledgement of backups.
Similar articles
- In-Memory Data Grids Compared: Hazelcast, GemFire, Ignite, Coherence
- Redis vs Hazelcast: A Java Developer's Comparison
- Replacing Infinispan and Oracle Coherence with Valkey or Redis
- Hazelcast Cache in Spring Boot: A Practical Guide
- Migrating from Hazelcast to Valkey or Redis
- Redis vs Apache Ignite: A Java Developer's Comparison
- How to Use JCache (JSR-107) with Valkey or Redis
- Hibernate Second-Level Cache with Valkey or Redis
- Distributed Caching in Java with Valkey and Redis