<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>smartrics.it: Work</title>
    <link>https://www.smartrics.it/work/</link>
    <atom:link href="https://www.smartrics.it/work/feed.xml" rel="self" type="application/rss+xml"/>
    <description>Technology strategy, architecture and distributed systems. Decisions I&#39;d defend, until proven wrong.</description>
    <language>en-GB</language>
    <lastBuildDate>Mon, 23 Nov 2026 00:00:00 GMT</lastBuildDate>
    <item>
      <title>Where the parts meet: domains, events, the lake, and where an in-memory grid fits</title>
      <link>https://www.smartrics.it/work/where-the-parts-meet/</link>
      <guid isPermaLink="true">https://www.smartrics.it/work/where-the-parts-meet/</guid>
      <pubDate>Mon, 23 Nov 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<p>Most large enterprises already have the parts: operational systems that run the business, an integration layer, an event backbone, a data lake and warehouse, and an analytics team. What they rarely have is a clear rule for how those parts meet. This post describes one architecture that gives them those rules, and is honest about where an in-memory data grid earns its place in it and where it does not.</p>
<p>Where I say in-memory grid, my preferred option is <strong>Hazelcast</strong>. It works very well in this role, and it's flexible: one platform can hold a domain's hot state, process its events and serve analytical products. I work at Hazelcast, and I'd recommend it regardless.</p>
<p>The short version:</p>
<ul>
<li>Each operational domain owns its data: hot state in memory, durable state in its own system of record.</li>
<li>Domains talk through APIs, an ESB for legacy systems, and events. They never share a store.</li>
<li>Changes flow into the data platform through change capture, not dual writes.</li>
<li>Analytics flows back as versioned products that each domain chooses to load.</li>
<li>At the lake's outbound edge, an in-memory grid can be the layer that turns analytical output into millisecond decisions. That role is real, but it is a choice among several good options, not a necessity.</li>
</ul>
<h2>Each domain owns its hot state and its truth</h2>
<p>The unit of the architecture is the operational domain: orders, payments, customers, inventory, pricing, claims. Each is owned by a team, has its own system of record, and runs its own in-memory tier in front of it. Other domains never connect to that tier. Isolation can be per domain or per small group of domains with the same availability and security needs, but one grid shared by unrelated domains quietly rebuilds the coupling the design is meant to remove.</p>
<p>The most important decision inside a domain is which copy of each data set is authoritative. Write it down per data class:</p>
<table>
<thead>
<tr>
<th>Data class</th>
<th>Authoritative copy</th>
<th>How it is persisted</th>
<th>Use it for</th>
</tr>
</thead>
<tbody>
<tr>
<td>Store-authoritative (the default)</td>
<td>System of record</td>
<td>Write-through, or the in-memory copy is fed by change capture</td>
<td>Anything with legal, financial or audit weight</td>
</tr>
<tr>
<td>Memory-authoritative hot state</td>
<td>The in-memory tier</td>
<td>Write-behind, or not at all</td>
<td>Sessions, in-flight process state, live counters, reservations</td>
</tr>
</tbody>
</table>
<p>Memory-authoritative state is a deliberate trade of durability for latency. It is safe only with an explicit loss budget: how much unpersisted data you can lose, measured and alerted on, not assumed from a configured delay. And never let both copies be authoritative for the same field.</p>
<p>One more thing that is easy to forget: an in-memory grid's maps usually favour availability over consistency (AP). During a network split both sides keep accepting writes, and a merge policy keeps one side's value when they rejoin. Decisions that must be strongly consistent, such as a unique claim or a limit that must never be exceeded, belong in a strongly consistent (CP) structure, which grids offer with limits on size and throughput, or in the system of record.</p>
<h2>Domains meet through three edges, never through a shared store</h2>
<p>Once domains own their data, they need ways to cooperate that do not undo that ownership. There are three, and each has a job.</p>
<figure class="arch" id="architecture">
<div class="arch-scroll">
<svg class="ad" viewBox="0 0 960 616" role="img" aria-labelledby="ad-title ad-desc">
<title id="ad-title">Reference architecture: operational domains, three edges, and the data platform</title>
<desc id="ad-desc">Channels call an API gateway with a service registry, which routes to three operational domains (orders, payments, customers). Each domain has its own services, an in-memory hot tier and its own system of record. Legacy packages connect through ESB adapters. Each system of record feeds an event backbone through change data capture or an outbox; domains receive events and analytical products from the backbone. The backbone feeds a stream processor, which loads the lake and warehouse; analytics and ML publish versioned products back to the backbone. Optionally, an in-memory serving tier loads those products and answers read-only lookups from the domains in milliseconds.</desc>
<defs>
<marker id="ad-head" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ad-head" d="M0 0 L10 5 L0 10 z"/></marker>
</defs>
<!-- Channels -->
<rect class="ad-ext" x="210" y="14" width="320" height="40" rx="10"/>
<text class="t" x="370" y="39" text-anchor="middle">Channels and partner systems</text>
<line class="ad-arrow" x1="370" y1="54" x2="370" y2="90"/>
<!-- Synchronous edge -->
<rect class="ad-edge" x="40" y="90" width="640" height="50" rx="10"/>
<text class="t" x="360" y="112" text-anchor="middle">API gateway + service registry</text>
<text class="s" x="360" y="129" text-anchor="middle">synchronous edge · auth, rate limits, time-outs, versioning</text>
<!-- Domains -->
<g>
<rect class="ad-domain" x="40" y="172" width="200" height="208" rx="14"/>
<text class="t" x="140" y="194" text-anchor="middle">Orders domain</text>
<rect class="ad-inner" x="56" y="206" width="168" height="34" rx="8"/><text class="m" x="140" y="228" text-anchor="middle">Services</text>
<rect class="ad-hot" x="56" y="250" width="168" height="48" rx="8"/><text class="m hot" x="140" y="271" text-anchor="middle">Hot state</text><text class="s hot" x="140" y="287" text-anchor="middle">in-memory tier</text>
<rect class="ad-store" x="56" y="310" width="168" height="54" rx="8"/><text class="m" x="140" y="332" text-anchor="middle">System of record</text><text class="s" x="140" y="349" text-anchor="middle">authoritative</text>
</g>
<g>
<rect class="ad-domain" x="260" y="172" width="200" height="208" rx="14"/>
<text class="t" x="360" y="194" text-anchor="middle">Payments domain</text>
<rect class="ad-inner" x="276" y="206" width="168" height="34" rx="8"/><text class="m" x="360" y="228" text-anchor="middle">Services</text>
<rect class="ad-hot" x="276" y="250" width="168" height="48" rx="8"/><text class="m hot" x="360" y="271" text-anchor="middle">Hot state</text><text class="s hot" x="360" y="287" text-anchor="middle">in-memory tier</text>
<rect class="ad-store" x="276" y="310" width="168" height="54" rx="8"/><text class="m" x="360" y="332" text-anchor="middle">System of record</text><text class="s" x="360" y="349" text-anchor="middle">authoritative</text>
</g>
<g>
<rect class="ad-domain" x="480" y="172" width="200" height="208" rx="14"/>
<text class="t" x="580" y="194" text-anchor="middle">Customers domain</text>
<rect class="ad-inner" x="496" y="206" width="168" height="34" rx="8"/><text class="m" x="580" y="228" text-anchor="middle">Services</text>
<rect class="ad-hot" x="496" y="250" width="168" height="48" rx="8"/><text class="m hot" x="580" y="271" text-anchor="middle">Hot state</text><text class="s hot" x="580" y="287" text-anchor="middle">in-memory tier</text>
<rect class="ad-store" x="496" y="310" width="168" height="54" rx="8"/><text class="m" x="580" y="332" text-anchor="middle">System of record</text><text class="s" x="580" y="349" text-anchor="middle">authoritative</text>
</g>
<line class="ad-arrow" x1="206" y1="140" x2="206" y2="204"/>
<line class="ad-arrow" x1="426" y1="140" x2="426" y2="204"/>
<line class="ad-arrow" x1="646" y1="140" x2="646" y2="204"/>
<!-- Legacy edge -->
<rect class="ad-edge" x="704" y="172" width="70" height="208" rx="10"/>
<text class="t" transform="translate(744 276) rotate(-90)" text-anchor="middle">ESB adapters</text>
<text class="s" transform="translate(760 276) rotate(-90)" text-anchor="middle">legacy edge</text>
<rect class="ad-ext" x="796" y="172" width="124" height="208" rx="10"/>
<text class="t" x="858" y="262" text-anchor="middle">Legacy</text>
<text class="t" x="858" y="279" text-anchor="middle">packages</text>
<text class="s" x="858" y="300" text-anchor="middle">files · queues · SOAP</text>
<line class="ad-arrow ad-both" x1="664" y1="223" x2="704" y2="223"/>
<line class="ad-arrow ad-both" x1="774" y1="276" x2="796" y2="276"/>
<!-- Domains to backbone -->
<line class="ad-arrow" x1="100" y1="380" x2="100" y2="424"/>
<line class="ad-arrow" x1="320" y1="380" x2="320" y2="424"/>
<line class="ad-arrow" x1="540" y1="380" x2="540" y2="424"/>
<line class="ad-arrow" x1="190" y1="424" x2="190" y2="382"/>
<line class="ad-arrow" x1="410" y1="424" x2="410" y2="382"/>
<line class="ad-arrow" x1="630" y1="424" x2="630" y2="382"/>
<text class="l" x="94" y="406" text-anchor="end">CDC / outbox</text>
<text class="l" x="196" y="406">events, products</text>
<!-- Asynchronous edge -->
<rect class="ad-edge ad-strong" x="40" y="424" width="720" height="50" rx="10"/>
<text class="t" x="400" y="446" text-anchor="middle">Event backbone</text>
<text class="s" x="400" y="463" text-anchor="middle">asynchronous edge · domains never share a store</text>
<!-- Data platform -->
<line class="ad-arrow" x1="140" y1="474" x2="140" y2="518"/>
<rect class="ad-platform" x="40" y="518" width="200" height="78" rx="10"/>
<text class="t" x="140" y="548" text-anchor="middle">Stream processor</text>
<text class="s" x="140" y="566" text-anchor="middle">cleansing,</text>
<text class="s" x="140" y="581" text-anchor="middle">cross-domain joins, loading</text>
<line class="ad-arrow" x1="240" y1="557" x2="276" y2="557"/>
<rect class="ad-platform" x="276" y="518" width="220" height="78" rx="10"/>
<text class="t" x="386" y="548" text-anchor="middle">Lake and warehouse</text>
<text class="s" x="386" y="566" text-anchor="middle">history · scans · training</text>
<line class="ad-arrow" x1="496" y1="557" x2="532" y2="557"/>
<rect class="ad-platform" x="532" y="518" width="200" height="78" rx="10"/>
<text class="t" x="632" y="548" text-anchor="middle">Analytics and ML</text>
<text class="s" x="632" y="566" text-anchor="middle">scores, segments, limits</text>
<text class="s" x="632" y="581" text-anchor="middle">as versioned products</text>
<line class="ad-arrow" x1="660" y1="518" x2="660" y2="476"/>
<text class="l" x="666" y="502">products</text>
<!-- Optional serving tier at the lake's outbound edge -->
<line class="ad-arrow" x1="732" y1="557" x2="784" y2="557"/>
<rect class="ad-serving" x="784" y="508" width="136" height="98" rx="12"/>
<text class="t" x="852" y="536" text-anchor="middle">Serving tier</text>
<text class="s" x="852" y="554" text-anchor="middle">in-memory grid</text>
<text class="s" x="852" y="570" text-anchor="middle">decision layer</text>
<text class="s" x="852" y="590" text-anchor="middle">fresh + historical</text>
<path class="ad-arrow ad-dash" d="M852 508 V 398 H 664 V 382"/>
<text class="l" x="842" y="392" text-anchor="end">read-only ms lookups</text>
</svg>
</div>
<figcaption>Domains never share a store: calls go through the gateway or the ESB, changes go to the backbone, and analytics returns through the backbone as products each domain chooses to load.</figcaption>
</figure>
<p><strong>The synchronous edge is an API gateway with service discovery.</strong> Modern domains publish their APIs through a gateway that finds instances in a service registry and applies authentication, rate limits, time-outs and versioning. A call lands on the owning domain's service, which answers from its hot state. The gateway exposes APIs, never a domain's data tier.</p>
<p><strong>The legacy edge is an ESB, used as a set of adapters.</strong> Legacy packages that only speak files, queues or SOAP join through the bus, which translates protocols and formats into a canonical message. The rule that keeps this healthy is old advice: smart endpoints, dumb pipes. Business rules stay in the domains. A bus that collects logic becomes the hardest system in the estate to change, and the legacy system behind it becomes impossible to retire.</p>
<p><strong>The asynchronous edge is events.</strong> When one domain needs another's data often, it subscribes to the owner's events and keeps a read copy in its own hot tier, tagged with source and version. That copy is eventually consistent by design; anything that needs the owner's current state goes to the owner through the gateway.</p>
<p>There are no transactions across domains. A business process that spans them is a saga: a sequence of local steps with compensations, driven by a process manager, each step idempotent so a retry cannot charge a customer twice.</p>
<h2>Into the lake: capture changes where they become true</h2>
<p>The data platform (an event backbone, a stream processor, then the lake and warehouse) needs every change, in order per entity, with a known schema. The classic way to break that is the dual write: a service updates its database and then publishes an event as two separate steps. When one step fails, the lake either misses a change or receives one that never happened.</p>
<p>The fix is to capture changes where they become true. For store-authoritative data, read the system of record's change log (CDC), or write the event to an outbox table in the same transaction as the data. For memory-authoritative hot state, publish from the in-memory tier's own change stream, and know its limits.</p>
<p>Three traps are worth calling out because they are easy to miss in design reviews:</p>
<ul>
<li><strong>Write-behind hides history from CDC.</strong> With write coalescing on, which grids commonly use by default for write-behind, the store receives only the latest value per key. CDC on that store therefore delivers coalesced history to the lake, and intermediate states never exist there. If analytics needs every transition, publish from the in-memory change stream or turn coalescing off, and say which in the data contract.</li>
<li><strong>The in-memory change stream is fast, not durable.</strong> A grid's change journal is typically an in-memory ring of fixed capacity. Events overwritten before a job reads them, or lost with the cluster, are gone. Store-side CDC or an outbox is the durable path.</li>
<li><strong>CDC can echo.</strong> A domain that feeds its own map from CDC on a table it also writes to through the grid's write-through loader gets its own writes back, possibly after newer ones. Avoid the loop, or guard every apply with a version check.</li>
</ul>
<p>Finally, split stream processing by purpose. Enterprise-wide cleansing, cross-domain joins and loading into the lake belong in the central stream processor. Low-latency processing on one domain's hot state, such as enrichment, live views and local decisions, belongs inside the domain, next to its data. Implementing the same transformation in both places guarantees that one day they will disagree.</p>
<h2>Closing the loop: analytics as products the domains consume</h2>
<p>Analytics is only worth something once its results change what operations do: a fraud score blocks a payment, a credit limit is raised, a price moves, an offer is shown. The loop back is where many architectures get sloppy, usually by letting the analytics platform write straight into operational databases. Four rules keep it clean:</p>
<ul>
<li><strong>Publish products, not writes.</strong> Scores, segments, limits, forecasts and reference data are published as versioned data products: an event topic for incremental updates, a bulk interface for full refreshes. Every record carries the model or rule version and an as-of time.</li>
<li><strong>The owning domain loads them.</strong> A consumer owned by the receiving domain validates the feedback, loads it into its hot tier, and decides how to act on it. Analytics never writes into a domain's store or grid directly.</li>
<li><strong>Fail safe on stale feedback.</strong> Each product has a freshness limit. Past it, the domain falls back to a defined default (last known good, a rule, or a manual path) and raises an alert, rather than acting on old scores silently.</li>
<li><strong>Mark derived decisions.</strong> Operational records influenced by a feedback value keep its version. Otherwise the next model is trained on behaviour the previous model caused, and the loop learns from its own output.</li>
</ul>
<p>Feedback latency is the sum of everything in the loop: capture, central processing, lake and warehouse loads, model runs and publication. That is seconds for a streaming feature and hours or days for a batch model. Decide which one each product is, and set its freshness limit to match.</p>
<p>A practical detail for full refreshes: an in-memory map cannot swap thousands of keys atomically. Load the new version into a new map, validate it, then flip a small pointer that readers use to find the current map. Readers may briefly see either version, which is fine because each version is complete on its own.</p>
<h2>The lake boundary: where an in-memory grid earns a strategic role</h2>
<p>The most strategic place for an in-memory grid at the edge of the lake is on the way out, not the way in. Lakes and warehouses are built for scans. They are not built to answer thousands of single-key lookups per second within a few milliseconds, and that is exactly what operational decisions need.</p>
<p>Three roles hold up:</p>
<ul>
<li><strong>A serving tier for analytical products.</strong> Scores, features, segments, limits and customer-360 aggregates are built in the lake and loaded into the grid, where many domains read them at memory speed. The versioned-map-and-pointer refresh, near caches for read-heavy products and freshness limits all apply.</li>
<li><strong>Online features that mix fresh and historical data.</strong> Pipelines in the grid compute features from live events, such as counts and velocities over the last few minutes, and join them with historical features loaded from the lake, in one store.</li>
<li><strong>Scoring as events happen.</strong> Models trained on the lake run inside pipelines next to current operational state. The lake ships models and their versions; the grid applies them to data that is seconds old.</li>
</ul>
<p>Three roles do not hold up, and I would leave them out of any strategy:</p>
<ul>
<li><strong>Buffering on the way into the lake.</strong> The event backbone already does this durably; a grid adds a non-durable hop.</li>
<li><strong>Accelerating warehouse queries.</strong> A grid can cache hot query results, but warehouses have their own result caches, and the grid's SQL is not an analytical engine.</li>
<li><strong>Being part of the lakehouse.</strong> A grid is not built to store history or run large scans.</li>
</ul>
<p>A shared serving tier creates one tension with the rest of the design. Domain ownership says each domain loads its own copy. A shared tier says load once, serve everyone. The shared tier gives one copy and one model version across the enterprise, but it becomes a dependency every domain has, so it needs an owner (usually the data platform team) and domains only read from it. A reasonable split: a shared tier for products many domains use, per-domain loading for products only one domain uses.</p>
<h2>Honest check: is this a real need, and who else meets it?</h2>
<p>The problem is real. Serving analytical output to operational systems at low latency is an established category, sold as online feature stores, serving layers and reverse ETL. Large ML platforms built online stores precisely because lakes cannot serve decisions in milliseconds.</p>
<p>What an in-memory grid brings is that one system computes on fresh events, holds the state and serves the lookup. That removes moving parts, and the network hop between where a feature is computed and where it is read. It makes the biggest difference when three things are true at once:</p>
<ul>
<li>the decision needs both seconds-fresh streaming features and historical features from the lake;</li>
<li>the budget is a few milliseconds per decision, at high request rates;</li>
<li>logic has to run next to the data, for example checking and updating a limit atomically as each event arrives.</li>
</ul>
<p>That describes real-time fraud and AML scoring, credit and trading limit checks, next-best-offer at the moment of a transaction, dynamic pricing, and telco policy decisions. The latency argument follows from the architecture; a benchmark on your own workload is how to confirm it.</p>
<p>Other categories cover parts of the same job, and it helps to know when one of them fits better:</p>
<table>
<thead>
<tr>
<th>Category</th>
<th>When it fits better</th>
</tr>
</thead>
<tbody>
<tr>
<td>Online feature stores</td>
<td>Feature catalogue, lineage, and point-in-time-correct training data, which a grid does not provide</td>
</tr>
<tr>
<td>Key-value stores as the online layer</td>
<td>Simpler and cheaper when you only need fast key lookups</td>
</tr>
<tr>
<td>Stream processors</td>
<td>Larger ecosystems and better handling of very large state</td>
</tr>
<tr>
<td>Streaming databases</td>
<td>The closest match to compute-and-serve in one place, with SQL views kept up to date</td>
</tr>
<tr>
<td>Real-time OLAP engines</td>
<td>Aggregations over large, fresh data sets for user-facing analytics</td>
</tr>
<tr>
<td>Reverse ETL tools</td>
<td>Batch sync from the warehouse into SaaS and operational apps</td>
</tr>
</tbody>
</table>
<p>The position I would defend: an in-memory grid is the right boundary component when stream processing, state and serving need to live together and decisions need single-digit milliseconds, and for that role Hazelcast is my preferred choice. Where governance and lineage matter most, as in regulated ML, pair the grid with the catalogue the lake already has rather than replacing it.</p>
<h2>A concrete case: a grid next to a lakehouse</h2>
<p>Pairing a grid with a lakehouse platform pays off where decisions need state that is seconds old and an answer in a few milliseconds, at volume. For decisions that need neither, the lakehouse's own serving may be enough; decide that per use case, on measured numbers.</p>
<h3>How the two connect</h3>
<p>The integration is built from standard, well-understood parts:</p>
<ul>
<li><strong>Lakehouse to grid, incremental.</strong> The table format's change feed exposes row-level changes to a product table. A streaming job either writes them to the event backbone, where a grid pipeline loads them into maps, or writes straight to the grid through its client in each micro-batch. The backbone route is more decoupled and replayable; the direct route has fewer hops.</li>
<li><strong>Lakehouse to grid, full refresh.</strong> The product is written as columnar files to object storage, and a grid pipeline loads them into a new versioned map, then the pointer flips.</li>
<li><strong>Grid to lakehouse.</strong> Grid pipelines publish operational changes, and a log of the features actually served for each decision, to the event backbone. The lakehouse ingests them like any other stream.</li>
<li><strong>Models.</strong> A model trained and registered on the lakehouse is either exported and run inside a grid pipeline, or called as the lakehouse's model-serving endpoint from the pipeline. The first keeps the decision local and fast; the second keeps one serving runtime but adds a network call per decision.</li>
</ul>
<h3>What you gain, and what it takes</h3>
<p>The gains are concrete. Decisions can use operational state the lakehouse hasn't seen yet, joined with lake features in the same store that answers the lookup. Limits, counters and reservations are checked and updated next to the data, in one step rather than a round trip with retries. The decision path keeps working if the lake, or the network to it, is down. The grid runs wherever the operational systems run (on premises, in another cloud, at the edge), and because the contract is versioned products on the event backbone or in files, the lake stays swappable. What it takes is just as clear: governance has to reach the served copy, with access control and audit extended beyond the lake's catalogue; the integration jobs are simple to build but need operating discipline through refreshes, schema changes and replays; served features should be logged and used for training, so the two sides never drift; and the grid is a platform to size and run, which matters least where operational teams already run one. None of these is a reason to avoid the pairing. Each is a line on the cost side of the value case, to be measured like the gains.</p>
<p>The position I would take into that meeting: the lakehouse is the system for building analytical products; the grid is the decision layer for decisions that need fresh operational state and an answer in milliseconds, and that is where I'd put Hazelcast. Bring one use case and one benchmark, not a platform pitch.</p>
<h2>When not to do this</h2>
<p>This architecture has many moving parts: per-domain grids, a gateway and registry, a bus, a backbone, a stream processor, a lake, a warehouse and an analytics platform. Each needs an owner, capacity and on-call. Skip it, or most of it, when:</p>
<ul>
<li>a few systems owned by one team can share a database and a nightly export;</li>
<li>a domain's system of record already handles its load, so an in-memory tier adds cost and a copy without benefit;</li>
<li>analytics is reporting only, with no operational consumer;</li>
<li>there are no platform teams to run the backbone, the lake and the grids.</li>
</ul>
<p>Start with one domain's hot tier and one feedback product, measure the gain, and grow the mesh only where another domain needs it.</p>
<h2>Measuring whether it's worth it</h2>
<p>Each step in this architecture should earn its place with numbers, not with a diagram. I use the same total economic value (TEV) model described in <a href="/work/two-journeys-a-value-case/">Two journeys, a value case</a>. For each piece you add (a domain's hot tier, a feedback product, a serving tier), name the problem it removes and the person who owns that outcome. Measure today's technical KPI first: response time of the slowest requests, load taken off the system of record, data age at the moment of decision, recovery time. Tie it to the business KPI it moves, such as service-level misses, cost per transaction or losses from late detection, and turn that into money with a formula the owner agrees with. Then price every option over the same three years against &quot;change nothing&quot; (scaling the system of record, a key-value store or feature store, a grid) as value minus setup, running cost and risk. Score technical and business confidence separately and let the weaker one decide. If the measured gain on the first domain doesn't hold up, stop there: that is the model working, not failing.</p>
<hr>
<p><em>Views are my own, not my employer's.</em></p>
]]></description>
    </item>
    <item>
      <title>Hazelcast patterns: a catalogue from the cache up</title>
      <link>https://www.smartrics.it/work/hazelcast-patterns/</link>
      <guid isPermaLink="true">https://www.smartrics.it/work/hazelcast-patterns/</guid>
      <pubDate>Sun, 15 Nov 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<p>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: <strong><a href="https://github.com/fcannizzohz/hazelcast-patterns">hazelcast-patterns</a></strong>, an open catalogue on GitHub.</p>
