Hazelcast patterns: a catalogue from the cache up
Nearly fifty patterns for building with Hazelcast, from cache-aside to whole solutions, written down once so the same questions get the same honest answers.
In customer conversations at Hazelcast, the same questions come back every week. How do I stop a late load overwriting a delete? What happens to write-behind data if a member dies? Where does idempotency belong when the backend isn't idempotent? The answers existed, scattered across talks, docs, Slack threads and my own notes. So I wrote them down in one place: hazelcast-patterns, an open catalogue on GitHub.
What's in it
Nearly fifty patterns, in four categories, from a single design decision up to a complete solution:
| Category | What it answers | Examples |
|---|---|---|
| Caching (IP) | How reads and writes flow between application, cache and system of record, and what goes wrong | Cache-Aside, Write-Behind, Negative Caching, Miss Coalescing |
| Streaming (STR) | How pipelines connect, and how they cope with overload, duplicates and failure | Enrichment Pipeline, Backpressure, Claim Check, Resequencer |
| Architecture (ARCH) | System and capability shapes built from the patterns above | Operational Data Fabric, Burst Absorption, Platform-Level Idempotency |
| Solution (SOL) | End-to-end answers to a recognisable business problem | Semantic Relational Cache, Tiered Idempotency |
The patterns are domain-neutral. They apply to orders, sessions, devices, quotes or parcels, anything read, updated and processed at high rate, with the system of record staying authoritative and Hazelcast holding the hot copy. Features that need Hazelcast Enterprise are marked as such.
Standing on shoulders
None of this invents a format. Every pattern follows the classic shape: intent, context, problem, forces, solution, structure, consequences, related patterns, plus a section on the Hazelcast mechanics that implement it. It's the form that runs from Christopher Alexander through the Gang of Four to the enterprise pattern books, and it works because it makes you write down the forces and the consequences, the parts that are usually missing.
Two of those books are close relatives:
- Enterprise Integration Patterns (Hohpe and Woolf). Several streaming and architecture patterns borrow its names on purpose: Claim Check, Resequencer, Process Manager, Request-Reply, Publish-Subscribe, the dead-letter channel. The catalogue doesn't redefine them; it shows what they look like when the channel is an in-memory grid rather than a message broker.
- Patterns of Enterprise Application Architecture (Fowler), for the idea that a catalogue is a shared vocabulary first and a set of recipes second.
On caching specifically, Hazelcast's own A Hitchhiker's Guide to Caching Patterns already covers the classics well: cache-aside, read-through, write-through, write-behind and refresh-ahead. Read it first. The catalogue's caching section starts from the same patterns and then spends most of its time on what goes wrong in production: resurrected deletes (Tombstone with Version Guard), a late load undoing an invalidation (Stale-Fill Prevention), a stampede of misses on one key (Miss Coalescing), freshness confused with TTL, and how much write-behind data you can afford to lose.
Honest about the edges
A pattern that can't say when it's the wrong answer is a sales pitch with a diagram. So the catalogue says where Hazelcast is not the tool: guaranteed delivery across a full outage, or a general-purpose message broker, are better served by a durable log such as Kafka. Every pattern lists what you pay (−) next to what you gain (+). Where a solution page quotes measurements, they come from a proof of concept and hold only for its workload: evidence for the mechanism, not a production target.
Where it meets the value case
If you've read Two journeys, a value case, this will look familiar. There I reduce a solution architecture to a handful of product-neutral blueprints, so the business conversation stays about mechanism, not features. The architecture patterns are where those blueprints get their engineering:
| Blueprint (value case) | Architecture pattern (catalogue) |
|---|---|
| Operational data fabric | ARCH-1 Operational Data Fabric |
| Degraded mode | ARCH-2 Brownout and Degraded Mode |
| Burst absorption | ARCH-3 Burst Absorption |
| Compute near data | ARCH-4 Compute Near Data |
| Read acceleration | ARCH-7 Shared Reference Map with Near Cache, ARCH-8 Change-Fed Read Model |
| Coordination and correctness | ARCH-5 Platform-Level Idempotency, ARCH-6 Site Strategy per Data Class |
| Streaming materialised view | ARCH-10 Live Operational View |
The blueprint is what you discuss with the business owner and finance. The pattern is what you discuss with the architect, with its forces, its consequences and the caching and streaming patterns underneath. Same idea, two levels of detail, which is why it helps to keep them in step.
Use it, and argue with it
Start at patterns.md, which lists everything by category, or the glossary if a term is unfamiliar. Pattern IDs are stable, so they work as references in designs and reviews.
It's a living catalogue: new patterns and categories will arrive as the questions do, and there are templates for anyone who wants to add one. If a pattern is wrong, incomplete, or missing the case you hit last week, open an issue. A catalogue only earns trust by being corrected in public.