<h2>What's in it</h2>
<p>Nearly fifty patterns, in four categories, from a single design decision up to a complete solution:</p>
<table>
<thead>
<tr>
<th>Category</th>
<th>What it answers</th>
<th>Examples</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Caching</strong> (IP)</td>
<td>How reads and writes flow between application, cache and system of record, and what goes wrong</td>
<td>Cache-Aside, Write-Behind, Negative Caching, Miss Coalescing</td>
</tr>
<tr>
<td><strong>Streaming</strong> (STR)</td>
<td>How pipelines connect, and how they cope with overload, duplicates and failure</td>
<td>Enrichment Pipeline, Backpressure, Claim Check, Resequencer</td>
</tr>
<tr>
<td><strong>Architecture</strong> (ARCH)</td>
<td>System and capability shapes built from the patterns above</td>
<td>Operational Data Fabric, Burst Absorption, Platform-Level Idempotency</td>
</tr>
<tr>
<td><strong>Solution</strong> (SOL)</td>
<td>End-to-end answers to a recognisable business problem</td>
<td>Semantic Relational Cache, Tiered Idempotency</td>
</tr>
</tbody>
</table>
<p>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.</p>
<h2>Standing on shoulders</h2>
<p>None of this invents a format. Every pattern follows the classic shape: <strong>intent, context, problem, forces, solution, structure, consequences, related patterns</strong>, 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 <em>forces</em> and the <em>consequences</em>, the parts that are usually missing.</p>
<p>Two of those books are close relatives:</p>
<ul>
<li><strong><a href="https://www.enterpriseintegrationpatterns.com/">Enterprise Integration Patterns</a></strong> (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.</li>
<li><strong><a href="https://martinfowler.com/eaaCatalog/">Patterns of Enterprise Application Architecture</a></strong> (Fowler), for the idea that a catalogue is a shared vocabulary first and a set of recipes second.</li>
</ul>
<p>On caching specifically, Hazelcast's own <strong><a href="https://hazelcast.com/blog/a-hitchhikers-guide-to-caching-patterns/">A Hitchhiker's Guide to Caching Patterns</a></strong> 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.</p>
<h2>Honest about the edges</h2>
<p>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 <em>not</em> 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.</p>
<h2>Where it meets the value case</h2>
<p>If you've read <a href="/work/two-journeys-a-value-case/">Two journeys, a value case</a>, this will look familiar. There I reduce a solution architecture to a handful of product-neutral <strong>blueprints</strong>, so the business conversation stays about mechanism, not features. The architecture patterns are where those blueprints get their engineering:</p>
<table>
<thead>
<tr>
<th>Blueprint (value case)</th>
<th>Architecture pattern (catalogue)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Operational data fabric</td>
<td>ARCH-1 Operational Data Fabric</td>
</tr>
<tr>
<td>Degraded mode</td>
<td>ARCH-2 Brownout and Degraded Mode</td>
</tr>
<tr>
<td>Burst absorption</td>
<td>ARCH-3 Burst Absorption</td>
</tr>
<tr>
<td>Compute near data</td>
<td>ARCH-4 Compute Near Data</td>
</tr>
<tr>
<td>Read acceleration</td>
<td>ARCH-7 Shared Reference Map with Near Cache, ARCH-8 Change-Fed Read Model</td>
</tr>
<tr>
<td>Coordination and correctness</td>
<td>ARCH-5 Platform-Level Idempotency, ARCH-6 Site Strategy per Data Class</td>
</tr>
<tr>
<td>Streaming materialised view</td>
<td>ARCH-10 Live Operational View</td>
</tr>
</tbody>
</table>
<p>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.</p>
<h2>Use it, and argue with it</h2>
<p>Start at <a href="https://github.com/fcannizzohz/hazelcast-patterns/blob/main/patterns.md">patterns.md</a>, which lists everything by category, or the <a href="https://github.com/fcannizzohz/hazelcast-patterns/blob/main/glossary.md">glossary</a> if a term is unfamiliar. Pattern IDs are stable, so they work as references in designs and reviews.</p>
<p>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.</p>
]]></description>
    </item>
    <item>
      <title>Two journeys, a value case</title>
      <link>https://www.smartrics.it/work/two-journeys-a-value-case/</link>
      <guid isPermaLink="true">https://www.smartrics.it/work/two-journeys-a-value-case/</guid>
      <pubDate>Wed, 23 Sep 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<p>I work in sales at Hazelcast, a middleware company. What we sell is a serious piece of engineering: an in-memory platform for caching and real-time data processing. Good engineering, it turns out, doesn't sell itself, most of the time. Somebody still has to explain what it's worth, to people who will never read a latency chart.</p>
<p>Coarsely, there are two ways a deal moves.</p>
<p><strong>Top-down</strong> starts with a business problem, stated as a pain point or as a KPI someone isn't happy with: cost to serve too high, checkout falling over at peak, an outage that made the news. The business rarely fixes these itself. It hands them to IT, and IT answers in one of two sizes. In the small, a project to rebuild or optimise one or a few applications. In the large, a modernisation programme: legacy offload, cloud migration, a new data platform. Selling top-down means arriving while that answer is still being shaped, with the business owner and the architects who'll define it.</p>
<p><strong>Bottom-up</strong> starts later, inside one of those projects. The gap between the business problem and IT has already been closed: there's a funded project, a team and a deadline. Somewhere in the execution, an engineer hits a wall (a backend that can't take the load, a pipeline that can't keep up) and finds a component that gets them past it. That's how technology like Hazelcast is usually discovered and embedded: chosen on technical merit, by the people building, often before anyone in procurement has heard the name. The business case that justified the project never mentioned it.</p>
<p>Each journey has its own weak spot. Top-down may arrive before anything has been measured, so its value case leans on someone else's numbers, and those don't survive the first person who checks them. Bottom-up has real technical proof but often lacks the line to money, so it struggles the moment the spend needs justifying.</p>
<p>In practice the two run <strong>in parallel</strong>, often in the same account: a modernisation programme being shaped at the top while a project team already depends on the component it should be standardising on.</p>
<h2>Where they meet: the blueprint</h2>
<p>Top-down comes <strong>down</strong> from a problem the business can name. Bottom-up comes <strong>up</strong> from a component that already works. They meet at the <strong>blueprint</strong>: a recognisable way of solving a class of problem, described without naming a product.</p>
<figure class="jd" role="img" aria-label="Top-down starts from a business problem and bottom-up from a working component. Both meet at the blueprint. From there the path continues: what we measure, what it's worth, and a first step.">
  <div class="jd-in" aria-hidden="true">
    <div class="jd-node"><span class="jd-tag">Top-down</span>Business problem</div>
    <div class="jd-node"><span class="jd-tag">Bottom-up</span>Working component</div>
  </div>
  <svg class="jd-join" viewBox="0 0 60 100" preserveAspectRatio="none" aria-hidden="true"><path d="M0 25 C 35 25, 30 50, 60 50 M0 75 C 35 75, 30 50, 60 50"/></svg>
  <div class="jd-blueprint" aria-hidden="true">Blueprint<small>where they meet</small></div>
  <ol class="jd-chain" aria-hidden="true">
    <li><span>1</span>What we measure</li>
    <li><span>2</span>What it's worth</li>
    <li><span>3</span>A first step</li>
  </ol>
</figure>
<p>The blueprint is the one thing both sides can point at. The business sees the problem it removes; the engineers see what is actually built. From there, both walk the same path to the money. Nothing in it depends on a particular product, and little of it is new on its own (benefits realisation and value engineering are long established). What helps is having one path that both conversations follow.</p>
<h2>From problem to money, one line each</h2>
<p>Most of what I see falls into six problems. Each has a blueprint, a measure, and a way to turn the measure into money with someone who owns the outcome.</p>
<table>
<thead>
<tr>
<th>The problem the business feels</th>
<th>Blueprint</th>
<th>What we measure</th>
<th>What it's worth (owner)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Work done twice, or not at all: double charges, stuck orders</td>
<td><strong>Reliable coordination</strong></td>
<td>Duplicates and stuck processes per million</td>
<td>Cost per duplicate × duplicates avoided (Head of Operations)</td>
</tr>
<tr>
<td>Failures that need people to recover</td>
<td><strong>Graceful failure</strong></td>
<td>Recovery time, data lost</td>
<td>Cost per outage minute × minutes avoided (Head of Platform)</td>
</tr>
<tr>
<td>The core system slowed and overloaded by repeat lookups</td>
<td><strong>Read offload</strong></td>
<td>Response time of the slowest requests; load on the core system</td>
<td>Cost per missed service level × misses avoided, plus upgrades deferred (Service owner, Head of Infrastructure)</td>
</tr>
<tr>
<td>Can't take on new volume without rebuilding</td>
<td><strong>State externalisation</strong></td>
<td>Throughput gained per server added</td>
<td>Cost and time to onboard new volume (Product owner)</td>
</tr>
<tr>
<td>Decisions made on yesterday's data</td>
<td><strong>Real-time view</strong></td>
<td>How old the data is when a decision is made</td>
<td>Loss per late detection × late detections avoided (Risk or Operations owner)</td>
</tr>
<tr>
<td>Every change needs a downtime window</td>
<td><strong>Modernisation coexistence</strong></td>
<td>Downtime and rollbacks per change</td>
<td>Cost per change window × windows avoided (Head of Change)</td>
</tr>
</tbody>
</table>
<p>Three rules keep this honest:</p>
<ul>
<li><strong>The blueprint sits in front of the core systems, not in place of them.</strong> They stay the source of truth.</li>
<li><strong>Any technology can build a blueprint; the measure decides.</strong> A bigger database, another product or our own are all judged on the same numbers.</li>
<li><strong>The formulas and owners are templates, confirmed with the customer.</strong> No figure is claimed until it is measured.</li>
</ul>
<h2>Pricing the options</h2>
<p>Every option, including <strong>&quot;change nothing&quot;</strong>, is priced over the same three years:</p>
<blockquote>
<p><strong>Total economic value = value created − setup cost − running cost − risk</strong></p>
</blockquote>
<p>Here is a worked example for read offload. <em>All figures are illustrative placeholders.</em></p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Value vs &quot;change nothing&quot;</th>
<th>Confidence</th>
</tr>
</thead>
<tbody>
<tr>
<td>Change nothing</td>
<td>$0 (baseline)</td>
<td>—</td>
</tr>
<tr>
<td>In-memory platform, preferred product</td>
<td>+$1,820k</td>
<td>Medium</td>
</tr>
<tr>
<td>Same design, another product</td>
<td>+$1,740k</td>
<td>Medium</td>
</tr>
<tr>
<td>A bigger database</td>
<td>+$300k</td>
<td>Low</td>
</tr>
</tbody>
</table>
<p>The decision rule: <strong>an option leads only if it is still ahead once you account for how confident you are in it.</strong> Here the first two are tied: an $80k gap at medium confidence is within the noise. I'd rather say that than pretend otherwise.</p>
<p>What would break the tie? If two or more blueprints shared one platform, shared setup and running costs might save another $900k or so. That is a <strong>hypothesis, not a result</strong>, and the next measurement exists to test it.</p>
<p>Confidence follows evidence: assumed, estimated from comparable cases, validated in a pilot, proven in production. Comparable cases count only if they report the same measures, which is why I'd rather show <em>measured, not promised.</em></p>
<h2>A first step that can fail</h2>
<p>The path to a decision is short:</p>
<ol>
<li><strong>Pick one problem</strong> with a business outcome and a named owner.</li>
<li><strong>Measure today</strong>, and estimate the value <strong>before</strong> anything is built.</li>
<li><strong>Prove it on one bounded scenario</strong>, recording each claim as validated, open or disproved.</li>
<li><strong>Rank the options</strong> with the decision rule, then take the next problem, or stop.</li>
</ol>
<p>The ask is always the same: <strong>one measurement, on your numbers.</strong> Your numbers validate it, or we stop.</p>
<p>This is also where the two journeys pay off together. The top-down conversation brings the problem, the owner and the portfolio view: which problems first, where the value stops. The bottom-up conversation brings the measurements. Because both talk about the same blueprints, the story the board hears and the evidence the project team holds are the same story.</p>
<h2>What I got wrong the first time</h2>
<ul>
<li><strong>Counting the same benefit twice,</strong> when two blueprints both claimed &quot;revenue protected&quot;.</li>
<li><strong>Letting future options into the headline number.</strong> They sit beside it, not inside it.</li>
<li><strong>Measuring against the wrong baseline.</strong> In a replacement project, compare with the new system <em>without</em> the extra component, not with the old one. When I corrected this once, a component that looked like a strong case alone took only a few percent of load off the backend. It had to be justified across the projects sharing it, or not at all.</li>
</ul>
<h2>What would change my mind</h2>
<p>If, over enough deals, figures built from the customer's own measurements proved no more accurate than industry benchmarks, the extra effort wouldn't be earning its keep. Where I've compared forecast with outcome, the misses have been smaller and easier to explain, but that's a handful of deals, not a study.</p>
<hr>
<h2>Appendix: for architects</h2>
<p>The detail behind the main text. The full pattern catalogue, with diagrams and trade-offs, is in <a href="https://github.com/fcannizzohz/hazelcast-patterns">hazelcast-patterns</a>; the blueprints below are product-neutral.</p>
<h3>A. Pain classes</h3>
<p>The six problems above come from seven technical pain classes, drawn on the customer's own architecture diagram:</p>
<table>
<thead>
<tr>
<th>#</th>
<th>Pain class</th>
<th>Typical example</th>
<th>Business KPI it hurts</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Exactly-once under failure</td>
<td>A retry charges a customer twice</td>
<td>Repair work, complaints</td>
</tr>
<tr>
<td>2</td>
<td>Manual recovery after failure</td>
<td>A site fails and state is rebuilt by hand</td>
<td>Outage impact</td>
</tr>
<tr>
<td>3</td>
<td>Coordination built on a database</td>
<td>Locks and status tables decide who does what</td>
<td>Stuck or duplicated work</td>
</tr>
<tr>
<td>4</td>
<td>Reference reads load the store</td>
<td>Every request re-reads the same tariff or product data</td>
<td>Service-level misses at peak, database cost per transaction</td>
</tr>
<tr>
<td>5</td>
<td>Stateful services don't scale out</td>
<td>Session or basket state pinned to one instance</td>
<td>Time and cost to take on new volume</td>
</tr>
<tr>
<td>6</td>
<td>Decisions on stale data</td>
<td>Fraud or risk checked against last night's data</td>
<td>Losses from late detection</td>
</tr>
<tr>
<td>7</td>
<td>Change while running</td>
<td>Every release or migration needs downtime</td>
<td>Cost of change</td>
</tr>
</tbody>
</table>
<p>Resilience cuts across all seven. Questions that fit no class (unit cost, chatty services, real-time AI, observability, no batch window) stay questions until measured.</p>
<h3>B. Blueprint catalogue</h3>
<p>The six consolidated blueprints expand into these:</p>
<table>
<thead>
<tr>
<th>Consolidated</th>
<th>Blueprint</th>
<th>Pain</th>
<th>Typical use case</th>
<th>Wrong when</th>
<th>Usual alternative</th>
</tr>
</thead>
<tbody>
<tr>
<td>Reliable coordination</td>
<td>Platform-level idempotency</td>
<td>solves 1*</td>
<td>Payments: no double charge on retry</td>
<td>Every downstream system already rejects duplicates</td>
<td>Database unique keys, custom dedup</td>
</tr>
<tr>
<td></td>
<td>Saga with a process manager</td>
<td>solves 3</td>
<td>Travel: flight, hotel and car as one trip</td>
<td>All steps live in one database with one transaction</td>
<td>Database locks and status tables</td>
</tr>
<tr>
<td>Graceful failure</td>
<td>Multi-site by data class</td>
<td>helps 2</td>
<td>Banking: different recovery rules for ledgers and sessions</td>
<td>One site, or all data equally critical</td>
<td>Database replication, manual failover</td>
</tr>
<tr>
<td></td>
<td>Brownout and degraded mode</td>
<td>helps 2</td>
<td>E-commerce peak: drop recommendations, keep checkout</td>
<td>Every function equally critical</td>
<td>Over-provisioning</td>
</tr>
<tr>
<td></td>
<td>Burst absorption</td>
<td>resilience</td>
<td>Ticketing: on-sale spikes before a fixed-capacity system</td>
<td>The spike is the new normal</td>
<td>Queue in front, over-provisioning</td>
</tr>
<tr>
<td>Read offload</td>
<td>Read acceleration</td>
<td>solves 4 (latency)</td>
<td>Telco: tariff tables read for every call record</td>
<td>Data changes constantly or is too large to hold close</td>
<td>Scale the database</td>
</tr>
<tr>
<td></td>
<td>System-of-record offload</td>
<td>helps 4 (volume)</td>
<td>Retail: product and stock lookups taken off the ERP</td>
<td>Readers must see the latest write</td>
<td>Database replicas</td>
</tr>
<tr>
<td>State externalisation</td>
<td>Hot-state domain tier</td>
<td>solves 5, helps 2</td>
<td>Banking: balances held in memory while authorised</td>
<td>Every write must be durable before it is acknowledged</td>
<td>Tune the existing cache tier</td>
</tr>
<tr>
<td>Real-time view</td>
<td>Operational data view</td>
<td>solves 6</td>
<td>Logistics: live parcel and fleet positions</td>
<td>A daily report is enough</td>
<td>CDC into a warehouse, a streaming stack</td>
</tr>
<tr>
<td></td>
<td>Operational data fabric</td>
<td>solves 6</td>
<td>Insurance: one claim view across policy, claims, payments</td>
<td>One system already holds everything</td>
<td>Point-to-point integration</td>
</tr>
<tr>
<td></td>
<td>Real-time features and scoring</td>
<td>solves 6</td>
<td>Card fraud: last minute's spend against a 12-month profile</td>
<td>Minutes of staleness are fine</td>
<td>Batch scoring, the lake's serving layer</td>
</tr>
<tr>
<td></td>
<td>Compute near data</td>
<td>cost</td>
<td>Capital markets: intraday risk over in-memory positions</td>
<td>Logic needs data from many systems</td>
<td>Ship data to a compute grid</td>
</tr>
<tr>
<td>Modernisation coexistence</td>
<td>Modernisation coexistence</td>
<td>solves 7</td>
<td>Moving off a mainframe while it keeps running</td>
<td>A big-bang cut-over is acceptable</td>
<td>Strangler with dual writes, blue/green</td>
</tr>
</tbody>
</table>
<p>* Exactly-once within the platform; end to end it also needs idempotent or transactional targets.</p>
<p><strong>Read acceleration and system-of-record offload stay separate in the model</strong> because they create value for different reasons (hot-path latency vs bulk read volume). Where both apply, avoided reads are counted once. <strong>Pain 2 is helped, not solved:</strong> manual recovery is partly process; runbooks and ownership stay with the platform team.</p>
<h3>C. Technical KPI classes</h3>
<p>Every blueprint is tagged with at least one:</p>
<ul>
<li><strong>Performance:</strong> p99 latency, throughput, data freshness.</li>
<li><strong>Cost:</strong> reads and CPU taken off the systems of record, infrastructure cost per transaction.</li>
<li><strong>Resilience:</strong> recovery time, data lost, manual interventions, downtime per change.</li>
</ul>
<h3>D. Screening and scope</h3>
<p>What stays as it is: API gateway, analytics, core systems, packaged products, archiving. An in-memory tier earns its place only if at least one of these holds:</p>
<ol>
<li>Hot data is read far more often than written, or must be computed on quickly.</li>
<li>The latency or volume target is beyond what the system of record can do economically.</li>
<li>State or coordination must survive failure without manual recovery.</li>
<li>Decisions need data that is seconds old, not hours.</li>
<li>The system of record must stay authoritative and largely unchanged.</li>
</ol>
<h3>E. One page per blueprint</h3>
<p>Each assessment writes a page with the same structure: <strong>scenario</strong>; <strong>today vs with the blueprint</strong>, side by side; <strong>why this design</strong> against the usual alternative; the <strong>technical KPIs</strong> to measure; the <strong>business KPI</strong> it moves; and a line tracing it back to its pain class.</p>
<h3>F. The loop</h3>
<ol>
<li><strong>Find the limit:</strong> start from the pain classes, screen with the conditions in D.</li>
<li><strong>Compare today's stack and the blueprint on the same KPIs,</strong> each claim recorded as validated, open or disproved.</li>
<li><strong>Rank by TEV</strong> with the decision rule.</li>
<li><strong>Fix one part and repeat,</strong> or stop, or rework if the case is disproved.</li>
</ol>
<p>Lower cost for each additional blueprint on a shared platform, and reuse elsewhere, are hypotheses each new assessment tests.</p>
]]></description>
    </item>
  </channel>
</rss>

