<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Wallace Espindola</title>
    <description>The latest articles on DEV Community by Wallace Espindola (@wallaceespindola).</description>
    <link>https://dev.to/wallaceespindola</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1257381%2Fb7a2e040-bb39-4215-a6ff-b54c5f1bdbf5.jpg</url>
      <title>DEV Community: Wallace Espindola</title>
      <link>https://dev.to/wallaceespindola</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wallaceespindola"/>
    <language>en</language>
    <item>
      <title>Java4Shell, hands-on: check your JVM in minutes, then patch it</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Mon, 30 Nov 2026 12:01:34 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/java4shell-hands-on-check-your-jvm-in-minutes-then-patch-it-33kp</link>
      <guid>https://dev.to/wallaceespindola/java4shell-hands-on-check-your-jvm-in-minutes-then-patch-it-33kp</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Java4Shell (CVE-2026-114938) only hits x86-64 CPUs with AVX-512 VBMI running an unpatched JDK 17.0.6 or later, 21, 25 or 27 (or the Oracle Java 8 Enterprise Performance Pack) with the default JIT flags. Check the CPU flag, the four-part version and two JIT flags, run the checker, then move to a fixed build such as 21.0.13.1, with &lt;code&gt;-XX:-UseBASE64Intrinsics&lt;/code&gt; as the stopgap.&lt;/p&gt;

&lt;p&gt;Java4Shell (CVE-2026-114938) went public on 17 November 2026, and the first question most teams ask is a plain one: is this JVM exposed or not? The answer depends on three things you can check in a few minutes per host. One is the CPU, one is the full Java version and one is a pair of JIT flags. If any of the three says no, that JVM is not exposed today, even if the patch still belongs on your list.&lt;/p&gt;

&lt;p&gt;This article covers the hands-on part. You check one box, then you fix it: the shell commands, the small checker in the companion repo (run it once, or run it as a service and read the JSON), the Docker images before and after, the Kubernetes mitigation patch and node affinity, and finally the patch itself. Everything quoted here lives in &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved" rel="noopener noreferrer"&gt;the examples repository&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you are looking for
&lt;/h2&gt;

&lt;p&gt;The flaw is heap memory corruption in HotSpot's AVX-512 Base64 decode intrinsic, the code behind &lt;code&gt;java.util.Base64.Decoder&lt;/code&gt;. It was disclosed by &lt;a href="https://calif.io/java4shell" rel="noopener noreferrer"&gt;Calif&lt;/a&gt; on the same day Oracle shipped its &lt;a href="https://www.oracle.com/security-alerts/cspunov2026.html" rel="noopener noreferrer"&gt;November 2026 Critical Security Patch Update&lt;/a&gt; and the &lt;a href="https://openjdk.org/groups/vulnerability/advisories/" rel="noopener noreferrer"&gt;OpenJDK Vulnerability Group&lt;/a&gt; published its advisory.&lt;/p&gt;

&lt;p&gt;On CPUs with AVX-512 VBMI, HotSpot swaps the pure-Java decode loop for a hand-written vectorized stub. For specially malformed input, that stub writes past the end of the output buffer before Java's normal validation rejects the string. Published analyses put the overrun at roughly 62 to 64 bytes. Java's memory safety applies to bytecode, not to JIT-generated native stubs, so the write corrupts adjacent heap memory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2osqy0uzr24aevzyzkur.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2osqy0uzr24aevzyzkur.png" alt="Attack flow: a malformed Base64 string reaches the AVX-512 VBMI decode stub, causing an out-of-bounds heap write that leads to a JVM crash or, with heap grooming, potential remote code execution" width="800" height="1033"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Two things make this different from Log4Shell for the person doing the checking. The bug is in the runtime, not a library, so a fully updated Maven or Gradle build can still be vulnerable and dependency-only (SCA) scanners won't see it. And it depends on hardware: the same container image can be exposed on one node pool and safe on another.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check one box: three questions per JVM
&lt;/h2&gt;

&lt;p&gt;The vulnerable stub is selected only when all of these hold, per the &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved/blob/main/docs/java4shell-context.md" rel="noopener noreferrer"&gt;context doc in the repo&lt;/a&gt; and the analyses it cites:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An x86-64 CPU with &lt;strong&gt;AVX-512 VBMI&lt;/strong&gt; (the &lt;code&gt;avx512vbmi&lt;/code&gt; CPU flag).&lt;/li&gt;
&lt;li&gt;An affected JDK build: OpenJDK 17.0.6 and later, 21, 25 and 27 before their fix releases, or the Oracle Java 8 Enterprise Performance Pack.&lt;/li&gt;
&lt;li&gt;HotSpot running with &lt;code&gt;UseAVX=3&lt;/code&gt; and &lt;code&gt;UseBASE64Intrinsics=true&lt;/code&gt;, which are the defaults on such CPUs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Standard Java 8 and 11 are not affected. Neither is ARM64 (Graviton, Apple Silicon, Ampere) or x86-64 without VBMI. On the Intel side, Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids have VBMI. Skylake-SP and Cascade Lake have AVX-512 without VBMI, so they are not exposed. On AMD, Zen 4 and newer are exposed, Zen 3 and older are not.&lt;/p&gt;

&lt;p&gt;Here is the triage flow I'd follow for each Java process:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5099d7wk053fh8bciizv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5099d7wk053fh8bciizv.png" alt="Triage flowchart: check for avx512vbmi on an x86-64 CPU, then an unpatched affected JDK, then UseAVX=3 and UseBASE64Intrinsics=true, then whether untrusted Base64 is reachable before authentication, ending in not exposed, mitigated, high or critical" width="800" height="1216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The last question in the flow is about your code, not the box. Base64 decoding sits on many pre-authentication paths (HTTP Basic &lt;code&gt;Authorization&lt;/code&gt; headers, JWT parsing, SAML and OIDC payloads, cookies, webhook signatures), so a login page in front of the app is no protection if the decode happens before the credential check.&lt;/p&gt;

&lt;h3&gt;
  
  
  The commands
&lt;/h3&gt;

&lt;p&gt;Run these against the production runtime on the production host, not on a laptop. These come straight from the repo's context doc:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. CPU: does the host expose AVX-512 VBMI? (Linux)&lt;/span&gt;
grep -o -m1 &lt;span class="s1"&gt;'avx512vbmi'&lt;/span&gt; /proc/cpuinfo &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"no avx512vbmi: not exposed"&lt;/span&gt;

&lt;span class="c"&gt;# 2. Runtime version (full four-part version matters)&lt;/span&gt;
java -version
docker run --rm --entrypoint java my-app:latest -version

&lt;span class="c"&gt;# 3. Effective JIT flags of the exact binary the app uses&lt;/span&gt;
java -XX:+PrintFlagsFinal -version &lt;span class="o"&gt;|&lt;/span&gt; grep -E &lt;span class="s1"&gt;'UseAVX|UseBASE64Intrinsics'&lt;/span&gt;

&lt;span class="c"&gt;# 4. Flags of an already running JVM&lt;/span&gt;
jcmd &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;pid&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; VM.flags -all &lt;span class="o"&gt;|&lt;/span&gt; grep -E &lt;span class="s1"&gt;'UseAVX|UseBASE64Intrinsics'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2 is where people slip. The fix lives in the fourth version number: &lt;code&gt;21.0.13&lt;/code&gt; is still vulnerable, &lt;code&gt;21.0.13.1&lt;/code&gt; is not. Dashboards, regexes and scanners that keep only three components will report both as the same build. The &lt;a href="https://dev.to/ianwieds/the-java4shell-fix-lives-in-the-fourth-version-number-3p26"&gt;DEV Community post on the fourth version number&lt;/a&gt; covers that trap in detail.&lt;/p&gt;

&lt;p&gt;If you'd rather not type all of that, the repo wraps the host part in &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved/blob/main/examples/detect/check-host.sh" rel="noopener noreferrer"&gt;&lt;code&gt;examples/detect/check-host.sh&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# Quick Java4Shell (CVE-2026-114938) triage for one Linux host and one java binary.&lt;/span&gt;
&lt;span class="c"&gt;# Usage: examples/detect/check-host.sh [/path/to/java]&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; -uo pipefail
&lt;span class="nv"&gt;JAVA&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"${1:-java}"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; grep -qw avx512vbmi /proc/cpuinfo 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"CPU: avx512vbmi present"&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"CPU: no avx512vbmi (or not Linux x86-64): not exposed on this host"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Runtime: $("&lt;/span&gt;&lt;span class="nv"&gt;$JAVA&lt;/span&gt;&lt;span class="s2"&gt;" -version 2&amp;gt;&amp;amp;1 | head -1)"&lt;/span&gt;
&lt;span class="s2"&gt;"$JAVA"&lt;/span&gt; -XX:+PrintFlagsFinal -version 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null &lt;span class="o"&gt;|&lt;/span&gt; grep -E &lt;span class="s1"&gt;'\b(UseAVX|UseBASE64Intrinsics)\b'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pass the path to the exact &lt;code&gt;java&lt;/code&gt; binary your application starts with. Servers often have more than one JDK installed, and the one on the &lt;code&gt;PATH&lt;/code&gt; is not always the one in the service unit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checker: one file, one verdict
&lt;/h2&gt;

&lt;p&gt;The shell script prints facts and leaves the conclusion to you. &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved/blob/main/examples/detect/Java4ShellCheck.java" rel="noopener noreferrer"&gt;&lt;code&gt;examples/detect/Java4ShellCheck.java&lt;/code&gt;&lt;/a&gt; goes one step further: it inspects the JVM it runs in and returns a verdict. It is a single file with no dependencies, so you can launch it with &lt;code&gt;java&lt;/code&gt; directly.&lt;/p&gt;

&lt;p&gt;The decision is a few lines, trimmed from the repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;    &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;Verdict&lt;/span&gt; &lt;span class="nf"&gt;verdict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;arch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Optional&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;Boolean&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;vbmi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;affected&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;useAvx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;b64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;x86&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"amd64"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;arch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"x86_64"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;x86&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;affected&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;useAvx&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;b64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Verdict&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;NOT_EXPOSED&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;vbmi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;has&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;has&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nc"&gt;Verdict&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;EXPOSED&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Verdict&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;NOT_EXPOSED&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;orElse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Verdict&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;UNKNOWN&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any single "no" ends the check. Only when the architecture, the build and both flags line up does the CPU flag decide, and if &lt;code&gt;/proc/cpuinfo&lt;/code&gt; can't be read the answer is &lt;code&gt;UNKNOWN&lt;/code&gt; instead of a guess. The flag values come from &lt;code&gt;HotSpotDiagnosticMXBean&lt;/code&gt;, so they reflect what the running JVM uses, including anything set through &lt;code&gt;JAVA_TOOL_OPTIONS&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The version check compares all four components against the first fixed release of each line (also trimmed from the repo):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;        &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;fixed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;feature&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;17&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;27&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;27&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those are the upstream and Oracle numbers. More on vendor numbering in the limits section below.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run it once
&lt;/h3&gt;

&lt;p&gt;From the repo root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make check-jvm   &lt;span class="c"&gt;# java examples/detect/Java4ShellCheck.java&lt;/span&gt;
make self-test   &lt;span class="c"&gt;# the built-in checks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exit code is the verdict: 0 not exposed, 1 exposed, 2 unknown. That makes it usable as a gate in a CI job or a startup script. Here is the real output on my Apple Silicon laptop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;javaVersion          25.0.5+9-LTS
javaVendor           Amazon.com Inc.
osArch               aarch64
avx512vbmi           unknown
useAvx               0
useBase64Intrinsics  true
affectedBuild        true
verdict              NOT_EXPOSED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a useful example because it looks scary at first glance. &lt;code&gt;affectedBuild&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt; (25.0.5 is below 25.0.5.1), and &lt;code&gt;useBase64Intrinsics&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt;. But the architecture is &lt;code&gt;aarch64&lt;/code&gt;, so the AVX-512 path doesn't exist here. &lt;code&gt;UseAVX&lt;/code&gt; isn't even a flag on ARM64, which is why it reads &lt;code&gt;0&lt;/code&gt;, and there is no &lt;code&gt;/proc/cpuinfo&lt;/code&gt; on macOS, hence &lt;code&gt;unknown&lt;/code&gt;. Not exposed on this box, and still due for the patch on the normal cadence.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run it as a service
&lt;/h3&gt;

&lt;p&gt;Sometimes you want to ask a host from the outside, or keep a check endpoint next to other health probes. The checker has a &lt;code&gt;--serve&lt;/code&gt; mode with &lt;code&gt;GET /health&lt;/code&gt; and &lt;code&gt;GET /check&lt;/code&gt;, and the repo wraps it in &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved/blob/main/scripts/run.sh" rel="noopener noreferrer"&gt;&lt;code&gt;scripts/run.sh&lt;/code&gt;&lt;/a&gt; and &lt;code&gt;scripts/kill.sh&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make run     &lt;span class="c"&gt;# scripts/run.sh 8080, starts service in background&lt;/span&gt;
make status  &lt;span class="c"&gt;# curl -s localhost:8080/check&lt;/span&gt;
make &lt;span class="nb"&gt;kill&lt;/span&gt;    &lt;span class="c"&gt;# scripts/kill.sh&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;run.sh&lt;/code&gt; writes a PID file and a log under &lt;code&gt;.run/&lt;/code&gt;, and refuses to start a second copy. The &lt;code&gt;/check&lt;/code&gt; response is the same report as JSON, plus a &lt;code&gt;timestamp&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"javaVersion"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"25.0.5+9-LTS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"javaVendor"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Amazon.com Inc."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"osArch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"aarch64"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"avx512vbmi"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"unknown"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"useAvx"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"useBase64Intrinsics"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"true"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"affectedBuild"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"true"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"verdict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"NOT_EXPOSED"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"2026-11-27T22:51:48.200959Z"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read it left to right, the way the triage diagram reads top to bottom. &lt;code&gt;osArch&lt;/code&gt; and &lt;code&gt;avx512vbmi&lt;/code&gt; answer the CPU question, &lt;code&gt;javaVersion&lt;/code&gt; and &lt;code&gt;affectedBuild&lt;/code&gt; the build question, &lt;code&gt;useAvx&lt;/code&gt; and &lt;code&gt;useBase64Intrinsics&lt;/code&gt; the flags question, and &lt;code&gt;verdict&lt;/code&gt; combines them. All values are strings, so compare &lt;code&gt;"EXPOSED"&lt;/code&gt;, not a boolean.&lt;/p&gt;

&lt;p&gt;There is also a &lt;code&gt;Dockerfile&lt;/code&gt; and &lt;code&gt;docker-compose.yml&lt;/code&gt; for the service (&lt;code&gt;make docker-build&lt;/code&gt;, &lt;code&gt;make docker-up&lt;/code&gt;). Keep in mind what that container measures: the Temurin 25 JRE inside the checker's image, on whatever CPU the container lands on. That is a good way to probe a node's CPU, but it says nothing about your application's JDK. For that, run the checker with the same &lt;code&gt;java&lt;/code&gt; binary and the same &lt;code&gt;JAVA_TOOL_OPTIONS&lt;/code&gt; as the application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F510la87z72kd8hqw5xvn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F510la87z72kd8hqw5xvn.jpg" alt="Server rack with rows of blinking green status lights in a data center" width="800" height="530"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@fslfsl" rel="noopener noreferrer"&gt;Domaintechnik&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/VHmBX7FnXw0" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Then fix it: Docker before and after
&lt;/h2&gt;

&lt;p&gt;Here is the vulnerable image from &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved/blob/main/examples/docker/Dockerfile.vulnerable" rel="noopener noreferrer"&gt;&lt;code&gt;examples/docker/Dockerfile.vulnerable&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="c"&gt;# Vulnerable: 21.0.13 predates the 21.0.13.1 fix for CVE-2026-114938.&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; eclipse-temurin:21.0.13-jre
&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app
&lt;span class="k"&gt;COPY&lt;/span&gt; target/application.jar app.jar
&lt;span class="k"&gt;ENTRYPOINT&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"java"&lt;/span&gt;, &lt;span class="s2"&gt;"-jar"&lt;/span&gt;, &lt;span class="s2"&gt;"app.jar"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing in it looks wrong. The tag is pinned and specific, and it is still one patch release short.&lt;/p&gt;

&lt;p&gt;If the patched base image isn't available yet, or your rollout takes longer than you'd like, the mitigation turns off the Base64 intrinsic. From &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved/blob/main/examples/docker/Dockerfile.mitigated" rel="noopener noreferrer"&gt;&lt;code&gt;examples/docker/Dockerfile.mitigated&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="c"&gt;# Temporary mitigation until the patched image ships. Merge with any JAVA_TOOL_OPTIONS you already set.&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; eclipse-temurin:21.0.13-jre
&lt;span class="k"&gt;ENV&lt;/span&gt; &lt;span class="nv"&gt;JAVA_TOOL_OPTIONS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"-XX:-UseBASE64Intrinsics"&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app
&lt;span class="k"&gt;COPY&lt;/span&gt; target/application.jar app.jar
&lt;span class="k"&gt;ENTRYPOINT&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"java"&lt;/span&gt;, &lt;span class="s2"&gt;"-jar"&lt;/span&gt;, &lt;span class="s2"&gt;"app.jar"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the comment on the first line. &lt;code&gt;JAVA_TOOL_OPTIONS&lt;/code&gt; overrides any existing value, so if your image already sets memory or GC options there, merge them instead of replacing them. &lt;code&gt;-XX:UseAVX=2&lt;/code&gt; also closes the hole, but it disables every AVX-512 code path, not just Base64, and costs more. And don't rely on &lt;code&gt;-XX:DisableIntrinsic=_base64_decodeBlock&lt;/code&gt; on its own, because analyses warned it does not reliably cover the vulnerable path.&lt;/p&gt;

&lt;p&gt;The fix is a new base image. From &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved/blob/main/examples/docker/Dockerfile.patched" rel="noopener noreferrer"&gt;&lt;code&gt;examples/docker/Dockerfile.patched&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="c"&gt;# Patched: pin the fixed release by digest once you have verified it reports 21.0.13.1 or the vendor equivalent.&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; eclipse-temurin:21-jre@sha256:&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;verified-digest-of-patched-image&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app
&lt;span class="k"&gt;COPY&lt;/span&gt; target/application.jar app.jar
&lt;span class="k"&gt;ENTRYPOINT&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"java"&lt;/span&gt;, &lt;span class="s2"&gt;"-jar"&lt;/span&gt;, &lt;span class="s2"&gt;"app.jar"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then rebuild without the cache and check what actually ended up inside:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build --pull --no-cache -t my-app:patched .
docker run --rm --entrypoint java my-app:patched -version   &lt;span class="c"&gt;# expect 21.0.13.1 or the vendor equivalent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A floating tag such as &lt;code&gt;21-jre&lt;/code&gt; only helps if it is re-pulled, and &lt;code&gt;--pull&lt;/code&gt; forces that. The digest makes the fix reproducible, and Renovate or Dependabot can propose digest bumps from there. This is a patch-level update, so no business logic changes and no Java major-version migration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Kubernetes: mitigate in place, or move off the exposed nodes
&lt;/h2&gt;

&lt;p&gt;In a cluster the CPU check has to run on the node, not inside a build container. With &lt;a href="https://kubernetes-sigs.github.io/node-feature-discovery/" rel="noopener noreferrer"&gt;Node Feature Discovery&lt;/a&gt; installed, nodes carry CPU feature labels, and &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved/blob/main/examples/kubernetes/inventory.sh" rel="noopener noreferrer"&gt;&lt;code&gt;examples/kubernetes/inventory.sh&lt;/code&gt;&lt;/a&gt; lists the VBMI nodes plus the Java version in each running pod (trimmed from the repo):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Nodes advertising AVX-512 VBMI:"&lt;/span&gt;
kubectl get nodes -l feature.node.kubernetes.io/cpu-cpuid.AVX512VBMI=true -o name

&lt;span class="nb"&gt;echo&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Java runtime per pod:"&lt;/span&gt;
kubectl get pods -A --field-selector=status.phase=Running \
  -o &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{range .items[*]}{.metadata.namespace}{" "}{.metadata.name}{" "}{.spec.nodeName}{"\n"}{end}'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; -r ns pod node&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="nv"&gt;version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$(kubectl exec -n "&lt;/span&gt;&lt;span class="nv"&gt;$ns&lt;/span&gt;&lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="nv"&gt;$pod&lt;/span&gt;&lt;span class="s2"&gt;" -- java -version 2&amp;gt;&amp;amp;1 | head -1)"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"$ns/$pod on $node: ${version:-no java}"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It assumes &lt;code&gt;java&lt;/code&gt; is on the &lt;code&gt;PATH&lt;/code&gt; and pods are single-container, so treat it as a quick look. For a whole fleet, an image scanner or runtime inventory does the job better.&lt;/p&gt;

&lt;p&gt;For the exposed workloads, you have two short-term options. The first is the same flag as in Docker, applied as a strategic-merge patch from &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved/blob/main/examples/kubernetes/mitigation.yaml" rel="noopener noreferrer"&gt;&lt;code&gt;examples/kubernetes/mitigation.yaml&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Strategic-merge patch: disable the Base64 intrinsic until the patched image is deployed.
# kubectl patch deployment my-app --patch-file examples/kubernetes/mitigation.yaml
&lt;/span&gt;&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-app&lt;/span&gt;
          &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;JAVA_TOOL_OPTIONS&lt;/span&gt;
              &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"-XX:-UseBASE64Intrinsics"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The container &lt;code&gt;name&lt;/code&gt; must match your deployment's container, because that is how the merge finds it. Patching the pod template triggers a rollout, so the pods restart with the flag. Confirm it took effect with &lt;code&gt;jcmd &amp;lt;pid&amp;gt; VM.flags&lt;/code&gt; inside a pod, or with the checker's &lt;code&gt;useBase64Intrinsics&lt;/code&gt; field. Some products (Jira, Keycloak, Jenkins) keep their own JVM options files, so follow their guidance: &lt;a href="https://github.com/keycloak/keycloak/issues/55293" rel="noopener noreferrer"&gt;Keycloak issue #55293&lt;/a&gt; and the &lt;a href="https://www.jenkins.io/blog/2026/11/18/mitigating-java4shell/" rel="noopener noreferrer"&gt;Jenkins blog post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The second option is to keep the workload off VBMI nodes altogether, from &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved/blob/main/examples/kubernetes/avoid-vbmi-nodes.yaml" rel="noopener noreferrer"&gt;&lt;code&gt;examples/kubernetes/avoid-vbmi-nodes.yaml&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Strategic-merge patch: keep a workload off nodes that advertise AVX-512 VBMI (needs Node Feature Discovery).
# kubectl patch deployment my-app --patch-file examples/kubernetes/avoid-vbmi-nodes.yaml
&lt;/span&gt;&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;affinity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;nodeAffinity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;requiredDuringSchedulingIgnoredDuringExecution&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;nodeSelectorTerms&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;matchExpressions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;feature.node.kubernetes.io/cpu-cpuid.AVX512VBMI&lt;/span&gt;
                    &lt;span class="na"&gt;operator&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DoesNotExist&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This uses the hardware condition as the control, since the vulnerable stub is never selected without VBMI. Scheduling exposed workloads onto ARM64 or non-VBMI node pools is a valid containment step. Watch the &lt;code&gt;DoesNotExist&lt;/code&gt; operator, though. If Node Feature Discovery isn't running, no node has the label, every node matches and the patch does nothing. And if all your nodes are VBMI nodes, the pods go &lt;code&gt;Pending&lt;/code&gt;. Check the label output from &lt;code&gt;inventory.sh&lt;/code&gt; before you rely on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then patch: the fixed versions
&lt;/h2&gt;

&lt;p&gt;Both mitigations only buy time, and the ticket closes when the patched build is running. Minimum fixed versions, in Oracle and OpenJDK numbering:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Java line&lt;/th&gt;
&lt;th&gt;Minimum fixed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;8 Performance Pack&lt;/td&gt;
&lt;td&gt;8u513-perf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;td&gt;17.0.21.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;21.0.13.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;td&gt;25.0.5.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;td&gt;27.0.1.1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Java 11 isn't affected, but 11.0.33.1 ships other fixes from the same patch update, so patch it anyway. Every HotSpot-based distribution inherits the bug (Eclipse Temurin, Amazon Corretto, Azul Zulu, Red Hat build of OpenJDK, Microsoft Build of OpenJDK, distro packages), and each one uses its own build numbers and timelines. In the first days after disclosure, several vendors had trackers open without fixed builds. Check your vendor's advisory for the exact package version.&lt;/p&gt;

&lt;p&gt;After the rollout:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Re-run the checker or &lt;code&gt;java -version&lt;/code&gt; against the running pods, not just the image tags.&lt;/li&gt;
&lt;li&gt;Remove the &lt;code&gt;JAVA_TOOL_OPTIONS&lt;/code&gt; mitigation and the node affinity patch, so you get the intrinsic's performance back.&lt;/li&gt;
&lt;li&gt;Look at the crash history from before the patch: &lt;code&gt;hs_err_pid*.log&lt;/code&gt;, &lt;code&gt;SIGSEGV&lt;/code&gt; and container restarts with exit code 134 or 139 on AVX-512 nodes. Repeated crashes there may indicate probing.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Trade-offs and limits
&lt;/h2&gt;

&lt;p&gt;A few things to keep in mind before you call it done:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The mitigation costs performance:&lt;/strong&gt; expect slower Base64 decoding, which matters for JWT-heavy gateways and upload services. Measure it. &lt;code&gt;-XX:UseAVX=2&lt;/code&gt; affects every vectorized intrinsic and costs more than the targeted flag.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RCE is contested, the crash isn't:&lt;/strong&gt; Calif demonstrated RCE in lab conditions. Independent reproductions confirmed the heap overflow but described reliable RCE as hard, since it depends on heap layout, GC, JIT state and the code path. &lt;a href="https://www.ox.security/blog/java4shell-cve-2026-114938-rce-risk/" rel="noopener noreferrer"&gt;OX Security&lt;/a&gt; estimated that fewer than 0.12% of JVMs are at realistic risk of RCE. A crash is easy, so treat every exposed instance as at least DoS-vulnerable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The severity score depends on who you ask:&lt;/strong&gt; Calif rates it 9.2 Critical (CVSS 4.0), while Oracle's November patch update lists a top Java SE score of 8.1 (CVSS 3.1). No in-the-wild exploitation had been reported as of 19 November 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vendor numbering differs:&lt;/strong&gt; the checker hard-codes the upstream fix versions. A vendor build that carries the fix under another number can show up as affected, or the other way around, so the vendor advisory wins over the checker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The checker has blind spots:&lt;/strong&gt; it reads &lt;code&gt;/proc/cpuinfo&lt;/code&gt;, so outside Linux it reports &lt;code&gt;UNKNOWN&lt;/code&gt; on x86-64. It uses &lt;code&gt;Runtime.version()&lt;/code&gt; and single-file launch, so it can't run on Java 8, which means the 8 Performance Pack needs a manual version check against 8u513-perf.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A WAF is not a fix:&lt;/strong&gt; gateway rules that reject malformed or oversized Base64 reduce noise but can be bypassed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the order of work stays the same: check, mitigate where the box says exposed, patch, then remove the mitigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;p&gt;You can answer "is this JVM exposed" with three checks: &lt;code&gt;avx512vbmi&lt;/code&gt; on an x86-64 CPU, a four-part version below the fix release, and &lt;code&gt;UseAVX=3&lt;/code&gt; with &lt;code&gt;UseBASE64Intrinsics=true&lt;/code&gt;. The repo's checker does the same in one command, with an exit code for scripts and a JSON endpoint for everything else. If the answer is yes, &lt;code&gt;-XX:-UseBASE64Intrinsics&lt;/code&gt; or a node affinity rule buys you time, and a rebuilt image on the fixed JDK closes it. For the wider picture, the &lt;a href="https://securitylabs.datadoghq.com/articles/java4shell-remote-code-execution-in-openjdk-cve-2026-114938/" rel="noopener noreferrer"&gt;Datadog Security Labs&lt;/a&gt; and &lt;a href="https://eclypsium.com/blog/java4shell-patch-java-check-the-processor/" rel="noopener noreferrer"&gt;Eclypsium&lt;/a&gt; write-ups are good next reads.&lt;/p&gt;

&lt;p&gt;How are you tracking the fourth version number across your fleet? I'd like to hear in the comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples repository:&lt;/strong&gt; every example in this article (the Java4Shell checker, the run scripts, the Docker and Kubernetes examples and the diagrams) is in &lt;a href="https://github.com/wallaceespindola/java4shell-explained-and-solved" rel="noopener noreferrer"&gt;https://github.com/wallaceespindola/java4shell-explained-and-solved&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Need more tech insights?&lt;br&gt;
Check out my GitHub, LinkedIn, and Speaker Deck.&lt;br&gt;
Happy coding!&lt;/p&gt;

&lt;p&gt;Wallace Espindola, Solution Architect&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/wallaceespindola/" rel="noopener noreferrer"&gt;https://github.com/wallaceespindola/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;LinkedIn: &lt;a href="https://www.linkedin.com/in/wallaceespindola/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/wallaceespindola/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Speaker Deck: &lt;a href="https://speakerdeck.com/wallacese" rel="noopener noreferrer"&gt;https://speakerdeck.com/wallacese&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>security</category>
      <category>docker</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Flyway vs Liquibase: one schema, two databases, one diff</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Sat, 21 Nov 2026 13:58:00 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/flyway-vs-liquibase-one-schema-two-databases-one-diff-1n0l</link>
      <guid>https://dev.to/wallaceespindola/flyway-vs-liquibase-one-schema-two-databases-one-diff-1n0l</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh9bacj2skpa7327mdg04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh9bacj2skpa7327mdg04.png" alt="Flyway and Liquibase building the same schema in two separate databases, six migrations against seven changesets, with a zero-difference result" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most Flyway vs Liquibase comparisons are feature tables written from memory. They tend to agree on the broad strokes (Flyway is simpler, Liquibase does rollback) and leave out the details you only find once both tools are wired into a real application: which one records how long a migration took, which one records who wrote it, and how you read the history back from inside the app.&lt;/p&gt;

&lt;p&gt;So I built the comparison as code. One Spring Boot application, two H2 databases, the same logical schema written once for each engine, and an endpoint that reads both schemas back from &lt;code&gt;INFORMATION_SCHEMA&lt;/code&gt; and reports whether they match. The full project is here: &lt;a href="https://github.com/wallaceespindola/flyway-vs-liquibase-db-migrations" rel="noopener noreferrer"&gt;flyway-vs-liquibase-db-migrations on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This article covers the hands-on part: the files you add for each engine, how they are wired without auto-configuration, and the commands to check the result yourself. Every snippet is copied from the repo, trimmed where noted.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you are building
&lt;/h2&gt;

&lt;p&gt;The stack is Java 25, Spring Boot 4.1.2, plain JDBC and Maven. The engine versions come from the Spring Boot BOM rather than from pinned properties, so both tools are on whatever Spring Boot itself tests: Flyway 12.4.0, Liquibase 5.0.4 and H2 2.4.240.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7p40b783mhxwvgt06db4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7p40b783mhxwvgt06db4.png" alt="Two H2 databases side by side: FlywayConfig migrates ./data/flywaydb from the six scripts in db/migration, LiquibaseConfig migrates ./data/liquibasedb from the master changelog, and ComparisonService reads both through INFORMATION_SCHEMA to answer GET /api/v1/comparison" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The rule the whole project rests on: &lt;code&gt;./data/flywaydb&lt;/code&gt; belongs to Flyway, &lt;code&gt;./data/liquibasedb&lt;/code&gt; belongs to Liquibase, and neither engine ever touches the other's database. Share a single database between them and whichever engine runs second sees a schema that already exists, which makes the diff worthless.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: turn off DataSource auto-configuration
&lt;/h2&gt;

&lt;p&gt;Spring Boot is happy to configure one &lt;code&gt;DataSource&lt;/code&gt; and one migration engine for you. Two of each is where that stops being helpful, and hiding the bootstrap would also hide half of what the comparison is about. So &lt;code&gt;application.yml&lt;/code&gt; excludes the auto-configuration and declares two datasource blocks under a custom &lt;code&gt;app&lt;/code&gt; prefix (trimmed):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;spring&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;autoconfigure&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;exclude&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration&lt;/span&gt;

&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;datasource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;flyway&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jdbc:h2:file:./data/flywaydb;DB_CLOSE_DELAY=-1;AUTO_SERVER=TRUE;NON_KEYWORDS=VALUE&lt;/span&gt;
      &lt;span class="na"&gt;driver-class-name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;org.h2.Driver&lt;/span&gt;
      &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sa&lt;/span&gt;
      &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
    &lt;span class="na"&gt;liquibase&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jdbc:h2:file:./data/liquibasedb;DB_CLOSE_DELAY=-1;AUTO_SERVER=TRUE;NON_KEYWORDS=VALUE&lt;/span&gt;
      &lt;span class="na"&gt;driver-class-name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;org.h2.Driver&lt;/span&gt;
      &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sa&lt;/span&gt;
      &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
  &lt;span class="na"&gt;migration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;flyway&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;locations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;classpath:db/migration&lt;/span&gt;
      &lt;span class="na"&gt;baseline-on-migrate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="na"&gt;liquibase&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;change-log&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;classpath:db/changelog/db.changelog-master.yaml&lt;/span&gt;
      &lt;span class="na"&gt;contexts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;demo&lt;/span&gt;
      &lt;span class="na"&gt;default-schema&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;PUBLIC&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are coming from Spring Boot 3, note the package in that exclude. Spring Boot 4 split auto-configuration into modules, so &lt;code&gt;DataSourceAutoConfiguration&lt;/code&gt; and &lt;code&gt;DataSourceProperties&lt;/code&gt; now live in &lt;code&gt;org.springframework.boot.jdbc.autoconfigure&lt;/code&gt;. The H2 console moved too: it needs the &lt;code&gt;spring-boot-h2console&lt;/code&gt; dependency on the classpath.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: wire each engine yourself
&lt;/h2&gt;

&lt;p&gt;Each engine gets its own &lt;code&gt;@Configuration&lt;/code&gt; class that builds a &lt;code&gt;DataSourceProperties&lt;/code&gt;, a &lt;code&gt;DataSource&lt;/code&gt;, the engine and a &lt;code&gt;JdbcTemplate&lt;/code&gt;. Here's the Flyway bean from &lt;code&gt;FlywayConfig&lt;/code&gt; (trimmed to the engine itself):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Bean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"flyway"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;initMethod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"migrate"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;Flyway&lt;/span&gt; &lt;span class="nf"&gt;flyway&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@Qualifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;DATA_SOURCE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nc"&gt;DataSource&lt;/span&gt; &lt;span class="n"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Configuring Flyway with locations={} baselineOnMigrate={}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;locations&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;baselineOnMigrate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Flyway&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;configure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;locations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;locations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;baselineOnMigrate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;baselineOnMigrate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;validateOnMigrate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cleanDisabled&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the Liquibase counterpart from &lt;code&gt;LiquibaseConfig&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Bean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"liquibase"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;SpringLiquibase&lt;/span&gt; &lt;span class="nf"&gt;liquibase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@Qualifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;DATA_SOURCE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nc"&gt;DataSource&lt;/span&gt; &lt;span class="n"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Configuring Liquibase with changeLog={} contexts={}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;changeLog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;contexts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nc"&gt;SpringLiquibase&lt;/span&gt; &lt;span class="n"&gt;liquibase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SpringLiquibase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;liquibase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setDataSource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;liquibase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setChangeLog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;changeLog&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;liquibase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setContexts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;contexts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;liquibase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setDefaultSchema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;defaultSchema&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;liquibase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setDropFirst&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;liquibase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setShouldRun&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;liquibase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Flyway needs a &lt;code&gt;DataSource&lt;/code&gt; and a location. Liquibase also wants a changelog entry point, contexts and a default schema. Those extra setters are what make contexts and per-environment filtering possible later on.&lt;/p&gt;

&lt;p&gt;Both engines migrate during bean initialization: Flyway through &lt;code&gt;initMethod = "migrate"&lt;/code&gt;, &lt;code&gt;SpringLiquibase&lt;/code&gt; in &lt;code&gt;afterPropertiesSet()&lt;/code&gt;. That creates a trap. A &lt;code&gt;JdbcTemplate&lt;/code&gt; built on the same &lt;code&gt;DataSource&lt;/code&gt; can be created before the migration has run, and the first query hits an empty database. The fix is one annotation per side:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Bean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;JDBC_TEMPLATE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@Primary&lt;/span&gt;
&lt;span class="nd"&gt;@DependsOn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"flyway"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;JdbcTemplate&lt;/span&gt; &lt;span class="nf"&gt;flywayJdbcTemplate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@Qualifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;DATA_SOURCE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nc"&gt;DataSource&lt;/span&gt; &lt;span class="n"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;JdbcTemplate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;liquibaseJdbcTemplate&lt;/code&gt; does the same with &lt;code&gt;@DependsOn("liquibase")&lt;/code&gt;. With two beans of every JDBC type in the context, &lt;code&gt;@Qualifier&lt;/code&gt; stops being optional. The repo keeps the bean names as constants (&lt;code&gt;FlywayConfig.JDBC_TEMPLATE&lt;/code&gt;, &lt;code&gt;LiquibaseConfig.JDBC_TEMPLATE&lt;/code&gt;) so the qualifier strings aren't copied around as literals, and the Flyway side is &lt;code&gt;@Primary&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: add the migration files, in pairs
&lt;/h2&gt;

&lt;p&gt;Every Flyway migration has a deliberate Liquibase counterpart. Each pair makes the same business change, written the way that tool expects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff2bm6o8y37jqjwccgcu6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff2bm6o8y37jqjwccgcu6.png" alt="Paired migrations: Flyway V1 to V5 plus the repeatable R__ catalog view on the left, Liquibase changesets 001 to 006 on the right, with V5 mapping to two changesets, 005 and 005b, which is why Flyway applies 6 and Liquibase applies 7" width="800" height="1133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the Flyway side you drop SQL files into &lt;code&gt;src/main/resources/db/migration&lt;/code&gt; and the filename does the rest. &lt;code&gt;V1__create_category_table.sql&lt;/code&gt; is plain H2 SQL (header comment trimmed):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt;          &lt;span class="kt"&gt;BIGINT&lt;/span&gt; &lt;span class="no"&gt;AUTO_INCREMENT&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;        &lt;span class="kt"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="kt"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt;  &lt;span class="kt"&gt;TIMESTAMP&lt;/span&gt;    &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="kc"&gt;CURRENT_TIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;CONSTRAINT&lt;/span&gt; &lt;span class="n"&gt;uk_category_name&lt;/span&gt; &lt;span class="k"&gt;UNIQUE&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_category_name&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Liquibase doesn't scan for files. You write a master changelog that includes each one, in order (header comment trimmed):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;databaseChangeLog&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db/changelog/changes/001-create-category-table.xml&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db/changelog/changes/002-create-product-table.yaml&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db/changelog/changes/003-seed-reference-data.sql&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db/changelog/changes/004-add-product-audit-table.xml&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db/changelog/changes/005-add-product-active-flag.xml&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db/changelog/changes/006-product-catalog-view.xml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The includes mix XML, YAML and Liquibase's formatted SQL on purpose, to show all three work in one changelog. The YAML changeset 002 also shows the escape hatch: check constraints have no portable Liquibase tag, so that changeset drops to a &lt;code&gt;sql&lt;/code&gt; change for them.&lt;/p&gt;

&lt;p&gt;Look closely at V4 and 004. &lt;code&gt;V4__add_product_audit_table.sql&lt;/code&gt; creates an audit table and has no way back. Its header comment says reverting means writing a new forward migration. The Liquibase changeset adds a precondition and a rollback (trimmed to the parts that matter):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;changeSet&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"004-add-product-audit-table"&lt;/span&gt; &lt;span class="na"&gt;author&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"wallaceespindola"&lt;/span&gt; &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"demo"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="c"&gt;&amp;lt;!-- Schema order matters: preConditions must precede comment and the change tags. --&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;preConditions&lt;/span&gt; &lt;span class="na"&gt;onFail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"MARK_RAN"&lt;/span&gt; &lt;span class="na"&gt;onFailMessage&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"product table missing, skipping audit table"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;tableExists&lt;/span&gt; &lt;span class="na"&gt;tableName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"product"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/preConditions&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;comment&amp;gt;&lt;/span&gt;Add the product audit trail, guarded by a precondition&lt;span class="nt"&gt;&amp;lt;/comment&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;createTable&lt;/span&gt; &lt;span class="na"&gt;tableName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"product_audit"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;column&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"id"&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"BIGINT"&lt;/span&gt; &lt;span class="na"&gt;autoIncrement&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;constraints&lt;/span&gt; &lt;span class="na"&gt;primaryKey&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="na"&gt;primaryKeyName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"pk_product_audit"&lt;/span&gt; &lt;span class="na"&gt;nullable&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"false"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;column&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"product_id"&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"BIGINT"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;constraints&lt;/span&gt; &lt;span class="na"&gt;nullable&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"false"&lt;/span&gt; &lt;span class="na"&gt;foreignKeyName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"fk_product_audit_product"&lt;/span&gt;
                         &lt;span class="na"&gt;references&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"product(id)"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/column&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/createTable&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;rollback&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;dropIndex&lt;/span&gt; &lt;span class="na"&gt;tableName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"product_audit"&lt;/span&gt; &lt;span class="na"&gt;indexName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"idx_product_audit_product"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;dropTable&lt;/span&gt; &lt;span class="na"&gt;tableName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"product_audit"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/rollback&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/changeSet&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That comment inside the changeset is there because the ordering cost me a debug cycle. Liquibase validates the XML against its schema, and if &lt;code&gt;&amp;lt;preConditions&amp;gt;&lt;/code&gt; comes after &lt;code&gt;&amp;lt;comment&amp;gt;&lt;/code&gt;, the changelog fails to parse at startup.&lt;/p&gt;

&lt;p&gt;The last pair is the view. Flyway's &lt;code&gt;R__product_catalog_view.sql&lt;/code&gt; is a repeatable migration: no version, re-applied whenever its checksum changes. Liquibase gets the same behavior from an attribute, &lt;code&gt;runOnChange="true"&lt;/code&gt; on changeset 006, so the rule lives in the changeset instead of the filename.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: run it
&lt;/h2&gt;

&lt;p&gt;You need Java 25 and Maven 3.9 or newer. H2 is embedded, so there's nothing else to install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/wallaceespindola/flyway-vs-liquibase-db-migrations.git
&lt;span class="nb"&gt;cd&lt;/span&gt; flyway-vs-liquibase-db-migrations
./start.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;start.sh&lt;/code&gt; builds the jar if needed, starts the app in the background and waits for the health check. Use &lt;code&gt;./start.sh --clean&lt;/code&gt; to delete both databases first and watch every migration run from scratch, &lt;code&gt;./stop.sh&lt;/code&gt; to shut down, and &lt;code&gt;make help&lt;/code&gt; for the Makefile equivalents. Swagger UI is at &lt;code&gt;http://localhost:8080/swagger-ui.html&lt;/code&gt; and the H2 console at &lt;code&gt;/h2-console&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then ask for the comparison:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s http://localhost:8080/api/v1/comparison &lt;span class="o"&gt;|&lt;/span&gt; jq
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's what I got on a clean start, trimmed for length (timestamps and timings will differ on your machine):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Both engines produced an equivalent business schema"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"flyway"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"engine"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"FLYWAY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"historyTable"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"flyway_schema_history"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"appliedCount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"pendingCount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"upToDate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"migrations"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nl"&gt;"identifier"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"V1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"create category table"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"n/a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"checksum"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"-1250524602"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"executionTimeMs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Success"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"liquibase"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"engine"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"LIQUIBASE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"historyTable"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"DATABASECHANGELOG"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"appliedCount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"pendingCount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"upToDate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"migrations"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nl"&gt;"identifier"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"001-create-category-table::wallaceespindola"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Create the category reference table"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"wallaceespindola"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"checksum"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"9:0d75bd8afd86057e8d2484d044a2f1ca"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"executionTimeMs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"EXECUTED"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"schemasEquivalent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"schemaDifferences"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"featureMatrix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"feature"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Execution timing recorded"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"flyway"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Yes, per migration, in milliseconds"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"liquibase"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"No per-changeset duration is persisted"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"edge"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"FLYWAY"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-11-17T23:45:16.296765Z"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three things to look at. &lt;code&gt;schemasEquivalent: true&lt;/code&gt; with an empty &lt;code&gt;schemaDifferences&lt;/code&gt; means both engines produced the same tables, columns and views. The applied counts are 6 and 7, because V5 adds the &lt;code&gt;active&lt;/code&gt; column and backfills it in one script while Liquibase splits that into &lt;code&gt;005&lt;/code&gt; (the column, labeled &lt;code&gt;schema-evolution&lt;/code&gt;) and &lt;code&gt;005b&lt;/code&gt; (the backfill, labeled &lt;code&gt;data-backfill&lt;/code&gt;), each with its own rollback. And the history rows differ in shape: Flyway has a duration but no author, Liquibase has an author but &lt;code&gt;executionTimeMs: null&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The null is kept in the JSON on purpose (Jackson is configured to include nulls). Liquibase does log "ran successfully in 3ms" for each changeset at startup, but it doesn't write that duration to &lt;code&gt;DATABASECHANGELOG&lt;/code&gt;, so there's nothing to read back later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: read the history back from inside the app
&lt;/h2&gt;

&lt;p&gt;This is where the two implementations of &lt;code&gt;MigrationHistoryProvider&lt;/code&gt; look nothing alike. &lt;code&gt;FlywayHistoryService&lt;/code&gt; asks Flyway (trimmed):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;MigrationInfo&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;flyway&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;debug&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Flyway reported {} known migrations"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AppliedMigration&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;applied&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Arrays&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;all&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getInstalledOn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FlywayHistoryService&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;toAppliedMigration&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Comparator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;comparing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;AppliedMigration&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;appliedAt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;flyway.info()&lt;/code&gt; returns applied and pending migrations as objects, ordered, with state and checksum, and it comes straight from the bean the app already has. Liquibase does have a status API (&lt;code&gt;getChangeSetStatuses()&lt;/code&gt; and &lt;code&gt;listUnrunChangeSets()&lt;/code&gt; on the &lt;code&gt;Liquibase&lt;/code&gt; class), but it needs an instance built from the changelog plus an open database connection. &lt;code&gt;SpringLiquibase&lt;/code&gt; runs the update at startup and doesn't hand you that object, so &lt;code&gt;LiquibaseHistoryService&lt;/code&gt; queries the bookkeeping table directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="no"&gt;HISTORY_QUERY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
        &lt;span class="s2"&gt;"""
        SELECT ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, EXECTYPE,
               MD5SUM, DESCRIPTION, COMMENTS, CONTEXTS, LABELS, DEPLOYMENT_ID
        FROM DATABASECHANGELOG
        ORDER BY ORDEREXECUTED
        """&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I kept both shapes instead of hiding them behind something clever. The SQL route is the finding: with the Spring integration, the table is the easiest interface on the Liquibase side. In exchange, that table carries author, contexts, labels and deployment id, none of which exist in &lt;code&gt;flyway_schema_history&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A few more endpoints if you want to poke around:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s http://localhost:8080/api/v1/migrations/liquibase &lt;span class="o"&gt;|&lt;/span&gt; jq &lt;span class="s1"&gt;'.data.migrations[].identifier'&lt;/span&gt;
curl -s http://localhost:8080/api/v1/migrations/flyway/schema &lt;span class="o"&gt;|&lt;/span&gt; jq
curl -s http://localhost:8080/api/v1/catalog/liquibase &lt;span class="o"&gt;|&lt;/span&gt; jq
curl -s http://localhost:8080/api/v1/comparison/features &lt;span class="o"&gt;|&lt;/span&gt; jq
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last one returns the 18-row feature matrix on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Flyway warns about H2:&lt;/strong&gt; Flyway 12.4.0 logs that H2 2.4.240 is newer than the version it was verified with (2.3.232). Everything works. I left both versions to the Spring Boot BOM rather than pinning one, because pinning takes the project off the set Spring Boot tests together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Liquibase fails to parse the changelog:&lt;/strong&gt; check element order inside the changeset. &lt;code&gt;&amp;lt;preConditions&amp;gt;&lt;/code&gt; goes before &lt;code&gt;&amp;lt;comment&amp;gt;&lt;/code&gt; and before any change tags.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Queries hit empty tables:&lt;/strong&gt; a &lt;code&gt;JdbcTemplate&lt;/code&gt; is missing its &lt;code&gt;@DependsOn&lt;/code&gt; on the engine bean.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The diff reports index differences:&lt;/strong&gt; it won't, by design. &lt;code&gt;ComparisonService.diff()&lt;/code&gt; compares tables, views and columns and ignores indexes, because H2 generates names for constraint-backing indexes and those names differ between the two engines. Counting them would report noise as drift.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You added a migration and a test failed:&lt;/strong&gt; you added it to one side only. The integration test asserts &lt;code&gt;schemasEquivalent&lt;/code&gt; and the exact applied counts, so a new &lt;code&gt;V6&lt;/code&gt; needs its &lt;code&gt;007&lt;/code&gt; changeset, and the 6 and 7 in the tests move together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Licensing, before you pick one
&lt;/h2&gt;

&lt;p&gt;The rollback in changeset 004 is free, but check what "free" means now. With &lt;a href="https://docs.liquibase.com/community/release-notes/5-0" rel="noopener noreferrer"&gt;Liquibase 5.0&lt;/a&gt;, Liquibase Community moved from Apache 2.0 to the &lt;a href="https://www.liquibase.com/blog/liquibase-community-for-the-future-fsl" rel="noopener noreferrer"&gt;Functional Source License&lt;/a&gt; (FSL-1.1-ALv2), which converts to Apache 2.0 after two years. Liquibase's own FAQ calls it source available, not OSI open source, and contributors now sign a CLA. The commercial product, &lt;a href="https://www.liquibase.com/5-0-launch" rel="noopener noreferrer"&gt;formerly Pro&lt;/a&gt;, is now Liquibase Secure. Whether that matters depends on how you use and distribute it, so ask whoever signs off on licenses before you standardize on it.&lt;/p&gt;

&lt;p&gt;On the Flyway side, undo migrations aren't in Community. Per Redgate's &lt;a href="https://documentation.red-gate.com/fd/feature-summary-165740620.html" rel="noopener noreferrer"&gt;feature summary&lt;/a&gt; they're a paid-edition feature (Enterprise can also generate undo scripts for you). In Community, reverting means a new forward migration, which is exactly what the V4 comment says.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Two databases, one per engine, so neither tool ever sees the other's tables.&lt;/li&gt;
&lt;li&gt;Explicit &lt;code&gt;FlywayConfig&lt;/code&gt; and &lt;code&gt;LiquibaseConfig&lt;/code&gt;, DataSource auto-configuration excluded, &lt;code&gt;@DependsOn&lt;/code&gt; so nothing queries an unmigrated database.&lt;/li&gt;
&lt;li&gt;Paired migration files: V1 to V5 plus &lt;code&gt;R__&lt;/code&gt; against 001 to 006 plus &lt;code&gt;005b&lt;/code&gt;, which is why the counts are 6 and 7.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GET /api/v1/comparison&lt;/code&gt; returns &lt;code&gt;schemasEquivalent: true&lt;/code&gt;, and the project's 86 tests (98.8% line coverage, 80% JaCoCo gate) keep it that way.&lt;/li&gt;
&lt;li&gt;History reads differ: &lt;code&gt;flyway.info()&lt;/code&gt; against a &lt;code&gt;SELECT&lt;/code&gt; on &lt;code&gt;DATABASECHANGELOG&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it yourself
&lt;/h2&gt;

&lt;p&gt;Clone &lt;a href="https://github.com/wallaceespindola/flyway-vs-liquibase-db-migrations" rel="noopener noreferrer"&gt;the repo&lt;/a&gt;, run &lt;code&gt;./start.sh --clean&lt;/code&gt;, and open &lt;code&gt;http://localhost:8080/&lt;/code&gt; for the dashboard or curl the comparison endpoint. Then break it on purpose: add a column in a new &lt;code&gt;V6&lt;/code&gt; without the Liquibase counterpart, restart, and watch &lt;code&gt;schemaDifferences&lt;/code&gt; fill up.&lt;/p&gt;

&lt;p&gt;Which of the two does your team run today, and has the rollback or the licensing question actually changed a decision for you? I'd like to hear in the comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples repository:&lt;/strong&gt; the Spring Boot application, both sets of migration files, the comparison endpoints, the tests and the diagrams from this article are all in &lt;a href="https://github.com/wallaceespindola/flyway-vs-liquibase-db-migrations" rel="noopener noreferrer"&gt;https://github.com/wallaceespindola/flyway-vs-liquibase-db-migrations&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Need more tech insights?&lt;br&gt;
Check out my GitHub, LinkedIn, and Speaker Deck.&lt;br&gt;
Happy coding!&lt;/p&gt;

&lt;p&gt;Wallace Espindola, Solution Architect&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/wallaceespindola/" rel="noopener noreferrer"&gt;https://github.com/wallaceespindola/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;LinkedIn: &lt;a href="https://www.linkedin.com/in/wallaceespindola/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/wallaceespindola/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Speaker Deck: &lt;a href="https://speakerdeck.com/wallacese" rel="noopener noreferrer"&gt;https://speakerdeck.com/wallacese&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>database</category>
      <category>devops</category>
    </item>
    <item>
      <title>Characterization tests before a banking COBOL migration to Java, hands-on</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Tue, 17 Nov 2026 22:52:36 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/characterization-tests-before-a-banking-cobol-migration-to-java-hands-on-5geo</link>
      <guid>https://dev.to/wallaceespindola/characterization-tests-before-a-banking-cobol-migration-to-java-hands-on-5geo</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuo1cj0voqe01tj5ia2db.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuo1cj0voqe01tj5ia2db.png" alt="Abstract dark network of light nodes converging on a single document shape, with the words Read the COBOL first" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You've been asked to move a bank's monthly interest calculation off the mainframe. The COBOL program is short, the logic looks like one line of arithmetic, and someone on the team has already said "we can port that in an afternoon". They're right about the afternoon. The port will compile, the unit tests you write for it will pass, and it will still be off by a cent on some accounts.&lt;/p&gt;

&lt;p&gt;That cent sums up the trouble with legacy banking code. The rules live in the code rather than in a document, and the code carries semantics (truncation, packed decimal, implied decimal points) that a reasonable-looking Java port changes without anyone noticing. So before you port anything, you pin down what the legacy system actually does and make it the judge.&lt;/p&gt;

&lt;p&gt;This article covers the hands-on part: the files you read, the files you add and the commands you run to put one COBOL rule under characterization tests, port it to Java 25 and prove the port is equivalent. Everything is in the companion repo, &lt;a href="https://github.com/wallaceespindola/banking-modernization-with-ai" rel="noopener noreferrer"&gt;banking-modernization-with-ai on GitHub&lt;/a&gt;. The COBOL in there is illustrative (it isn't compiled), and the Java module is real and runs with &lt;code&gt;make test&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjeobgvulrj0vbrjk99ih.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjeobgvulrj0vbrjk99ih.png" alt="The modernization loop in three stages: understand the legacy estate by discovering it and extracting rules, prove and move by characterizing, modernizing one slice and verifying it, then cut over and decommission, with breaks going back to the rules" width="800" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The diagram is the whole loop the repo describes. This article lives in the middle of it: extract one rule, characterize it, port it, verify it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's in the repo
&lt;/h2&gt;

&lt;p&gt;These are the files you'll touch, in the order you'll touch them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;examples/cobol/
  ACCTREC.cpy                       # account record layout (copybook)
  INTCALC.cbl                       # monthly interest, rule BR-INT-001
docs/templates/
  rule-catalog-entry.md             # catalog template + BR-INT-001 entry
examples/java/src/main/java/com/wtechitsolutions/bankingmodernization/
  PackedDecimal.java                # COMP-3 decoder
  InterestRule.java                 # legacy-equivalent port + naive port
  Reconciler.java                   # zero-tolerance, per-account compare
examples/java/src/test/
  java/.../InterestRuleGoldenMasterTest.java
  resources/golden/monthly-interest.csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You need Java 25 and Maven for the Java part. Nothing else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: read the copybook before the program
&lt;/h2&gt;

&lt;p&gt;Start with the copybook, not the program. In COBOL, the copybook is the data contract, and it's usually shared. The header comment in &lt;code&gt;ACCTREC.cpy&lt;/code&gt; says it plainly: changing it is an interface change for every program that &lt;code&gt;COPY&lt;/code&gt;s it. Here are the fields that matter for interest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cobol"&gt;&lt;code&gt;       &lt;span class="mi"&gt;01&lt;/span&gt;  &lt;span class="no"&gt;ACCT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;REC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
           &lt;span class="mi"&gt;05&lt;/span&gt;  &lt;span class="no"&gt;ACCT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;ID&lt;/span&gt;                 &lt;span class="no"&gt;PIC&lt;/span&gt; &lt;span class="no"&gt;X&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
           &lt;span class="mi"&gt;05&lt;/span&gt;  &lt;span class="no"&gt;ACCT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;STATUS&lt;/span&gt;             &lt;span class="no"&gt;PIC&lt;/span&gt; &lt;span class="no"&gt;X&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
               &lt;span class="mi"&gt;88&lt;/span&gt;  &lt;span class="no"&gt;ACCT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;ACTIVE&lt;/span&gt;                   &lt;span class="no"&gt;VALUE&lt;/span&gt; &lt;span class="s1"&gt;'A'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
               &lt;span class="mi"&gt;88&lt;/span&gt;  &lt;span class="no"&gt;ACCT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;CLOSED&lt;/span&gt;                   &lt;span class="no"&gt;VALUE&lt;/span&gt; &lt;span class="s1"&gt;'C'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
           &lt;span class="mi"&gt;05&lt;/span&gt;  &lt;span class="no"&gt;ACCT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;BALANCE&lt;/span&gt;            &lt;span class="no"&gt;PIC&lt;/span&gt; &lt;span class="no"&gt;S9&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="no"&gt;V99&lt;/span&gt; &lt;span class="no"&gt;COMP&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
           &lt;span class="mi"&gt;05&lt;/span&gt;  &lt;span class="no"&gt;ACCT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;ANNUAL&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;RATE&lt;/span&gt;        &lt;span class="no"&gt;PIC&lt;/span&gt; &lt;span class="no"&gt;S9&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="no"&gt;V99&lt;/span&gt;  &lt;span class="no"&gt;COMP&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
           &lt;span class="mi"&gt;05&lt;/span&gt;  &lt;span class="no"&gt;ACCT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;OPEN&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;DATE&lt;/span&gt;          &lt;span class="no"&gt;PIC&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
      &lt;span class="o"&gt;*&lt;/span&gt;        &lt;span class="nc"&gt;Julian&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="no"&gt;CCYYDDD&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three things in there will bite a naive port. &lt;code&gt;S9(11)V99&lt;/code&gt; means signed, eleven integer digits and two decimals, but the &lt;code&gt;V&lt;/code&gt; is an implied decimal point: it isn't stored anywhere in the bytes. &lt;code&gt;COMP-3&lt;/code&gt; means packed decimal, so you can't read the field as text. And the open date is a Julian &lt;code&gt;CCYYDDD&lt;/code&gt;, which isn't used by this rule but will be by the next one. (The 88-levels are named conditions, so &lt;code&gt;IF ACCT-ACTIVE&lt;/code&gt; in the program means &lt;code&gt;ACCT-STATUS = 'A'&lt;/code&gt;.)&lt;/p&gt;

&lt;p&gt;Now the program. The rule itself is one statement in paragraph &lt;code&gt;2000-CALC-INTEREST&lt;/code&gt; of &lt;code&gt;INTCALC.cbl&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cobol"&gt;&lt;code&gt;       &lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;CALC&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;INTEREST&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
           &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="no"&gt;ACCT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;ACTIVE&lt;/span&gt;
      &lt;span class="o"&gt;*&lt;/span&gt;        &lt;span class="nc"&gt;No&lt;/span&gt; &lt;span class="no"&gt;ROUNDED&lt;/span&gt; &lt;span class="n"&gt;phrase&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;truncated&lt;/span&gt; &lt;span class="k"&gt;to&lt;/span&gt; &lt;span class="n"&gt;two&lt;/span&gt; &lt;span class="n"&gt;decimals&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
               &lt;span class="no"&gt;COMPUTE&lt;/span&gt; &lt;span class="no"&gt;WS&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;MONTHLY&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;INT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
                   &lt;span class="no"&gt;ACCT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;BALANCE&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;ACCT&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;ANNUAL&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;RATE&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1200&lt;/span&gt;
           &lt;span class="k"&gt;ELSE&lt;/span&gt;
               &lt;span class="no"&gt;MOVE&lt;/span&gt; &lt;span class="no"&gt;ZERO&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="no"&gt;WS&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;MONTHLY&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="no"&gt;INT&lt;/span&gt;
           &lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The detail you're looking for is what's missing. There's no &lt;code&gt;ROUNDED&lt;/code&gt; phrase on the &lt;code&gt;COMPUTE&lt;/code&gt;, so COBOL truncates the result to the two decimals of the receiving field &lt;code&gt;WS-MONTHLY-INT PIC S9(11)V99&lt;/code&gt;. Truncation goes toward zero, which matters for negative balances. A real legacy program wouldn't have that helpful comment, which is why you read the statement and not the comments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: decode COMP-3 into BigDecimal
&lt;/h2&gt;

&lt;p&gt;You can't compare legacy and modern results until you can read the legacy data. Packed decimal stores two digits per byte, one per nibble, and the last nibble is the sign: &lt;code&gt;C&lt;/code&gt; for positive, &lt;code&gt;D&lt;/code&gt; for negative, &lt;code&gt;F&lt;/code&gt; for unsigned. The scale isn't in the bytes at all. It comes from the &lt;code&gt;PIC&lt;/code&gt; clause, so &lt;code&gt;PIC S9(3)V99 COMP-3&lt;/code&gt; has scale 2 and the value +123.45 is stored as &lt;code&gt;12 34 5C&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here is the decoder, trimmed from &lt;code&gt;PackedDecimal.java&lt;/code&gt; in the repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;IllegalArgumentException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Packed decimal field is empty"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nc"&gt;StringBuilder&lt;/span&gt; &lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;StringBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;high&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mh"&gt;0x0F&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;low&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mh"&gt;0x0F&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;digits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;digit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;high&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;digits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;digit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;signed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BigInteger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;low&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;movePointLeft&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setScale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;IllegalStateException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"unreachable"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two choices in there are deliberate. The caller passes the scale, because only the copybook knows it. And the decoder throws on a digit nibble above 9 or an unknown sign nibble instead of guessing, because a corrupt field should stop a migration run, not turn into a plausible number. &lt;code&gt;PackedDecimalTest&lt;/code&gt; covers positive, negative, unsigned (&lt;code&gt;05 0F&lt;/code&gt; with scale 2 is &lt;code&gt;0.50&lt;/code&gt;) and both invalid cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: write the rule catalog entry
&lt;/h2&gt;

&lt;p&gt;Before any Java, write down the rule in a form a domain expert can confirm. The repo has a template in &lt;code&gt;docs/templates/rule-catalog-entry.md&lt;/code&gt; and a filled-in entry for this rule. Trimmed from the repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## BR-INT-001: Monthly interest accrual
&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;Status: validated
&lt;span class="k"&gt;- &lt;/span&gt;Capability: Interest accrual
&lt;span class="k"&gt;- &lt;/span&gt;Source: &lt;span class="sb"&gt;`examples/cobol/INTCALC.cbl`&lt;/span&gt;, paragraph &lt;span class="sb"&gt;`2000-CALC-INTEREST`&lt;/span&gt;; copybook &lt;span class="sb"&gt;`examples/cobol/ACCTREC.cpy`&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;Plain-language rule: for an active account, monthly interest is the balance times the annual rate in percent, divided by 1200. Closed accounts accrue nothing.
&lt;span class="k"&gt;- &lt;/span&gt;Inputs: &lt;span class="sb"&gt;`ACCT-BALANCE PIC S9(11)V99 COMP-3`&lt;/span&gt;, &lt;span class="sb"&gt;`ACCT-ANNUAL-RATE PIC S9(3)V99 COMP-3`&lt;/span&gt;, &lt;span class="sb"&gt;`ACCT-STATUS PIC X(1)`&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;Output: &lt;span class="sb"&gt;`WS-MONTHLY-INT PIC S9(11)V99 COMP-3`&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;Arithmetic: no &lt;span class="sb"&gt;`ROUNDED`&lt;/span&gt; phrase, so the result is truncated toward zero to two decimals. Intermediate precision depends on compiler options and is pinned by the characterization tests.
&lt;span class="k"&gt;- &lt;/span&gt;Edge cases: negative balances (overdraft interest, truncated toward zero), zero balance, sub-cent results, maximum balance
&lt;span class="k"&gt;- &lt;/span&gt;Characterization tests: &lt;span class="sb"&gt;`examples/java/src/test/java/com/wtechitsolutions/bankingmodernization/InterestRuleGoldenMasterTest.java`&lt;/span&gt;, data in &lt;span class="sb"&gt;`examples/java/src/test/resources/golden/monthly-interest.csv`&lt;/span&gt;
&lt;span class="k"&gt;- &lt;/span&gt;Modern implementation: &lt;span class="sb"&gt;`examples/java/src/main/java/com/wtechitsolutions/bankingmodernization/InterestRule.java`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Arithmetic line is the one that saves you. It turns "the code divides by 1200" into "the code truncates toward zero to two decimals", which is a statement someone can agree or disagree with. The Edge cases line drives the test data in the next step.&lt;/p&gt;

&lt;p&gt;This is also where AI is most useful in the workflow. An assistant can read the program and draft this entry quickly, with the source link and paragraph or line range. It can't approve it. The template keeps a status field (candidate, in review, validated, rejected) and an "Approved by" field for a reason: AI proposes, a named domain expert signs off, and the entry isn't done until it links to the tests that prove the port matches.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: capture the golden master
&lt;/h2&gt;

&lt;p&gt;A golden master (or characterization test, in Michael Feathers' terms from &lt;a href="https://www.oreilly.com/library/view/working-effectively-with/0131177052/" rel="noopener noreferrer"&gt;Working Effectively with Legacy Code&lt;/a&gt;) records what the legacy system outputs for a set of inputs, without judging whether it's right. The legacy system is the test oracle, and it outranks the spec, the model and your own reading of the code.&lt;/p&gt;

&lt;p&gt;In a real migration you'd run the legacy batch against representative and edge-case inputs (masked, never raw production data) and save the outputs. The repo can't do that, so its CSV is an illustrative fixture worked out by hand from the COBOL semantics, not captured from a real bank. Here it is, &lt;code&gt;src/test/resources/golden/monthly-interest.csv&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;account,balance,annual_rate_percent,legacy_monthly_interest
ACC-0001,1000.00,5.00,4.16
ACC-0002,2500.00,3.75,7.81
ACC-0003,1234.56,2.50,2.57
ACC-0004,999999.99,4.10,3416.66
ACC-0005,0.01,5.00,0.00
ACC-0006,-150.00,18.00,-2.25
ACC-0007,-100.00,19.99,-1.66
ACC-0008,0.00,7.25,0.00
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most rows map to an edge case from the catalog entry: a sub-cent result (&lt;code&gt;ACC-0005&lt;/code&gt;), a zero balance (&lt;code&gt;ACC-0008&lt;/code&gt;), a large balance (&lt;code&gt;ACC-0004&lt;/code&gt;) and two overdrafts (&lt;code&gt;ACC-0006&lt;/code&gt;, &lt;code&gt;ACC-0007&lt;/code&gt;). The others (&lt;code&gt;ACC-0001&lt;/code&gt;, &lt;code&gt;ACC-0002&lt;/code&gt;, &lt;code&gt;ACC-0003&lt;/code&gt;) are baseline cases. Look at &lt;code&gt;ACC-0001&lt;/code&gt;: 1000.00 times 5.00 divided by 1200 is 4.1666..., and truncation makes the legacy answer 4.16 where rounding would give 4.17.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: port the rule with the right RoundingMode
&lt;/h2&gt;

&lt;p&gt;Now you write Java. Money is &lt;code&gt;BigDecimal&lt;/code&gt; with an explicit scale and an explicit &lt;code&gt;RoundingMode&lt;/code&gt;, never &lt;code&gt;double&lt;/code&gt;. &lt;code&gt;InterestRule.java&lt;/code&gt; holds two versions of the rule on purpose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="cm"&gt;/** Legacy-equivalent result: truncation toward zero, like COBOL without {@code ROUNDED}. */&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="nf"&gt;monthlyInterest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;annualRatePercent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// One division on an exact product. If the compiler used a smaller intermediate precision&lt;/span&gt;
    &lt;span class="c1"&gt;// (ARITH option), pin that from the characterization tests before changing this line.&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;annualRatePercent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;divide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;MONTHS_TIMES_PERCENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;MONEY_SCALE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;RoundingMode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;DOWN&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/** The port a reviewer would accept at first glance: banker's rounding. Kept to show the break. */&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="nf"&gt;monthlyInterestNaivePort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;annualRatePercent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;annualRatePercent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;divide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;MONTHS_TIMES_PERCENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;MONEY_SCALE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;RoundingMode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;HALF_EVEN&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;RoundingMode.DOWN&lt;/code&gt; in Java rounds toward zero, which matches COBOL truncation for both positive and negative values. (&lt;code&gt;FLOOR&lt;/code&gt; would not: it turns -1.6658... into -1.67.) &lt;code&gt;MONTHS_TIMES_PERCENT&lt;/code&gt; is &lt;code&gt;1200&lt;/code&gt; and &lt;code&gt;MONEY_SCALE&lt;/code&gt; is &lt;code&gt;2&lt;/code&gt;, so the scale of the receiving field is explicit in the code, just like the &lt;code&gt;PIC&lt;/code&gt; clause.&lt;/p&gt;

&lt;p&gt;The naive port uses &lt;code&gt;HALF_EVEN&lt;/code&gt;, banker's rounding. It isn't a silly choice. It reads as more "correct" than truncation, and a reviewer could easily approve it, which is why the repo keeps it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: reconcile against the golden master
&lt;/h2&gt;

&lt;p&gt;A test that compares one value at a time tells you a row failed. A reconciler tells you which accounts broke, by how much and whether the totals agree. That's the shape of the report a business owner will read: &lt;code&gt;Reconciler.Report&lt;/code&gt; carries the breaks plus &lt;code&gt;legacyTotal&lt;/code&gt; and &lt;code&gt;modernTotal&lt;/code&gt;, and it only counts as equivalent when there are no breaks and the totals match. &lt;code&gt;Reconciler.java&lt;/code&gt; compares legacy and modern results per account with zero tolerance. The core loop, trimmed from the repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;legacy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;modern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;breaks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Break&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"missing in legacy"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;breaks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Break&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"missing in modern"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compareTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;breaks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Break&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"amount differs by "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;subtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toPlainString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It uses &lt;code&gt;compareTo&lt;/code&gt;, not &lt;code&gt;equals&lt;/code&gt;, because &lt;code&gt;BigDecimal.equals&lt;/code&gt; treats &lt;code&gt;10.0&lt;/code&gt; and &lt;code&gt;10.00&lt;/code&gt; as different. An account present on only one side is a break too. A missing record is a worse problem than a wrong cent.&lt;/p&gt;

&lt;p&gt;The golden-master test ties it together. Trimmed from &lt;code&gt;InterestRuleGoldenMasterTest.java&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@ParameterizedTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"{0}: {1} at {2}% -&amp;gt; {3}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@CsvFileSource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resources&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;GOLDEN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;numLinesToSkip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;matchesLegacyOutputToTheCent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;rate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;assertEquals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;InterestRule&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;monthlyInterest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;@Test&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;portReconcilesWithLegacyRun&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Reconciler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Report&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;reconcileAgainstGolden&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;InterestRule&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;monthlyInterest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nf"&gt;assertTrue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equivalent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"Breaks: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;breaks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;@Test&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;naivePortWithBankersRoundingProducesBreaks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Reconciler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Report&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;reconcileAgainstGolden&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;InterestRule&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;monthlyInterestNaivePort&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nf"&gt;assertFalse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equivalent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;assertEquals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;of&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ACC-0001"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ACC-0004"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ACC-0007"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;breaks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Reconciler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Break&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;accountId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The parameterized test runs once per CSV row, so each account shows up by name in the test report. The other two tests run the whole file through the reconciler, once with the real port and once with the naive one.&lt;/p&gt;

&lt;p&gt;Here's the loop those tests implement:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyy5ut54v5012ads4o6fl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyy5ut54v5012ads4o6fl.png" alt="Golden-master loop: the legacy batch run produces the golden master CSV, which feeds the reconciler its expected values; the BR-INT-001 catalog entry is ported to InterestRule.java with RoundingMode.DOWN, the reconciler checks it with zero tolerance per account, equivalent results let the slice move on, and a dashed arrow sends breaks back to the catalog entry" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow the dotted arrow when the reconciler reports a break. You don't patch the Java until the numbers match. You go back to the catalog entry, find out which rule you misunderstood, get it confirmed and then fix the port.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: run it and watch the naive port fail
&lt;/h2&gt;

&lt;p&gt;From the repo root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That runs &lt;code&gt;mvn -q test&lt;/code&gt; in &lt;code&gt;examples/java&lt;/code&gt;, so it's quiet when everything passes. Run Maven without &lt;code&gt;-q&lt;/code&gt; to see the counts. Trimmed Surefire output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; examples/java &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; mvn &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, ... in com.wtechitsolutions.bankingmodernization.PackedDecimalTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, ... in com.wtechitsolutions.bankingmodernization.ReconcilerTest
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, ... in com.wtechitsolutions.bankingmodernization.InterestRuleGoldenMasterTest
[INFO] Tests run: 17, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All 17 pass, and one of them passes because the naive port fails. With &lt;code&gt;HALF_EVEN&lt;/code&gt;, three of the eight accounts break:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Account&lt;/th&gt;
&lt;th&gt;Legacy&lt;/th&gt;
&lt;th&gt;Naive port&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ACC-0001&lt;/td&gt;
&lt;td&gt;4.16&lt;/td&gt;
&lt;td&gt;4.17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ACC-0004&lt;/td&gt;
&lt;td&gt;3416.66&lt;/td&gt;
&lt;td&gt;3416.67&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ACC-0007&lt;/td&gt;
&lt;td&gt;-1.66&lt;/td&gt;
&lt;td&gt;-1.67&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each break is one cent, on a fixture of eight rows. Across a real portfolio and a monthly cycle, that's the kind of difference that turns up in a ledger reconciliation weeks after go-live, when it's much harder to explain. If you want to see it fail in the other direction, change &lt;code&gt;RoundingMode.DOWN&lt;/code&gt; to &lt;code&gt;HALF_EVEN&lt;/code&gt; in &lt;code&gt;monthlyInterest&lt;/code&gt; and run the tests again: &lt;code&gt;matchesLegacyOutputToTheCent&lt;/code&gt; and &lt;code&gt;portReconcilesWithLegacyRun&lt;/code&gt; go red with the same three accounts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things that will trip you up
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Intermediate precision.&lt;/strong&gt; The Java port computes the exact product and does one division. A COBOL compiler can carry a different intermediate precision depending on its options (the comment in the repo calls it the &lt;code&gt;ARITH&lt;/code&gt; option). The catalog entry says that precision is pinned by the characterization tests, and the comment in &lt;code&gt;InterestRule&lt;/code&gt; says the same: if real legacy outputs disagree with the exact calculation, the golden master wins and you change the Java to match.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hand-made golden data.&lt;/strong&gt; The repo's CSV was worked out by hand, which is fine for showing the technique and not fine for a migration. In real work the golden master comes from running the legacy system, on masked inputs, and it covers month-end and the edge cases the domain expert names.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Copybooks beyond this one.&lt;/strong&gt; &lt;code&gt;ACCTREC.cpy&lt;/code&gt; is deliberately simple. Real ones bring &lt;code&gt;REDEFINES&lt;/code&gt;, &lt;code&gt;OCCURS DEPENDING ON&lt;/code&gt;, signed zoned decimal and EBCDIC collation that sorts differently from ASCII. Each one needs its own decoder and its own tests before you trust a comparison.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Equals on BigDecimal.&lt;/strong&gt; Using &lt;code&gt;equals&lt;/code&gt; instead of &lt;code&gt;compareTo&lt;/code&gt; is an easy way to make a reconciler report breaks that aren't there. &lt;code&gt;ReconcilerTest.equalAmountsWithDifferentScaleAreNotABreak&lt;/code&gt; is there to keep it honest.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs and what it misses
&lt;/h2&gt;

&lt;p&gt;Characterization tests cost something: you need access to the legacy system to run it, masked test data, a domain expert's time for the catalog entry and someone who can read COBOL well enough to spot a missing &lt;code&gt;ROUNDED&lt;/code&gt;. For one rule that's manageable. Across a whole estate it's a large share of the work, so plan for it.&lt;/p&gt;

&lt;p&gt;They also don't tell you the legacy behavior is right. A golden master pins what the system does, bugs included. If the expert looks at the overdraft rows and says "that was never intended", you've found a business decision, and someone has to own the change.&lt;/p&gt;

&lt;p&gt;And they don't cover everything. A per-record golden master won't catch batch semantics like checkpoint and restart, cut-off times or "exactly once per business date". Those need record-and-replay, parallel runs over at least one full business cycle and reconciliation at the account and general-ledger level, which the &lt;a href="https://github.com/wallaceespindola/banking-modernization-with-ai/blob/main/docs/banking-modernization-with-ai-context.md" rel="noopener noreferrer"&gt;context file in the repo&lt;/a&gt; lays out in its testing section. For a rule that will be retired instead of ported, skip all of this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Read the copybook first. &lt;code&gt;PIC S9(11)V99 COMP-3&lt;/code&gt; tells you the sign, the scale and the storage format, none of which are in the bytes as text.&lt;/li&gt;
&lt;li&gt;Decode &lt;code&gt;COMP-3&lt;/code&gt; with the scale from the &lt;code&gt;PIC&lt;/code&gt; clause, and fail loudly on bad nibbles.&lt;/li&gt;
&lt;li&gt;Write the rule catalog entry before the code, with the arithmetic spelled out. AI can draft it, an expert approves it.&lt;/li&gt;
&lt;li&gt;Capture the golden master from the legacy system and treat it as the oracle.&lt;/li&gt;
&lt;li&gt;Port with &lt;code&gt;BigDecimal&lt;/code&gt; and the &lt;code&gt;RoundingMode&lt;/code&gt; the legacy code implies: &lt;code&gt;DOWN&lt;/code&gt; for COBOL without &lt;code&gt;ROUNDED&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Reconcile per account with zero tolerance, and send breaks back to the catalog entry.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it yourself
&lt;/h2&gt;

&lt;p&gt;Clone &lt;a href="https://github.com/wallaceespindola/banking-modernization-with-ai" rel="noopener noreferrer"&gt;the repo&lt;/a&gt;, run &lt;code&gt;make test&lt;/code&gt;, then flip the &lt;code&gt;RoundingMode&lt;/code&gt; in &lt;code&gt;InterestRule.monthlyInterest&lt;/code&gt; and watch the reconciler name the three accounts. After that, add a row to &lt;code&gt;monthly-interest.csv&lt;/code&gt; for a case the fixture doesn't cover (a closed account, or the maximum balance &lt;code&gt;PIC S9(11)V99&lt;/code&gt; allows), work out the legacy answer from the COBOL semantics and see whether the port agrees.&lt;/p&gt;

&lt;p&gt;Which COBOL arithmetic detail has caught you out in a port, rounding, intermediate precision or something in a copybook? I'd like to hear in the comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples repository:&lt;/strong&gt; every example in this article (the &lt;code&gt;ACCTREC&lt;/code&gt; copybook, the &lt;code&gt;INTCALC&lt;/code&gt; program, the BR-INT-001 catalog entry, the COMP-3 decoder, the interest rule and its naive port, the reconciler, the golden-master test and CSV and the diagrams) is in &lt;a href="https://github.com/wallaceespindola/banking-modernization-with-ai" rel="noopener noreferrer"&gt;https://github.com/wallaceespindola/banking-modernization-with-ai&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Need more tech insights?&lt;br&gt;&lt;br&gt;
Check out my GitHub, LinkedIn, and Speaker Deck.  &lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;p&gt;Wallace Espindola, Solution Architect&lt;br&gt;
GitHub: &lt;a href="https://github.com/wallaceespindola/" rel="noopener noreferrer"&gt;https://github.com/wallaceespindola/&lt;/a&gt;&lt;br&gt;
LinkedIn: &lt;a href="https://www.linkedin.com/in/wallaceespindola/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/wallaceespindola/&lt;/a&gt;&lt;br&gt;
Speaker Deck: &lt;a href="https://speakerdeck.com/wallacese" rel="noopener noreferrer"&gt;https://speakerdeck.com/wallacese&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cobol</category>
      <category>java</category>
      <category>testing</category>
      <category>legacy</category>
    </item>
    <item>
      <title>Strangle, don't rewrite: patterns around a COBOL core to modern Java</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Fri, 13 Nov 2026 12:10:28 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/strangle-dont-rewrite-patterns-around-a-cobol-core-to-modern-java-5954</link>
      <guid>https://dev.to/wallaceespindola/strangle-dont-rewrite-patterns-around-a-cobol-core-to-modern-java-5954</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4eblwg33ot7tkwv1562d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4eblwg33ot7tkwv1562d.png" alt="Banner for a hands-on guide to the patterns around a strangler facade in core banking modernization" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Say your bank runs its ledger on a COBOL core, and the mobile team wants a modern account inquiry API. Nobody wants a big-bang rewrite of the core, so someone draws a facade in front of the mainframe and says the magic words: Strangler Fig. Route one operation at a time to new code, and let the old system shrink.&lt;/p&gt;

&lt;p&gt;That's the right starting point, and &lt;a href="https://martinfowler.com/bliki/StranglerFigApplication.html" rel="noopener noreferrer"&gt;Martin Fowler's Strangler Fig Application page&lt;/a&gt; explains it well. The trouble starts the day after the facade goes in. The new service has to read packed decimals out of copybook records. It has to know whether a balance is posted or only memo-posted. It has to prove it computes the same interest as the old code before anyone flips a route. And once it publishes events, it has to survive the broker delivering the same event twice.&lt;/p&gt;

&lt;p&gt;That work falls to the patterns you add around the facade. This article covers the hands-on part: the Java code for three of those patterns (an anti-corruption layer, a parallel run with mismatch classification and a transactional outbox with an idempotent consumer), plus the read side you put next to them. Everything comes from a small Java 25 module in &lt;a href="https://github.com/wallaceespindola/legacy-modernization-patterns" rel="noopener noreferrer"&gt;legacy-modernization-patterns on GitHub&lt;/a&gt;, with no Spring and no database, so you can run it on a laptop in seconds.&lt;/p&gt;

&lt;p&gt;If you want the "why" behind not rewriting legacy systems blind, I wrote about that earlier in &lt;a href="https://dev.to/wallaceespindola/stop-rewriting-legacy-systems-use-ai-to-understand-them-first-21ba"&gt;Stop rewriting legacy systems, use AI to understand them first&lt;/a&gt;. This one stays close to the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pattern map
&lt;/h2&gt;

&lt;p&gt;Here's where each pattern sits around the facade, and which package in the repo implements it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3dn6u94now4yll7vnvzp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3dn6u94now4yll7vnvzp.png" alt="Pattern map in three rows: routing, where clients call a strangler facade that sends shadow and canary traffic to a parallel run; the modern path, where the parallel run hands the modern result to the modern service, which writes to an outbox table in the same transaction and a relay publishes to an event bus read by an idempotent consumer; and the legacy path, where the facade sends legacy calls to the ACL in front of the COBOL core" width="800" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The facade is the interception point. It starts as a pure pass-through (100% of traffic to legacy, no behavior change), and you only flip a route after the patterns below have done their job. Rolling back means changing a route, with no deployment involved.&lt;/p&gt;

&lt;p&gt;The module is organized by pattern:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Package&lt;/th&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Main class&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;acl&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Anti-Corruption Layer&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AccountTranslator&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;interest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Branch by Abstraction, Parallel Run&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;InterestCalculatorToggle&lt;/code&gt;, &lt;code&gt;ParallelRun&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;outbox&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Transactional Outbox, Idempotent Consumer&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;OutboxRelay&lt;/code&gt;, &lt;code&gt;IdempotentConsumer&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;posting&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Safe financial writes (unknown outcome)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SafePostingClient&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I'll skip &lt;code&gt;posting&lt;/code&gt; here. It deserves its own article, and the repo has it if you're curious.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: the anti-corruption layer
&lt;/h2&gt;

&lt;p&gt;The ACL is the boundary between the legacy world and your domain model. On a mainframe that means a few concrete jobs: EBCDIC to UTF-8, packed decimal (COMP-3) to &lt;code&gt;BigDecimal&lt;/code&gt;, fixed-width copybook records to typed objects and legacy return codes to domain outcomes. The example record in the repo is 20 bytes: a 10-byte account ID, a 1-byte type flag, a 7-byte COMP-3 balance and a 2-byte return code. The ID, flag and return code are EBCDIC text (code page &lt;code&gt;IBM037&lt;/code&gt;); the balance is COMP-3.&lt;/p&gt;

&lt;h3&gt;
  
  
  Decoding COMP-3
&lt;/h3&gt;

&lt;p&gt;Packed decimal stores two digits per byte, one per nibble, and puts the sign in the last nibble: &lt;code&gt;C&lt;/code&gt; or &lt;code&gt;F&lt;/code&gt; for positive, &lt;code&gt;D&lt;/code&gt; for negative. So the bytes &lt;code&gt;01 23 45 6C&lt;/code&gt; with scale 2 are &lt;code&gt;1234.56&lt;/code&gt;. Here's the decoder from &lt;code&gt;examples/account-modernization/src/main/java/com/wallaceespindola/modernization/acl/PackedDecimal.java&lt;/code&gt;, trimmed to the main method and the sign check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bytes&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;IllegalArgumentException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Empty packed decimal"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nc"&gt;BigInteger&lt;/span&gt; &lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BigInteger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ZERO&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mh"&gt;0xF&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mh"&gt;0xF&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;negative&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;isNegative&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mh"&gt;0xF&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;negative&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;digits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;negate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;digits&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="nf"&gt;isNegative&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;signNibble&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;signNibble&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="no"&gt;SIGN_POSITIVE_C&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;SIGN_POSITIVE_F&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="no"&gt;SIGN_NEGATIVE&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;IllegalArgumentException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Invalid packed sign nibble: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;signNibble&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details matter. The high nibble of the last byte is a digit, the low nibble is the sign, which is why the loop skips the low nibble only on the last byte. And anything unexpected (a digit nibble above 9, an unknown sign) throws (the digit check lives in &lt;code&gt;append&lt;/code&gt;, omitted above). You don't want a corrupt record to quietly become a balance of zero. &lt;code&gt;LegacyAccountRecord.parse&lt;/code&gt; catches that exception and rethrows it as a &lt;code&gt;LegacyTechnicalException&lt;/code&gt;, so callers see one kind of legacy failure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Semantic translation
&lt;/h3&gt;

&lt;p&gt;Once the bytes are decoded, you still have to decode the meaning. On many cores, the same balance field can hold a ledger (posted) balance or a memo-posted (pending) one, depending on a record type flag. If that flag leaks into your API, every consumer has to learn what &lt;code&gt;'M'&lt;/code&gt; means, and you've just copied the legacy model into the new system.&lt;/p&gt;

&lt;p&gt;Here's the translator from &lt;code&gt;examples/account-modernization/src/main/java/com/wallaceespindola/modernization/acl/AccountTranslator.java&lt;/code&gt;, trimmed to the two methods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;AccountLookup&lt;/span&gt; &lt;span class="nf"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;LegacyAccountRecord&lt;/span&gt; &lt;span class="k"&gt;record&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;LegacyAccountRecord&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;returnCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="no"&gt;OK&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Found&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;AccountBalance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;accountId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;typeOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;typeFlag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="no"&gt;NOT_FOUND&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;NotFound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;accountId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="no"&gt;BLOCKED&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Blocked&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;accountId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LegacyTechnicalException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Legacy return code "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="k"&gt;record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;returnCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;BalanceType&lt;/span&gt; &lt;span class="nf"&gt;typeOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;flag&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;flag&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="no"&gt;LEDGER_FLAG&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;BalanceType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;POSTED&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="no"&gt;MEMO_POSTED_FLAG&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;BalanceType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PENDING&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LegacyTechnicalException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Unknown record type flag "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;flag&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Return codes &lt;code&gt;"00"&lt;/code&gt;, &lt;code&gt;"04"&lt;/code&gt; and &lt;code&gt;"08"&lt;/code&gt; become &lt;code&gt;Found&lt;/code&gt;, &lt;code&gt;NotFound&lt;/code&gt; and &lt;code&gt;Blocked&lt;/code&gt;, three records of a sealed &lt;code&gt;AccountLookup&lt;/code&gt; interface, so the compiler makes callers handle each case. Flags &lt;code&gt;'L'&lt;/code&gt; and &lt;code&gt;'M'&lt;/code&gt; become &lt;code&gt;BalanceType.POSTED&lt;/code&gt; and &lt;code&gt;BalanceType.PENDING&lt;/code&gt;. Nothing named &lt;code&gt;typeFlag&lt;/code&gt; or &lt;code&gt;returnCode&lt;/code&gt; leaves the &lt;code&gt;acl&lt;/code&gt; package.&lt;/p&gt;

&lt;p&gt;A few rules I'd hold the ACL to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One ACL per bounded context:&lt;/strong&gt; an account ACL, not a "mainframe ACL" that every team adds to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Translation only:&lt;/strong&gt; no business rules. Once it starts deciding things, it's a new monolith with extra latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retire it with the legacy capability:&lt;/strong&gt; an ACL with no legacy system behind it is dead weight.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: the read side, pending and posted
&lt;/h2&gt;

&lt;p&gt;The first capability most teams move is account inquiry, because reads are low risk and high volume. The usual shape is change data capture (CDC) from the legacy store into a read model, with the ledger staying the system of record. That's CQRS without event sourcing: the mainframe ledger is already the write model.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvb48vc56hkbo0m7730ds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvb48vc56hkbo0m7730ds.png" alt="Read-side flow in two rows: the facade sends balance reads to the account inquiry service while CDC lag is within its SLO, and falls back to a legacy call through the ACL to the COBOL ledger when it isn't; below, the ledger memo-posts during the day and hard-posts at end of day, and CDC feeds a translation step into the read model with pending and posted balances, which the inquiry service reads" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The repo doesn't ship a CDC pipeline (it would need a database and a broker), but the ACL above is exactly what the translation step needs. Raw CDC records are legacy-shaped. If you write them straight into the read model, the new model inherits the old schema, flags included. So run them through the same kind of translation, and store &lt;code&gt;POSTED&lt;/code&gt; and &lt;code&gt;PENDING&lt;/code&gt; as separate, explicit values.&lt;/p&gt;

&lt;p&gt;Many cores memo-post during the day and hard-post in the end-of-day batch, and CDC sees both. If the read model has one "balance" column, customers will watch their balance jump around at night. With pending and posted modeled explicitly, the UI can show both and nothing surprises anyone.&lt;/p&gt;

&lt;p&gt;Two more things to put in place before you route reads to the new service:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A lag SLO with a fallback route:&lt;/strong&gt; if CDC falls behind, the facade sends balance reads back to legacy through the ACL. That keeps the step reversible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per-key ordering and dedup:&lt;/strong&gt; partition by account ID, and drop duplicates by source log position.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 3: the parallel run
&lt;/h2&gt;

&lt;p&gt;Before the facade sends real customers to new logic, you want evidence that the new logic agrees with the old one. A parallel run computes both, compares them, records the result and serves the legacy answer. The repo does this for monthly interest, behind a Branch by Abstraction toggle with three modes: &lt;code&gt;LEGACY&lt;/code&gt;, &lt;code&gt;SHADOW&lt;/code&gt; and &lt;code&gt;MODERN&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The two calculators disagree on purpose. The legacy one uses 30/360, truncates the intermediate result to four decimals, then rounds half-up (COBOL &lt;code&gt;ROUNDED&lt;/code&gt;). The modern one uses actual days over 365 and rounds half-even. Those are exactly the differences that show up in real parallel runs: rounding mode, day-count convention and intermediate truncation.&lt;/p&gt;

&lt;p&gt;Here's the core of &lt;code&gt;examples/account-modernization/src/main/java/com/wallaceespindola/modernization/interest/ParallelRun.java&lt;/code&gt;, trimmed to the two methods that matter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Override&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="nf"&gt;monthlyInterest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;annualRate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;YearMonth&lt;/span&gt; &lt;span class="n"&gt;month&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;legacyResult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;legacy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;monthlyInterest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;annualRate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;month&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;modernResult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;modern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;monthlyInterest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;annualRate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;month&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;difference&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;modernResult&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;subtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;legacyResult&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;comparisons&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Comparison&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;annualRate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;month&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;legacyResult&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;modernResult&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;difference&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nf"&gt;classify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;difference&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;month&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;legacyResult&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;MismatchCategory&lt;/span&gt; &lt;span class="nf"&gt;classify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;difference&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;YearMonth&lt;/span&gt; &lt;span class="n"&gt;month&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;difference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;signum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;MismatchCategory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;MATCH&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;difference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compareTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;ONE_CENT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;MismatchCategory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ROUNDING&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;difference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compareTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tolerance&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;MismatchCategory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;WITHIN_TOLERANCE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;oddMonthLength&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;month&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lengthOfMonth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;DAYS_IN_LEGACY_MONTH&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;oddMonthLength&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nc"&gt;MismatchCategory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;DAY_COUNT&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;MismatchCategory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;UNEXPLAINED&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last line of &lt;code&gt;monthlyInterest&lt;/code&gt; is the important one: it always returns &lt;code&gt;legacyResult&lt;/code&gt;. So shadow mode has no customer-visible effect. (In a real system you'd also stub notification and payment adapters on the shadow path, and enforce that in configuration.)&lt;/p&gt;

&lt;p&gt;The classification is what makes the output usable. A raw list of mismatches turns into a spreadsheet nobody reads. Buckets turn it into a triage conversation: rounding noise, within tolerance, a known day-count difference or something a human has to look at. With a balance of 1000 at 5% in January, the tests show legacy at &lt;code&gt;4.17&lt;/code&gt; and modern at &lt;code&gt;4.25&lt;/code&gt;. The difference of &lt;code&gt;0.08&lt;/code&gt; is above the one-cent tolerance, and January has 31 days, so it lands in &lt;code&gt;DAY_COUNT&lt;/code&gt;, not &lt;code&gt;UNEXPLAINED&lt;/code&gt;. &lt;code&gt;ParallelRunReport&lt;/code&gt; then counts comparisons per category.&lt;/p&gt;

&lt;p&gt;The classifier is a heuristic, and the Javadoc in the repo says so. In a real run you'd grow the categories as you explain differences (business date vs system date, time zones), and only &lt;code&gt;UNEXPLAINED&lt;/code&gt; should block a cutover. Once the counts look right, the rollout goes shadow, then canary (a small segment gets the modern result while legacy is still computed and compared), then full cutover with legacy kept warm for a rollback window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: the outbox and the idempotent consumer
&lt;/h2&gt;

&lt;p&gt;When the new service starts owning business events (a notification, a fraud signal), it needs to change its own state and publish an event without the two drifting apart. Writing to the database and then calling the broker is a dual write, and a crash between the two loses the event or publishes one for a change that never committed.&lt;/p&gt;

&lt;p&gt;The transactional outbox fixes that: the state change and an outbox row commit in one local transaction, and a relay publishes outbox rows later. The repo models the transaction with &lt;code&gt;InMemoryUnitOfWork&lt;/code&gt;, which commits ledger rows and outbox rows together or not at all. The relay, from &lt;code&gt;examples/account-modernization/src/main/java/com/wallaceespindola/modernization/outbox/OutboxRelay.java&lt;/code&gt;, trimmed to its one method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;relayOnce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;sent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutboxEvent&lt;/span&gt; &lt;span class="k"&gt;event&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unpublished&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;publisher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;publish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;RuntimeException&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="no"&gt;LOG&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Level&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;WARNING&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Publish failed for {0}, will retry: {1}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eventId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;markPublished&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eventId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;sent&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It stops at the first failure to keep the order, and it marks an event as published only after the broker accepted it. That second rule means a crash after &lt;code&gt;publish&lt;/code&gt; and before &lt;code&gt;markPublished&lt;/code&gt; sends the event again on the next run. Delivery is at-least-once, and there's no way around that on the producer side.&lt;/p&gt;

&lt;p&gt;So the consumer has to make duplicates harmless. Here's &lt;code&gt;examples/account-modernization/src/main/java/com/wallaceespindola/modernization/outbox/IdempotentConsumer.java&lt;/code&gt;, trimmed to the method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;synchronized&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="nf"&gt;accept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OutboxEvent&lt;/span&gt; &lt;span class="k"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inbox&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eventId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;accept&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;inbox&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eventId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The inbox is a set of processed event IDs. A redelivered event returns &lt;code&gt;false&lt;/code&gt; and the handler never runs twice. In production, the inbox is a table keyed by event ID, and you insert into it in the same transaction as the consumer's own state change. Otherwise you've moved the dual-write problem from the producer to the consumer.&lt;/p&gt;

&lt;p&gt;On the mainframe side, the same idea exists: write the event to a Db2 outbox table, or put it on MQ, inside the same CICS unit of work as the business update. For the relay you can poll, as the example does, or tail the outbox table with CDC, which avoids polling load and keeps commit order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things that will trip you up
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A leaky ACL.&lt;/strong&gt; If a legacy field name, a return code or a record shape shows up in a new API or event, the ACL has a hole. Review contracts for it the same way you review for secrets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rounding that isn't a bug.&lt;/strong&gt; COBOL &lt;code&gt;ROUNDED&lt;/code&gt; is half-up by default, while Java's &lt;code&gt;BigDecimal&lt;/code&gt; needs an explicit &lt;code&gt;RoundingMode&lt;/code&gt;. Plenty of "mismatches" in a parallel run come from this one line, so classify them as a group instead of chasing them one by one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shadow traffic with side effects.&lt;/strong&gt; A shadow path that sends a real notification or books a real entry is worse than no parallel run. Stub every adapter with a side effect, and enforce it in configuration so it doesn't depend on someone catching it in review.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A consumer that is "mostly" idempotent.&lt;/strong&gt; An inbox that is updated after the handler commits, in a separate transaction, will process a duplicate eventually. Write the inbox row in the same transaction as the handler's changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The perpetual strangler.&lt;/strong&gt; Facades, ACLs, CDC pipelines and parallel-run harnesses are transitional architecture. Each one needs a removal date, or you end up running and paying for both stacks indefinitely. &lt;a href="https://martinfowler.com/articles/patterns-legacy-displacement/" rel="noopener noreferrer"&gt;Patterns of Legacy Displacement&lt;/a&gt; by Ian Cartwright, Rob Horn and James Lewis calls this out well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it doesn't pay off
&lt;/h2&gt;

&lt;p&gt;This toolkit has a cost: you build, run and later delete everything in it. If the legacy capability is small enough to replace in one well-tested release, coexistence may cost more than the cutover. If it's stable, cheap to run and not blocking anyone, retaining it behind an API is a good outcome. And if there's no interception point at all (no API, queue or data boundary), the facade has nowhere to go, so you start with event interception or encapsulation first. There's no adoption data here. Choose the patterns per capability, and add each one only where it solves a problem you actually have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The strangler facade decides where traffic goes. It starts as a pass-through and every flip is a routing change you can undo.&lt;/li&gt;
&lt;li&gt;The ACL decodes COMP-3 and EBCDIC, but its real job is semantics: return codes become domain outcomes, flags become &lt;code&gt;POSTED&lt;/code&gt; and &lt;code&gt;PENDING&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The read side keeps pending and posted apart, has a lag SLO and falls back to legacy when it's behind.&lt;/li&gt;
&lt;li&gt;The parallel run serves the legacy answer, compares and classifies, so you triage categories instead of rows.&lt;/li&gt;
&lt;li&gt;The outbox gives you at-least-once publishing without dual writes, and the idempotent consumer makes the "at least" part safe.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it yourself
&lt;/h2&gt;

&lt;p&gt;You need Java 25 and Maven. Clone &lt;a href="https://github.com/wallaceespindola/legacy-modernization-patterns" rel="noopener noreferrer"&gt;the repo&lt;/a&gt; and run the build:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; examples/account-modernization &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; mvn verify
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All 36 tests should pass in a few seconds. Good places to start reading are &lt;code&gt;PackedDecimalTest&lt;/code&gt; (the byte-level examples), &lt;code&gt;ParallelRunTest&lt;/code&gt; (the classification cases, including the &lt;code&gt;4.17&lt;/code&gt; vs &lt;code&gt;4.25&lt;/code&gt; one) and &lt;code&gt;OutboxTest&lt;/code&gt; (a broker that fails, then recovers and gets the same event again). Then pass a tolerance of &lt;code&gt;0.10&lt;/code&gt; to &lt;code&gt;ParallelRun&lt;/code&gt; and rerun the January case: the &lt;code&gt;0.08&lt;/code&gt; &lt;code&gt;DAY_COUNT&lt;/code&gt; gap becomes &lt;code&gt;WITHIN_TOLERANCE&lt;/code&gt;. The pattern catalog behind the code, including the phases and exit criteria, is in &lt;a href="https://github.com/wallaceespindola/legacy-modernization-patterns/blob/main/docs/legacy-modernization-patterns-context.md" rel="noopener noreferrer"&gt;docs/legacy-modernization-patterns-context.md&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Which of these patterns did your team find hardest to get right around a legacy core: the ACL, the parallel run or the outbox? I'd like to hear in the comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples repository:&lt;/strong&gt; &lt;a href="https://github.com/wallaceespindola/legacy-modernization-patterns" rel="noopener noreferrer"&gt;https://github.com/wallaceespindola/legacy-modernization-patterns&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Need more tech insights?&lt;br&gt;
Check out my GitHub, LinkedIn, and Speaker Deck.&lt;br&gt;
Happy coding!&lt;/p&gt;

&lt;p&gt;Wallace Espindola, Solution Architect&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/wallaceespindola/" rel="noopener noreferrer"&gt;https://github.com/wallaceespindola/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;LinkedIn: &lt;a href="https://www.linkedin.com/in/wallaceespindola/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/wallaceespindola/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Speaker Deck: &lt;a href="https://speakerdeck.com/wallacese" rel="noopener noreferrer"&gt;https://speakerdeck.com/wallacese&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>architecture</category>
      <category>legacy</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Share Copilot capacity, not accounts: a TASK.md workflow</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Mon, 19 Oct 2026 22:31:56 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/share-copilot-capacity-not-accounts-a-taskmd-workflow-1kpl</link>
      <guid>https://dev.to/wallaceespindola/share-copilot-capacity-not-accounts-a-taskmd-workflow-1kpl</guid>
      <description>&lt;p&gt;Most teams get Copilot through a company contract with GitHub or Microsoft, and each developer works against a personal limit per billing period: a per-user credit allowance, or a per-user budget that admins set on top of the organization's pool. Usage is uneven. One developer has a small limit and runs out early in the period. Another ends the period with credits left over. A third has no license at all.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzr7pzieu1isa9omk1pwi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzr7pzieu1isa9omk1pwi.png" alt="Illustrative bar chart of per-developer Copilot credit use in one billing period: two developers hit the limit early, three have credits left over, and one has no license" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A limit belongs to one user, so the leftover credits do nothing for the colleague who ran out. That's capacity the company already paid for, sitting idle. If you route work to the people who still have credits, you get more out of the same contract without buying extra seats. (If your org pools credits with no per-user caps, the credit argument is weaker, but the teammate with no license still needs a way in.)&lt;/p&gt;

&lt;p&gt;The informal fix is a chat message: "can you run this through Copilot for me?" It sort of works, once. The context is half in your head, the delegate spends credits on clarifying questions, and everything Copilot learned disappears with the conversation.&lt;/p&gt;

&lt;p&gt;So I wrote down a process for doing it properly. The owner of the work writes a Markdown task spec, commits it to the repo, and a teammate with spare Copilot capacity implements it. Nobody transfers tokens or shares a login, and the repo carries the context.&lt;/p&gt;

&lt;p&gt;The full proposal and example files are here: &lt;a href="https://github.com/wallaceespindola/share-tokens-using-spec-driven-dev" rel="noopener noreferrer"&gt;share-tokens-using-spec-driven-dev on GitHub&lt;/a&gt;. This article covers the hands-on part: the files you add to a repo and how a task moves through them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4ba7chnmgecbtefh1xog.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4ba7chnmgecbtefh1xog.png" alt="The delegation loop in three stages: the owner writes the task spec and a reviewer checks it against the definition of ready, the delegate implements with Copilot while the owner validates and updates the spec on issues, then the owner opens the PR through the same CI/CD and quality gates" width="800" height="611"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  This is spec-driven development, with a team around it
&lt;/h2&gt;

&lt;p&gt;If you've used &lt;a href="https://github.com/github/spec-kit" rel="noopener noreferrer"&gt;GitHub Spec Kit&lt;/a&gt;, the shape will look familiar. Spec-driven development makes the spec the source of truth and treats the AI as the one who implements it. This process keeps that idea and splits the steps between people:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Spec Kit step&lt;/th&gt;
&lt;th&gt;Who does it here&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;/speckit-constitution&lt;/code&gt; (once per project)&lt;/td&gt;
&lt;td&gt;Team standards in &lt;code&gt;/docs&lt;/code&gt; plus &lt;code&gt;.github/copilot-instructions.md&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/speckit-specify&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Owner writes up the business requirements&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;/speckit-plan&lt;/code&gt;, &lt;code&gt;/speckit-tasks&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The approved &lt;code&gt;TASK-NNN.md&lt;/code&gt; file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/speckit-implement&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Delegate's Copilot session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/speckit-converge&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Owner's validation loop, repeated until the work is accepted&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;You don't need Spec Kit to run this. Plain Markdown files work fine. If you want the toolkit, it supports Copilot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;uv tool install specify-cli
specify init my-project --integration copilot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Spec Kit, you repeat implement and converge until converge reports "Converged". Here, the owner's validation plays that role.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one rule: nobody shares credentials
&lt;/h2&gt;

&lt;p&gt;Writing a good spec and validating the result cost zero AI credits. Implementation is where Copilot saves the most time. So the split is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;owner&lt;/strong&gt; does the thinking and the checking: writes the task, validates the result, makes the final commit and opens the PR.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;delegate&lt;/strong&gt; spends credits on the one part that benefits most: implementation, tests and docs.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;reviewer&lt;/strong&gt; (architect, tech lead or another developer) approves the task before anyone spends a credit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Upstream of all three, the business side (a product owner or analyst) writes the requirements and acceptance criteria, ideally in the existing &lt;code&gt;docs/specs&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The owner stays responsible for what gets merged, and the delegate never needs access they don't already have. Delegated code goes through the same review, CI/CD and quality gates as any other change.&lt;/p&gt;

&lt;p&gt;Here is the whole flow, one swimlane per role:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmwmsbfeekmp7f6jpshlm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmwmsbfeekmp7f6jpshlm.png" alt="Delegation flow across Business, Owner, Reviewer, Delegate, CI/CD and Team, with a send-back loop at review and an iteration loop at validation" width="800" height="745"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are two loops in there. A task the reviewer rejects goes back to the owner before any credits are spent. A result that fails validation goes back to the delegate, but only after the owner fixes the task file, because a retry against the same spec will usually produce the same mistake.&lt;/p&gt;

&lt;h2&gt;
  
  
  The repo layout
&lt;/h2&gt;

&lt;p&gt;Everything lives in the repository. A Copilot conversation is gone when the session ends, while the files stay in git history.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.github/
  copilot-instructions.md          # loaded into Copilot requests in this repo
  instructions/
    tests.instructions.md          # path-specific rules (applyTo glob)
  prompts/
    implement-task.prompt.md       # the shared /implement-task prompt
  agents/
    ready-check.agent.md           # optional: reviewer persona
docs/
  ARCHITECTURE.md
  CODING_GUIDE.md
  TESTING_GUIDE.md
  specs/report-generation/design.md
  backlog/
    TASK-042-order-summary-report.md
AGENTS.md                          # same guidance for other coding agents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Per GitHub's docs, repository instructions go in &lt;code&gt;.github/copilot-instructions.md&lt;/code&gt;, path-specific ones in &lt;code&gt;.github/instructions/*.instructions.md&lt;/code&gt;, custom agents in &lt;code&gt;.github/agents/*.agent.md&lt;/code&gt; and skills in &lt;code&gt;.github/skills/&amp;lt;name&amp;gt;/SKILL.md&lt;/code&gt;. Prompt files live in &lt;code&gt;.github/prompts/&lt;/code&gt; as &lt;code&gt;*.prompt.md&lt;/code&gt; and are documented by VS Code. Support differs between IDEs and the cloud agent, so check the docs for the surface your delegates use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: the task file
&lt;/h2&gt;

&lt;p&gt;One file per task, named &lt;code&gt;docs/backlog/TASK-NNN-short-slug.md&lt;/code&gt;. &lt;code&gt;NNN&lt;/code&gt; is zero-padded and never reused. Each task also gets a GitHub issue labeled &lt;code&gt;ai-delegation&lt;/code&gt; that links the file, so the issue board shows what is waiting and who picked up what.&lt;/p&gt;

&lt;p&gt;Here is the example from the repo, &lt;code&gt;TASK-042-order-summary-report.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;# TASK-042: Generate order summary report
&lt;/span&gt;
Status: Draft | Approved | In progress | In validation | Done
Owner: &amp;lt;name&amp;gt;
Reviewer: &amp;lt;name&amp;gt;
Delegate: &amp;lt;name&amp;gt;
Issue: &amp;lt;link&amp;gt;

&lt;span class="gu"&gt;## Objective
&lt;/span&gt;Generate the order summary report from normalized order records.

&lt;span class="gu"&gt;## Tech stack
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Java 25, Spring Boot, PostgreSQL
&lt;span class="k"&gt;- &lt;/span&gt;Kafka where required

&lt;span class="gu"&gt;## Expected behavior
&lt;/span&gt;1. Load the report configuration.
2. Retrieve the eligible orders.
3. Generate the report.
4. Store the delivery metadata.

&lt;span class="gu"&gt;## Architecture constraints
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Follow ../ARCHITECTURE.md and ../CODING_GUIDE.md.
&lt;span class="k"&gt;- &lt;/span&gt;Do not bypass the defined service boundaries.

&lt;span class="gu"&gt;## Acceptance criteria
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;[ ] The report is generated for all eligible orders.
&lt;span class="k"&gt;- &lt;/span&gt;[ ] The job can be restarted after a failure.
&lt;span class="k"&gt;- &lt;/span&gt;[ ] A failed run is recorded.
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Unit tests cover the new code.
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Integration tests cover the end-to-end flow.

&lt;span class="gu"&gt;## Out of scope
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;File transport
&lt;span class="k"&gt;- &lt;/span&gt;Customer notification

&lt;span class="gu"&gt;## References
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;../TESTING_GUIDE.md
&lt;span class="k"&gt;- &lt;/span&gt;../specs/report-generation/design.md

&lt;span class="gu"&gt;## Implementation notes
&lt;/span&gt;Filled in by the delegate at handback.
&lt;span class="k"&gt;- &lt;/span&gt;Changed:
&lt;span class="k"&gt;- &lt;/span&gt;Decisions:
&lt;span class="k"&gt;- &lt;/span&gt;Open questions:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few sections pull more weight than they look like they should:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Out of scope&lt;/strong&gt; keeps Copilot from wandering. Without it, "generate the report" can easily turn into "generate and email the report".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;References&lt;/strong&gt; point at real files. The design doc for TASK-042 already describes the &lt;code&gt;report_run&lt;/code&gt; table and the restart rule (skip a completed run with the same configuration and period), so the task doesn't repeat it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implementation notes&lt;/strong&gt; is empty on purpose. The delegate fills it in at handback (more on that below).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: the definition of ready
&lt;/h2&gt;

&lt;p&gt;Copilot burns credits fastest when it has to guess. The reviewer approves a task only when every box is ticked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="k"&gt;- &lt;/span&gt;[ ] The objective fits in one or two sentences.
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Each expected behavior is a concrete step, not a wish.
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Each acceptance criterion can be checked by a test or a visible result.
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Out of scope is listed.
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Every referenced doc exists and is current.
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Input and output examples are included where the format matters.
&lt;span class="k"&gt;- &lt;/span&gt;[ ] No secrets, credentials or production data.
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Small enough for one session (a PR one person can review in under an hour).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last item is the easiest one to skip. If the task won't fit in one reviewable PR, split it into TASK-043 and TASK-044 before anyone starts.&lt;/p&gt;

&lt;p&gt;Not everything is worth delegating, either. Every delegated task pays for a spec, a review, a handoff and a validation. That overhead pays off for new endpoints, services or jobs with a clear spec, test suites for existing code, mechanical refactors across many files, and boilerplate like DTOs, mappers and migrations. Keep one-line fixes, exploratory design work and live incidents with the owner.&lt;/p&gt;

&lt;p&gt;If you want help with the review, a custom agent can run the checklist. A minimal &lt;code&gt;.github/agents/ready-check.agent.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;---
name: ready-check
description: Checks a TASK-NNN.md file against the definition of ready before credits are spent.
---
You review task files in docs/backlog/. Do not edit code.
For the given task, check each item of the definition of ready in
docs/spec/PRD-copilot-capacity-sharing.md section 8.
Report each item as PASS or FAIL with one line of reasoning,
then list the questions the owner must answer before approval.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;description&lt;/code&gt; is the only required frontmatter field for a custom agent. The human reviewer still makes the call; the agent just catches the obvious gaps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: repository instructions
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;.github/copilot-instructions.md&lt;/code&gt; holds the conventions every request should know about, so no delegate has to re-explain them in chat:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;# Copilot instructions
&lt;/span&gt;
&lt;span class="gu"&gt;## Stack
&lt;/span&gt;Java 25, Spring Boot, Maven, PostgreSQL. Kafka only where a task says so.

&lt;span class="gu"&gt;## Read before changing code
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;docs/ARCHITECTURE.md: service boundaries and layering (api -&amp;gt; service -&amp;gt; repository/client)
&lt;span class="k"&gt;- &lt;/span&gt;docs/CODING_GUIDE.md: records for DTOs, constructor injection, 120-char lines
&lt;span class="k"&gt;- &lt;/span&gt;docs/TESTING_GUIDE.md: JUnit 5 + Mockito, Testcontainers for integration tests

&lt;span class="gu"&gt;## Rules
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;A layer never calls the layer above it. No business logic in controllers.
&lt;span class="k"&gt;- &lt;/span&gt;Schema changes go through versioned migrations, never manual DDL.
&lt;span class="k"&gt;- &lt;/span&gt;No hardcoded secrets or environment-specific values.
&lt;span class="k"&gt;- &lt;/span&gt;Every acceptance criterion in a task maps to at least one test.
&lt;span class="k"&gt;- &lt;/span&gt;When working from docs/backlog/TASK-*.md, stay inside its "Out of scope" limits.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep it short. It rides along with every request in the repo, so each line you add is context you pay for again and again. Rules that only matter for tests or migrations go into a path-specific file with an &lt;code&gt;applyTo&lt;/code&gt; glob:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;---
applyTo: "src/test/**"
---
Use JUnit 5 and Mockito. Integration tests use a real PostgreSQL via Testcontainers.
Name tests after the behavior: shouldSkipCompletedRunForSamePeriod().
Never retry a flaky test until it passes; fix it or remove it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: the shared implement-task prompt
&lt;/h2&gt;

&lt;p&gt;This is the file that makes every delegate run tasks the same way. Save it as &lt;code&gt;.github/prompts/implement-task.prompt.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;---
description: Implement a TASK-NNN.md file from docs/backlog end to end
agent: agent
argument-hint: Path to the task file, e.g. docs/backlog/TASK-042-order-summary-report.md
---
You are implementing the task in ${input:task:docs/backlog/TASK-NNN-slug.md}.

1. Read the task file and every document listed under References.
   Read .github/copilot-instructions.md conventions as binding.
2. If Status is not "Approved", stop and say so.
3. Produce a short plan: files to create or change, tests per acceptance
   criterion. Wait for my confirmation before editing.
4. Implement the plan. Respect "Architecture constraints" and "Out of scope".
5. Run the full test suite (mvn verify). Fix failures until all tests pass.
   If you fail twice on the same error, stop and explain instead of retrying.
6. Fill in "Implementation notes" in the task file:
   &lt;span class="k"&gt;- &lt;/span&gt;Changed: files and what changed
   &lt;span class="k"&gt;- &lt;/span&gt;Decisions: choices not dictated by the task, with reasons
   &lt;span class="k"&gt;- &lt;/span&gt;Open questions: anything the owner must decide
7. Set Status to "In validation". Do not commit or open a PR.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The delegate types &lt;code&gt;/implement-task&lt;/code&gt; in Copilot Chat, passes the task path, and gets the same plan-first, test-gated run every time. Step 3 makes Copilot stop after the plan, because a wrong plan caught early costs one request while a wrong implementation costs many. Step 7 keeps the commit and the PR with the owner, who is still responsible for the change.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;${input:...}&lt;/code&gt; is the prompt-file syntax for asking the user for a value, and &lt;code&gt;agent: agent&lt;/code&gt; runs the prompt in agent mode so Copilot can edit files and run the build.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: the handback
&lt;/h2&gt;

&lt;p&gt;When the delegate is done, the task file explains what happened. A filled-in section might look like this (illustrative, not from a real run):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Implementation notes
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Changed: ReportJob, ReportRunRepository, V7__report_run.sql migration,
  ReportJobTest, ReportJobIT (Testcontainers).
&lt;span class="k"&gt;- &lt;/span&gt;Decisions: Restart check queries report_run by configuration and period
  in SQL, per CODING_GUIDE ("filter in SQL, not in Java").
&lt;span class="k"&gt;- &lt;/span&gt;Open questions: Should a run stuck in STARTED for more than a day count
  as failed? The design doc does not say.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then the owner validates: JUnit, functional or simulation tests, the affected screens. Small issues they fix themselves. Anything bigger means updating the task file (usually that open question becomes a new acceptance criterion) and sending it back for another iteration. When it's clean, the owner commits, links the task file in the PR, and CI/CD runs its usual gates.&lt;/p&gt;

&lt;p&gt;The task's &lt;code&gt;Status&lt;/code&gt; line tracks all of this, and only one state spends credits:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkyrqomnek6rsux1pec69.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkyrqomnek6rsux1pec69.png" alt="Task status lifecycle: Draft, Approved, In progress, In validation, Done, with send-back and iteration loops" width="800" height="48"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last step: anything worth keeping from the implementation notes (a decision, a gotcha) moves into &lt;code&gt;/docs&lt;/code&gt;. If it only exists in a Copilot conversation, the next delegate won't see it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making the delegate's credits last
&lt;/h2&gt;

&lt;p&gt;For background: GitHub &lt;a href="https://github.blog/news-insights/company-news/github-copilot-is-moving-to-usage-based-billing/" rel="noopener noreferrer"&gt;announced that Copilot plans move to usage-based billing from June 1, 2026&lt;/a&gt;, with a monthly allotment of GitHub AI Credits consumed by tokens at each model's listed rate. Code completions don't draw on credits. Agent work does. That's why session hygiene matters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One task per session, started fresh. Long sessions drag old context into every new request.&lt;/li&gt;
&lt;li&gt;Reference files, don't paste them. Use &lt;code&gt;#file&lt;/code&gt; or Markdown links in the prompt instead of copying code into chat.&lt;/li&gt;
&lt;li&gt;Plan before editing. The &lt;code&gt;implement-task&lt;/code&gt; prompt enforces this.&lt;/li&gt;
&lt;li&gt;Use a cheaper model for routine steps (boilerplate, renames, simple tests) and a stronger one only for the hard parts. Model rates change, so check the current pricing in GitHub's docs rather than trusting a number in a blog post, including this one.&lt;/li&gt;
&lt;li&gt;When Copilot loops, stop and fix the task. Retrying the same prompt over and over is an expensive way to find out the spec was ambiguous.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same habits help owners stretch their own small allowance.&lt;/p&gt;

&lt;h2&gt;
  
  
  The cloud agent route
&lt;/h2&gt;

&lt;p&gt;Instead of working in the IDE, a delegate can assign the task's GitHub issue to the Copilot cloud agent, which works in the background and opens a draft PR. The owner then validates that draft PR exactly like a local handback. Two things to know before you do this. Per GitHub's docs, cloud agent sessions also use GitHub Actions minutes, shared with the rest of the account's workflows. And which allowance the AI usage counts against depends on how your organization bills Copilot, so check your billing setup before you count on it landing on the delegate's credits and not the owner's.&lt;/p&gt;

&lt;h2&gt;
  
  
  Public tools worth installing
&lt;/h2&gt;

&lt;p&gt;All public, all installed in the repo so every delegate gets the same setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/github/spec-kit" rel="noopener noreferrer"&gt;GitHub Spec Kit&lt;/a&gt;. The owner can draft the spec and plan with it before turning them into a task file (mapping above).&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/github/awesome-copilot" rel="noopener noreferrer"&gt;awesome-copilot&lt;/a&gt;. Community instructions, prompts, custom agents and skills, including Java, Spring Boot and JUnit ones. Copy what fits rather than writing from scratch.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/anthropics/skills" rel="noopener noreferrer"&gt;anthropics/skills&lt;/a&gt; and &lt;a href="https://github.com/addyosmani/agent-skills" rel="noopener noreferrer"&gt;addyosmani/agent-skills&lt;/a&gt;. Skills in the open Agent Skills format (spec-driven development, TDD, code review). Drop them into &lt;code&gt;.github/skills/&amp;lt;name&amp;gt;/SKILL.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/github/github-mcp-server" rel="noopener noreferrer"&gt;GitHub MCP server&lt;/a&gt;. Lets Copilot read the task's issue, linked PRs and CI results.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/upstash/context7" rel="noopener noreferrer"&gt;Context7&lt;/a&gt;. Current library docs, so Copilot doesn't write against an outdated Spring Boot API.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/microsoft/playwright-mcp" rel="noopener noreferrer"&gt;Playwright MCP&lt;/a&gt;. Drives the UI to check screens, which helps the delegate before handback and the owner during validation.&lt;/li&gt;
&lt;li&gt;Copilot code review, for an automated first pass on the PR before the human review.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Things that will trip you up
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Secrets in task files.&lt;/strong&gt; A task file is committed and read by people and models. Use synthetic examples, never production data or credentials. The definition of ready has a checkbox for this; don't skip it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stale references.&lt;/strong&gt; If &lt;code&gt;design.md&lt;/code&gt; describes last quarter's schema, Copilot will happily implement last quarter's schema. That is why "every referenced doc exists and is current" sits in the checklist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Too many iterations.&lt;/strong&gt; If a task needs more than two round trips, it usually wasn't ready. Look at the template and the review before blaming the delegate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Company policy.&lt;/strong&gt; Use Copilot inside your organization's approved AI settings (public code filtering, content exclusions). This process doesn't grant anyone access they didn't already have, and it shouldn't be used to route around policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The owner writes &lt;code&gt;TASK-NNN.md&lt;/code&gt;, a reviewer approves it against the definition of ready, and only then does a delegate spend credits.&lt;/li&gt;
&lt;li&gt;A shared &lt;code&gt;implement-task.prompt.md&lt;/code&gt; and &lt;code&gt;.github/copilot-instructions.md&lt;/code&gt; mean every delegate runs a task the same way.&lt;/li&gt;
&lt;li&gt;The delegate hands back passing tests plus filled-in implementation notes. The owner validates, commits and opens the PR.&lt;/li&gt;
&lt;li&gt;No tokens, accounts or licenses move between people. Only the task file does.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it yourself
&lt;/h2&gt;

&lt;p&gt;Clone &lt;a href="https://github.com/wallaceespindola/share-tokens-using-spec-driven-dev" rel="noopener noreferrer"&gt;the repo&lt;/a&gt;, copy &lt;code&gt;docs/backlog/TASK-042-order-summary-report.md&lt;/code&gt; as your template, add the prompt file and instructions above to &lt;code&gt;.github/&lt;/code&gt;, and run one small task through the loop with a teammate. The full process, including what to measure per sprint (tasks merged, iterations per task, queue length), is in &lt;code&gt;docs/spec/PRD-copilot-capacity-sharing.md&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;How does your team handle uneven Copilot capacity today? Chat messages, pairing, or something more structured? I'd like to hear in the comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples repository:&lt;/strong&gt; every example in this article (the PRD, the TASK-042 task spec, the team guides, the Copilot instructions, the prompt file and the diagrams) is in &lt;a href="https://github.com/wallaceespindola/share-tokens-using-spec-driven-dev" rel="noopener noreferrer"&gt;https://github.com/wallaceespindola/share-tokens-using-spec-driven-dev&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Need more tech insights?&lt;br&gt;
Check out my GitHub, LinkedIn, and Speaker Deck.&lt;br&gt;
Happy coding!&lt;/p&gt;

&lt;p&gt;Wallace Espindola, Solution Architect&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/wallaceespindola/" rel="noopener noreferrer"&gt;https://github.com/wallaceespindola/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;LinkedIn: &lt;a href="https://www.linkedin.com/in/wallaceespindola/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/wallaceespindola/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Speaker Deck: &lt;a href="https://speakerdeck.com/wallacese" rel="noopener noreferrer"&gt;https://speakerdeck.com/wallacese&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>githubcopilot</category>
      <category>ai</category>
      <category>productivity</category>
      <category>git</category>
    </item>
    <item>
      <title>Stop Rewriting Legacy Systems: Use AI to Understand Them First</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Mon, 31 Aug 2026 22:21:53 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/stop-rewriting-legacy-systems-use-ai-to-understand-them-first-21ba</link>
      <guid>https://dev.to/wallaceespindola/stop-rewriting-legacy-systems-use-ai-to-understand-them-first-21ba</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; AI should not help us rewrite legacy systems faster, it should help us understand them better, modernize them safely, and design stronger architectures for the future.&lt;/p&gt;

&lt;p&gt;When developers hear &lt;strong&gt;legacy modernization&lt;/strong&gt;, the conversation often jumps immediately to technology:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which framework should replace the old one?&lt;/li&gt;
&lt;li&gt;Should we move to microservices?&lt;/li&gt;
&lt;li&gt;Should we migrate everything to the cloud?&lt;/li&gt;
&lt;li&gt;Can AI convert the codebase for us?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I think that starts the discussion too late.&lt;/p&gt;

&lt;p&gt;Before rewriting anything, we should understand what the legacy system actually does.&lt;/p&gt;




&lt;h2&gt;
  
  
  Legacy code contains business knowledge
&lt;/h2&gt;

&lt;p&gt;A 15 or 20 year-old application contains more than outdated syntax.&lt;/p&gt;

&lt;p&gt;It may contain business rules that were never documented, edge cases discovered through years of production incidents, integration behavior other applications depend on and workarounds nobody remembers introducing.&lt;/p&gt;

&lt;p&gt;Deleting that code without understanding it can mean deleting business knowledge.&lt;/p&gt;

&lt;p&gt;AI makes this discovery process much easier.&lt;/p&gt;

&lt;p&gt;It can help:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explain unfamiliar code&lt;/li&gt;
&lt;li&gt;Trace dependencies&lt;/li&gt;
&lt;li&gt;Identify duplicated business rules&lt;/li&gt;
&lt;li&gt;Analyze database access&lt;/li&gt;
&lt;li&gt;Document integrations&lt;/li&gt;
&lt;li&gt;Find potentially unused components&lt;/li&gt;
&lt;li&gt;Generate tests around current behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first deliverable of modernization should therefore not necessarily be new code.&lt;/p&gt;

&lt;p&gt;It should be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A map of the existing system.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code conversion is not modernization
&lt;/h2&gt;

&lt;p&gt;Suppose AI converts an old application into a new language successfully.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Compilation passes.&lt;/li&gt;
&lt;li&gt;Tests pass.&lt;/li&gt;
&lt;li&gt;The application runs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have we modernized it? Maybe not.&lt;/p&gt;

&lt;p&gt;If we preserved the same tight coupling, shared database, unclear domain boundaries and problematic dependencies, we have simply moved technical debt into a newer stack.&lt;/p&gt;

&lt;p&gt;We created:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A modern implementation of an outdated architecture.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The problem is not whether AI can generate the replacement code.&lt;/p&gt;

&lt;p&gt;Increasingly, it can.&lt;/p&gt;

&lt;p&gt;The difficult question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What architecture should that code implement?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Find business boundaries first
&lt;/h2&gt;

&lt;p&gt;Legacy modules frequently represent historical technical boundaries rather than real business boundaries.&lt;/p&gt;

&lt;p&gt;Imagine a module named:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CustomerManagement&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Inside it we might discover:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Customer onboarding
- Customer identity
- Contracts
- Preferences
- Notifications
- Billing integration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These capabilities may not belong together in the future architecture.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Some may need independent scaling.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some may have stronger security requirements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some may change frequently while others remain stable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some may belong to completely different teams.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI can help discover these relationships by analyzing code, APIs (Application Programming Interfaces), databases and terminology.&lt;/p&gt;

&lt;p&gt;But it should support architectural discovery, not replace architectural judgment.&lt;/p&gt;




&lt;h2&gt;
  
  
  Migrate incrementally
&lt;/h2&gt;

&lt;p&gt;I am also skeptical of Big Bang rewrites.&lt;/p&gt;

&lt;p&gt;While the replacement is being built, the legacy application usually keeps changing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;New features arrive.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Regulations change.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bugs get fixed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Integrations evolve.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The new platform then spends months trying to catch a moving target.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A safer approach is usually incremental modernization.&lt;/p&gt;

&lt;p&gt;The Strangler Fig Pattern is one example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Legacy System
      ↓
Legacy + Modern Capabilities
      ↓
Mostly Modern + Remaining Legacy
      ↓
Modern Platform
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;New functionality gradually surrounds and replaces the old implementation.&lt;/p&gt;

&lt;p&gt;Instead of one huge migration event, modernization becomes a sequence of smaller architectural decisions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Use tests as the contract
&lt;/h2&gt;

&lt;p&gt;AI can be particularly valuable here.&lt;/p&gt;

&lt;p&gt;Before replacing a component, generate characterization tests around existing behavior.&lt;/p&gt;

&lt;p&gt;Then compare the new implementation against those tests.&lt;/p&gt;

&lt;p&gt;A simplified workflow becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Existing behavior
      ↓
Automated tests
      ↓
Modern implementation
      ↓
Behavior comparison
      ↓
Migration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For critical workloads, go further.&lt;/p&gt;

&lt;p&gt;Use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shadow traffic&lt;/li&gt;
&lt;li&gt;Feature flags&lt;/li&gt;
&lt;li&gt;Parallel execution&lt;/li&gt;
&lt;li&gt;Output comparison&lt;/li&gt;
&lt;li&gt;Controlled rollouts&lt;/li&gt;
&lt;li&gt;Observability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The objective is evidence, not confidence.&lt;/p&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“The rewrite looks correct.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;we want:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“The modern implementation has been validated against real legacy behavior.”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Don't default to microservices
&lt;/h2&gt;

&lt;p&gt;Another modernization trap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Legacy Monolith → Microservices → Success
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Distributed systems introduce their own complexity: networking, observability, data consistency, deployment coordination and operational overhead.&lt;/p&gt;

&lt;p&gt;A modular monolith may be a much better modernization target for many applications.&lt;/p&gt;

&lt;p&gt;Extract a service when you actually need independent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ownership&lt;/li&gt;
&lt;li&gt;Scaling&lt;/li&gt;
&lt;li&gt;Deployment&lt;/li&gt;
&lt;li&gt;Reliability&lt;/li&gt;
&lt;li&gt;Lifecycle&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not because the word &lt;em&gt;microservice&lt;/em&gt; appears on the target architecture diagram.&lt;/p&gt;




&lt;h2&gt;
  
  
  Data is usually the hard part
&lt;/h2&gt;

&lt;p&gt;Application code can be replaced relatively quickly.&lt;/p&gt;

&lt;p&gt;Data cannot.&lt;/p&gt;

&lt;p&gt;A legacy database may simultaneously support applications, reports, integrations and historical processes.&lt;/p&gt;

&lt;p&gt;Modernization therefore requires explicit decisions about:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who owns the data?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the source of truth?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do we migrate or synchronize?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can old and new applications write simultaneously?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do we validate migrated records?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI can help analyze schemas and generate migration logic.&lt;/p&gt;

&lt;p&gt;It cannot make unclear data ownership disappear.&lt;/p&gt;




&lt;h2&gt;
  
  
  The real opportunity
&lt;/h2&gt;

&lt;p&gt;AI changes the economics of modernization.&lt;/p&gt;

&lt;p&gt;Understanding code becomes cheaper.&lt;/p&gt;

&lt;p&gt;Generating documentation becomes cheaper.&lt;/p&gt;

&lt;p&gt;Creating tests becomes faster.&lt;/p&gt;

&lt;p&gt;Repetitive transformation work becomes faster.&lt;/p&gt;

&lt;p&gt;That allows engineers to spend more time on what matters:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;architecture, business understanding, validation, security and system design.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So I don't think the future of legacy modernization is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Old Code → AI → New Code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I think it is closer to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Legacy Knowledge
      ↓
AI-Assisted Understanding
      ↓
Architecture Decisions
      ↓
Incremental Transformation
      ↓
Modern Platform
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AI should not help us reproduce the past faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It should help us understand the past well enough to design something better.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;p&gt;If you're interested in exploring legacy modernization, incremental architecture and AI-assisted software engineering further, these are excellent resources:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://martinfowler.com/articles/2024-strangler-fig-rewrite.html" rel="noopener noreferrer"&gt;Martin Fowler - Strangler Fig Application / Rewriting Strangler Fig&lt;/a&gt;: A foundational perspective on gradually replacing legacy systems instead of relying on risky Big Bang rewrites.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/strangler-fig.html" rel="noopener noreferrer"&gt;AWS (Amazon Web Services) Prescriptive Guidance - Strangler Fig Pattern&lt;/a&gt;: Practical architectural guidance for incrementally decomposing and modernizing legacy applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/app-modernization-guidance/" rel="noopener noreferrer"&gt;Microsoft Learn - Application Modernization Guidance for Azure&lt;/a&gt;: A comprehensive modernization framework covering assessment, planning, modernization strategies, cloud adoption and AI opportunities.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/app-modernization-guidance/plan/the-6-rs-of-application-modernization" rel="noopener noreferrer"&gt;Microsoft Learn - The 6 Rs of Application Modernization&lt;/a&gt;: A useful decision framework covering Rehost, Replatform, Refactor, Rebuild, Retire and Retain.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.github.com/en/copilot/tutorials/modernize-legacy-code" rel="noopener noreferrer"&gt;GitHub Documentation - Modernizing Legacy Code with GitHub Copilot&lt;/a&gt;: A practical example of using AI to understand legacy code, map data flows, generate tests and progressively modernize an application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.ibm.com/think/topics/generative-ai-for-application-modernization" rel="noopener noreferrer"&gt;IBM - Generative AI for Application Modernization&lt;/a&gt;: An overview of how Generative AI can accelerate application assessment, transformation and modernization programs.&lt;/p&gt;




&lt;h2&gt;
  
  
  About the&amp;nbsp;Author
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Wallace Espindola&lt;/strong&gt; is a Senior Software Engineer | Solution Architect | AI &amp;amp; Cloud Enthusiast. Passionate about tech.&lt;/p&gt;

&lt;p&gt;💼 &lt;a href="https://www.linkedin.com/in/wallaceespindola" rel="noopener noreferrer"&gt;Wallace's LinkedIn&lt;/a&gt;&lt;br&gt;
💻 &lt;a href="https://github.com/wallaceespindola" rel="noopener noreferrer"&gt;Wallace's GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>legacy</category>
      <category>modernization</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Markdown: The New Programming Language? Exploring Spec-Driven Development in the AI Era</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Thu, 02 Jul 2026 23:17:42 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/markdown-the-new-programming-language-exploring-spec-driven-development-in-the-ai-era-2na2</link>
      <guid>https://dev.to/wallaceespindola/markdown-the-new-programming-language-exploring-spec-driven-development-in-the-ai-era-2na2</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;What if the most important file in your next software project isn't a &lt;code&gt;.java&lt;/code&gt;, &lt;code&gt;.ts&lt;/code&gt;, or &lt;code&gt;.py&lt;/code&gt; file—but a &lt;code&gt;.md&lt;/code&gt; file?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The rise of AI coding assistants has changed how many of us write software.&lt;/p&gt;

&lt;p&gt;Instead of manually implementing every class, endpoint, or component, we're increasingly describing &lt;strong&gt;what&lt;/strong&gt; we want and letting AI generate &lt;strong&gt;how&lt;/strong&gt; it's built.&lt;/p&gt;

&lt;p&gt;This raises an interesting question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;If AI writes the code, what becomes the primary artifact of software engineering?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I believe the answer is &lt;strong&gt;the specification&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;More specifically, I think we're moving toward a world where structured Markdown specifications become the interface between humans and AI, while source code becomes an implementation artifact.&lt;/p&gt;

&lt;p&gt;This idea is commonly referred to as &lt;strong&gt;Spec-Driven Development (SDD)&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem With Today's AI Development
&lt;/h2&gt;

&lt;p&gt;Most developers have experienced something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You:
Build me a user authentication system.

AI:
...generates code...

You:
Actually, I wanted JWT.

AI:
...rewrites...

You:
It also needs OAuth.

AI:
...rewrites...

You:
And multi-tenancy...

AI:
...rewrites again...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The AI isn't failing.&lt;/p&gt;

&lt;p&gt;It's guessing.&lt;/p&gt;

&lt;p&gt;Every new prompt adds context that should have existed from the beginning.&lt;/p&gt;

&lt;p&gt;This is often called &lt;em&gt;vibe coding&lt;/em&gt;—iteratively steering an AI toward the desired result through conversation.&lt;/p&gt;

&lt;p&gt;It works surprisingly well for prototypes.&lt;/p&gt;

&lt;p&gt;It doesn't scale well for complex systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  Enter Spec-Driven Development
&lt;/h2&gt;

&lt;p&gt;Instead of conversations becoming the source of truth, the specification becomes the source of truth.&lt;/p&gt;

&lt;p&gt;Rather than repeatedly telling the AI what you meant, you define the system once.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Idea
  ↓
Specification
  ↓
Architecture
  ↓
Implementation Plan
  ↓
Tasks
  ↓
Tests
  ↓
Code
  ↓
Validation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every AI agent now works from the same shared understanding.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Markdown?
&lt;/h2&gt;

&lt;p&gt;Markdown is surprisingly powerful.&lt;/p&gt;

&lt;p&gt;It is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;readable by humans&lt;/li&gt;
&lt;li&gt;version-controlled&lt;/li&gt;
&lt;li&gt;diff-friendly&lt;/li&gt;
&lt;li&gt;simple enough for product teams&lt;/li&gt;
&lt;li&gt;structured enough for AI agents&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A project could look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;specs/
├── constitution.md
├── product-spec.md
├── domain-model.md
├── api-spec.md
├── security.md
├── ux-spec.md
├── acceptance-tests.md
├── implementation-plan.md
└── tasks.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Or maybe just one PRD.md -- Product Requirements Document -- is enough for you.)&lt;/p&gt;

&lt;p&gt;None of these files execute.&lt;/p&gt;

&lt;p&gt;Yet together they describe almost everything needed to build the software.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Specification Becomes the Control Plane
&lt;/h2&gt;

&lt;p&gt;Instead of writing prompts like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Create a billing API."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You define:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;business objectives&lt;/li&gt;
&lt;li&gt;user roles&lt;/li&gt;
&lt;li&gt;domain entities&lt;/li&gt;
&lt;li&gt;API contracts&lt;/li&gt;
&lt;li&gt;validation rules&lt;/li&gt;
&lt;li&gt;security requirements&lt;/li&gt;
&lt;li&gt;performance targets&lt;/li&gt;
&lt;li&gt;acceptance criteria&lt;/li&gt;
&lt;li&gt;edge cases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The AI now has context before writing a single line of code.&lt;/p&gt;

&lt;p&gt;Less guessing.&lt;/p&gt;

&lt;p&gt;More engineering.&lt;/p&gt;




&lt;h2&gt;
  
  
  AI Agents Become Specialists
&lt;/h2&gt;

&lt;p&gt;One aspect of SDD that excites me is how naturally it supports multiple AI agents working together.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                 Specification
                        │
        ┌───────────────┼───────────────┐
        │               │               │
        ▼               ▼               ▼
   Planner Agent   Coding Agent   Test Agent
        │               │               │
        └───────────────┼───────────────┘
                        ▼
                Human Review
                        │
                        ▼
             Updated Specification
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of one giant conversation with a single assistant, each agent has a focused responsibility.&lt;/p&gt;

&lt;p&gt;The specification becomes the shared contract between them.&lt;/p&gt;




&lt;h2&gt;
  
  
  This Changes the Role of Software Engineers
&lt;/h2&gt;

&lt;p&gt;Some people worry AI will replace software engineers.&lt;/p&gt;

&lt;p&gt;I think it's changing what we optimize for.&lt;/p&gt;

&lt;p&gt;The most valuable engineers may become those who excel at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;system design&lt;/li&gt;
&lt;li&gt;architecture&lt;/li&gt;
&lt;li&gt;domain modeling&lt;/li&gt;
&lt;li&gt;product thinking&lt;/li&gt;
&lt;li&gt;writing precise specifications&lt;/li&gt;
&lt;li&gt;reviewing AI-generated implementations&lt;/li&gt;
&lt;li&gt;defining quality standards&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In other words:&lt;/p&gt;

&lt;p&gt;We spend less time telling computers &lt;em&gt;how&lt;/em&gt; to do something.&lt;/p&gt;

&lt;p&gt;We spend more time defining &lt;em&gt;what should exist&lt;/em&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  This Doesn't Replace Programming Languages
&lt;/h2&gt;

&lt;p&gt;Java isn't disappearing.&lt;/p&gt;

&lt;p&gt;Neither are Python, Go, Rust, TypeScript, or C#.&lt;/p&gt;

&lt;p&gt;Code still matters.&lt;/p&gt;

&lt;p&gt;Performance still matters.&lt;/p&gt;

&lt;p&gt;Architecture still matters.&lt;/p&gt;

&lt;p&gt;Human judgment still matters.&lt;/p&gt;

&lt;p&gt;The difference is that code may no longer be the highest-level artifact.&lt;/p&gt;

&lt;p&gt;Specifications may become the foundation from which everything else is derived.&lt;/p&gt;




&lt;h2&gt;
  
  
  Challenges
&lt;/h2&gt;

&lt;p&gt;Like every engineering approach, SDD has trade-offs.&lt;/p&gt;

&lt;p&gt;Good specifications take time to write.&lt;/p&gt;

&lt;p&gt;Bad specifications produce bad implementations.&lt;/p&gt;

&lt;p&gt;Not every project needs this level of rigor.&lt;/p&gt;

&lt;p&gt;And AI-generated code still requires review, testing, and validation.&lt;/p&gt;

&lt;p&gt;Spec-Driven Development isn't about removing engineers from the process.&lt;/p&gt;

&lt;p&gt;It's about giving AI enough context to become a better engineering partner.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I don't think Markdown is literally becoming a programming language.&lt;/p&gt;

&lt;p&gt;But I do think it's becoming something equally important:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;the language through which humans communicate software intent to AI.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That might sound like a subtle distinction.&lt;/p&gt;

&lt;p&gt;I don't think it is.&lt;/p&gt;

&lt;p&gt;It changes where engineering effort is invested, how teams collaborate, and what becomes the long-term source of truth in a codebase.&lt;/p&gt;

&lt;p&gt;As AI continues to improve, I expect we'll spend less time writing implementation and more time writing intent.&lt;/p&gt;

&lt;p&gt;And that intent will increasingly live in structured specifications.&lt;/p&gt;

&lt;p&gt;Perhaps the first file we'll create in a new project won't be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;java&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It might simply be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;product-spec.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Martin Fowler — &lt;em&gt;Exploring GenAI: Spec-Driven Development&lt;/em&gt;&lt;br&gt;
&lt;a href="https://martinfowler.com/articles/exploring-gen-ai/sdd-3-tools.html" rel="noopener noreferrer"&gt;https://martinfowler.com/articles/exploring-gen-ai/sdd-3-tools.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GitHub Spec Kit&lt;br&gt;
&lt;a href="https://github.com/github/spec-kit" rel="noopener noreferrer"&gt;https://github.com/github/spec-kit&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Spec Kit Documentation&lt;br&gt;
&lt;a href="https://github.com/github/spec-kit/blob/main/spec-driven.md" rel="noopener noreferrer"&gt;https://github.com/github/spec-kit/blob/main/spec-driven.md&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Kiro Documentation&lt;br&gt;
&lt;a href="https://kiro.dev/docs/specs/" rel="noopener noreferrer"&gt;https://kiro.dev/docs/specs/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Heeki Park — &lt;em&gt;Using Spec-Driven Development with Claude Code&lt;/em&gt;&lt;br&gt;
&lt;a href="https://medium.com/@heekipark" rel="noopener noreferrer"&gt;https://medium.com/@heekipark&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CJ Roth — &lt;em&gt;Building an Elite Engineering Culture&lt;/em&gt;&lt;br&gt;
&lt;a href="https://www.cjroth.com/blog/2026-02-18-building-an-elite-engineering-culture" rel="noopener noreferrer"&gt;https://www.cjroth.com/blog/2026-02-18-building-an-elite-engineering-culture&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What do you think?
&lt;/h2&gt;

&lt;p&gt;Are we moving toward &lt;strong&gt;spec-first engineering&lt;/strong&gt;, or do you think code will always remain the primary source of truth?&lt;/p&gt;

&lt;p&gt;I'd love to hear how you're using AI in your development workflow.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;About the author&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wallace Espindola&lt;/strong&gt;&lt;br&gt;
Senior Software Engineer | Solution Architect | AI Enthusiast&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;💼 LinkedIn: &lt;a href="https://www.linkedin.com/in/wallaceespindola/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/wallaceespindola/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💻 GitHub: &lt;a href="https://github.com/wallaceespindola" rel="noopener noreferrer"&gt;https://github.com/wallaceespindola&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🌐 Website: &lt;a href="https://wtechitsolutions.com" rel="noopener noreferrer"&gt;https://wtechitsolutions.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>reviews</category>
      <category>markdown</category>
    </item>
    <item>
      <title>What Being at JCON Europe Teaches Me (Beyond the Talks)</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Tue, 21 Apr 2026 16:17:26 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/what-being-at-jcon-europe-teaches-me-beyond-the-talks-3hh1</link>
      <guid>https://dev.to/wallaceespindola/what-being-at-jcon-europe-teaches-me-beyond-the-talks-3hh1</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwuz9cn8bu1isvqyzec7.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwuz9cn8bu1isvqyzec7.jpeg" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m writing this from JCON Europe 2026, in Cologne, Germany, right in the middle of one of those rare environments where everything revolves around building better software.&lt;/p&gt;

&lt;p&gt;You know that feeling when you step into a place and instantly realize: this is where things are happening?&lt;/p&gt;

&lt;p&gt;That’s exactly what a good tech conference feels like.&lt;/p&gt;

&lt;p&gt;But here’s the interesting part — the real value of being here isn’t just the presentations. It’s something deeper, more subtle, and way more impactful than just “watching talks.”&lt;/p&gt;

&lt;p&gt;Let me walk you through what I’ve been experiencing, in a way that might change how you look at conferences altogether.&lt;/p&gt;




&lt;p&gt;The Illusion: “It’s Just About the Talks”&lt;/p&gt;

&lt;p&gt;Before coming here, it’s easy to think:&lt;/p&gt;

&lt;p&gt;“I can just watch this later on YouTube.”&lt;/p&gt;

&lt;p&gt;And technically… you’re right.&lt;/p&gt;

&lt;p&gt;Most talks will eventually be available online. Slides get shared. Code snippets show up on GitHub.&lt;/p&gt;

&lt;p&gt;But if that’s all you think a conference is, you’re missing about 80% of the value.&lt;/p&gt;

&lt;p&gt;Because the real advantage is not passive consumption.&lt;/p&gt;

&lt;p&gt;It’s immersion.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Learning at a Different Speed
&lt;/h2&gt;

&lt;p&gt;At home, learning is fragmented.&lt;/p&gt;

&lt;p&gt;You open a tab. Then another. Then Slack pings. Then a meeting. Then context switching kills your focus.&lt;/p&gt;

&lt;p&gt;Here, it’s different.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You’re surrounded by people who care about the same things&lt;/li&gt;
&lt;li&gt;Talks are curated — no random noise&lt;/li&gt;
&lt;li&gt;Topics are current and relevant&lt;/li&gt;
&lt;li&gt;Your brain stays in “engineering mode” all day&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s like your learning bandwidth suddenly increases.&lt;/p&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;p&gt;“Let me research this when I have time…”&lt;/p&gt;

&lt;p&gt;It becomes:&lt;/p&gt;

&lt;p&gt;“I just saw 3 different approaches to this problem in the last 4 hours.”&lt;/p&gt;

&lt;p&gt;That density is hard to replicate anywhere else.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Conversations &amp;gt; Presentations
&lt;/h2&gt;

&lt;p&gt;The talks are great. No doubt.&lt;/p&gt;

&lt;p&gt;But the real gold often happens after the talk.&lt;/p&gt;

&lt;p&gt;You walk up to the speaker and say:&lt;/p&gt;

&lt;p&gt;“Hey, in your example, how would that work with X?”&lt;/p&gt;

&lt;p&gt;And suddenly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You get a tailored answer to your real-world problem&lt;/li&gt;
&lt;li&gt;The discussion goes deeper than the presentation&lt;/li&gt;
&lt;li&gt;You understand the trade-offs, not just the solution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even better — sometimes you end up talking to someone who says:&lt;/p&gt;

&lt;p&gt;“We tried that in production. Didn’t work. Here’s why.”&lt;/p&gt;

&lt;p&gt;That kind of insight is priceless.&lt;/p&gt;

&lt;p&gt;No blog post gives you that.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. You Realize You’re Not Alone
&lt;/h2&gt;

&lt;p&gt;As a backend engineer or architect, you often deal with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;scaling issues&lt;/li&gt;
&lt;li&gt;messy legacy systems&lt;/li&gt;
&lt;li&gt;integration nightmares&lt;/li&gt;
&lt;li&gt;performance bottlenecks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And sometimes it feels like:&lt;/p&gt;

&lt;p&gt;“Is this just my problem?”&lt;/p&gt;

&lt;p&gt;Then you come here and realize:&lt;/p&gt;

&lt;p&gt;Everyone is dealing with similar challenges.&lt;/p&gt;

&lt;p&gt;Different stack, different company, same core problems.&lt;/p&gt;

&lt;p&gt;And suddenly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;your struggles feel normal&lt;/li&gt;
&lt;li&gt;your solutions feel validated&lt;/li&gt;
&lt;li&gt;your blind spots become visible&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is one of the most underrated benefits.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Instant Reality Check
&lt;/h2&gt;

&lt;p&gt;Conferences are like a mirror for your current level.&lt;/p&gt;

&lt;p&gt;You start comparing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How you structure your APIs vs others&lt;/li&gt;
&lt;li&gt;Your architecture vs what’s being presented&lt;/li&gt;
&lt;li&gt;Your tooling vs what people are actually using&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sometimes you feel ahead.&lt;/p&gt;

&lt;p&gt;Sometimes you realize:&lt;/p&gt;

&lt;p&gt;“Okay… I need to level up here.”&lt;/p&gt;

&lt;p&gt;And that’s a good thing.&lt;/p&gt;

&lt;p&gt;Because stagnation is the real danger in tech — not lack of knowledge.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Inspiration Hits Differently Here
&lt;/h2&gt;

&lt;p&gt;There’s something about being in a room full of engineers that changes your mindset.&lt;/p&gt;

&lt;p&gt;You see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;new ideas&lt;/li&gt;
&lt;li&gt;different approaches&lt;/li&gt;
&lt;li&gt;bold solutions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And your brain starts connecting dots:&lt;/p&gt;

&lt;p&gt;“Wait… I could apply this to my project.”&lt;br&gt;
“This would solve that problem I’ve been ignoring.”&lt;br&gt;
“This could become a product.”&lt;/p&gt;

&lt;p&gt;This is how side projects are born.&lt;/p&gt;

&lt;p&gt;This is how better systems get built.&lt;/p&gt;

&lt;p&gt;Not from tutorials — but from exposure.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. The Power of Unplanned Interactions
&lt;/h2&gt;

&lt;p&gt;You don’t plan the best conversations.&lt;/p&gt;

&lt;p&gt;They just happen.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the hallway&lt;/li&gt;
&lt;li&gt;During coffee breaks&lt;/li&gt;
&lt;li&gt;While waiting for the next session&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You start talking to someone, and suddenly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;they’ve solved a problem you’re facing&lt;/li&gt;
&lt;li&gt;they’re building something similar&lt;/li&gt;
&lt;li&gt;they know a tool you’ve never heard of&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These moments are random — but incredibly valuable.&lt;/p&gt;

&lt;p&gt;It’s like discovering hidden nodes in your professional network.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. You Start Thinking in Systems, Not Just Code
&lt;/h2&gt;

&lt;p&gt;A lot of talks here go beyond syntax and frameworks.&lt;/p&gt;

&lt;p&gt;They focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;architecture decisions&lt;/li&gt;
&lt;li&gt;trade-offs&lt;/li&gt;
&lt;li&gt;system design&lt;/li&gt;
&lt;li&gt;scalability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that shifts your perspective.&lt;/p&gt;

&lt;p&gt;You stop thinking:&lt;/p&gt;

&lt;p&gt;“How do I implement this?”&lt;/p&gt;

&lt;p&gt;And start thinking:&lt;/p&gt;

&lt;p&gt;“Is this the right approach at scale?”&lt;/p&gt;

&lt;p&gt;That transition — from coder to system thinker — is what separates mid-level from senior engineers.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. You Collect Ideas, Not Just Notes
&lt;/h2&gt;

&lt;p&gt;When you attend a talk, you don’t just write notes.&lt;/p&gt;

&lt;p&gt;You collect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;patterns&lt;/li&gt;
&lt;li&gt;tools&lt;/li&gt;
&lt;li&gt;mental models&lt;/li&gt;
&lt;li&gt;anti-patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the key is not to remember everything.&lt;/p&gt;

&lt;p&gt;It’s to leave with:&lt;/p&gt;

&lt;p&gt;“2 or 3 ideas I can actually apply.”&lt;/p&gt;

&lt;p&gt;That’s where the ROI is.&lt;/p&gt;

&lt;p&gt;Not in quantity — but in applicability.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. It Recharges Your Motivation
&lt;/h2&gt;

&lt;p&gt;Let’s be honest.&lt;/p&gt;

&lt;p&gt;Work can become repetitive.&lt;/p&gt;

&lt;p&gt;Same stack. Same problems. Same meetings.&lt;/p&gt;

&lt;p&gt;Being here breaks that cycle.&lt;/p&gt;

&lt;p&gt;You remember:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;why you enjoy building things&lt;/li&gt;
&lt;li&gt;how big the tech world actually is&lt;/li&gt;
&lt;li&gt;how much there is still to explore&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s like a mental reset.&lt;/p&gt;

&lt;p&gt;And sometimes, that’s exactly what you need.&lt;/p&gt;




&lt;h2&gt;
  
  
  10. You’re Not Just Learning — You’re Positioning Yourself
&lt;/h2&gt;

&lt;p&gt;There’s another layer to all this.&lt;/p&gt;

&lt;p&gt;By being here, you’re:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;staying close to the ecosystem&lt;/li&gt;
&lt;li&gt;understanding where things are going&lt;/li&gt;
&lt;li&gt;aligning with modern practices&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That matters.&lt;/p&gt;

&lt;p&gt;Because in tech, being slightly ahead is a huge advantage.&lt;/p&gt;

&lt;p&gt;Not years ahead — just enough to make better decisions earlier.&lt;/p&gt;




&lt;h2&gt;
  
  
  So… Is It Worth It?
&lt;/h2&gt;

&lt;p&gt;If you only look at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ticket price&lt;/li&gt;
&lt;li&gt;travel cost&lt;/li&gt;
&lt;li&gt;time away from work&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You might hesitate.&lt;/p&gt;

&lt;p&gt;But if you look at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one idea that improves your system&lt;/li&gt;
&lt;li&gt;one connection that leads to an opportunity&lt;/li&gt;
&lt;li&gt;one insight that saves you weeks of work&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then yes.&lt;/p&gt;

&lt;p&gt;It’s absolutely worth it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;The biggest realization I’ve had here is simple:&lt;/p&gt;

&lt;p&gt;Conferences are not about consuming content.&lt;br&gt;
They’re about accelerating your growth.&lt;/p&gt;

&lt;p&gt;You don’t come here just to learn.&lt;/p&gt;

&lt;p&gt;You come here to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;think better&lt;/li&gt;
&lt;li&gt;connect better&lt;/li&gt;
&lt;li&gt;build better&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that’s something no online resource can fully replace.&lt;/p&gt;




&lt;p&gt;If you’ve been on the fence about attending a conference like this…&lt;/p&gt;

&lt;p&gt;Take this as your sign.&lt;/p&gt;

&lt;p&gt;Go.&lt;/p&gt;

&lt;p&gt;Even once.&lt;/p&gt;

&lt;p&gt;It might change more than you expect.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Need more tech insights?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check out my &lt;a href="https://github.com/wallaceespindola" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/wallaceespindola/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, and &lt;a href="https://speakerdeck.com/wallacese" rel="noopener noreferrer"&gt;Speaker Deck&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Support my work: &lt;a href="//buymeacoffee.com/wallace.espindola"&gt;Buy Me A Coffee&lt;/a&gt; ☕&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>java</category>
      <category>techtalks</category>
      <category>developers</category>
      <category>learning</category>
    </item>
    <item>
      <title>Python Just Turned 35, Here's What Kept It Alive All These Years</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Fri, 20 Feb 2026 21:52:01 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/python-just-turned-35-heres-what-kept-it-alive-all-these-years-4jh9</link>
      <guid>https://dev.to/wallaceespindola/python-just-turned-35-heres-what-kept-it-alive-all-these-years-4jh9</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5ydco57fn4c3y6hjkif.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5ydco57fn4c3y6hjkif.png" alt=" " width="800" height="509"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Today is February 20, 2026. Exactly 35 years ago, Guido van Rossum released the first public version of Python, a language he'd been hacking on during the Christmas holidays as a side project. Let that sink in for a second. A side project from 1991 is now arguably the most popular programming language on the planet.&lt;/p&gt;

&lt;p&gt;I've been thinking about this milestone all week, and honestly, the more I dig into Python's story, the more impressed I get. Not because Python is perfect, it's definitely not, but because it kept finding ways to matter, decade after decade, even when the tech world shifted underneath it. That's rare. Languages come and go all the time. Most of them peak and fade within ten years. Python just... kept going.&lt;/p&gt;

&lt;p&gt;So let's talk about how a hobby project turned into the backbone of modern AI, web development, data science and pretty much everything in between.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Quick Trip Through Four Eras
&lt;/h2&gt;

&lt;p&gt;Python's 35-year history breaks down pretty neatly into four phases. Each one could've been the end of the road, but instead each one became a springboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 1: The Scripting Era (1991-2000)
&lt;/h3&gt;

&lt;p&gt;Back in the early '90s, Python was "a better scripting language." That was the pitch. If you were writing shell scripts or wrestling with C for quick automation tasks, Python gave you something cleaner and more readable. It showed up in universities and Unix shops, quietly building a reputation as the language that didn't make you hate your life when you read someone else's code six months later.&lt;/p&gt;

&lt;p&gt;Was it glamorous? Not even close. But it was useful, and people kept coming back to it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 2: The Web Era (2000-2010)
&lt;/h3&gt;

&lt;p&gt;Then the web happened, and suddenly everybody needed a way to build websites that wasn't PHP spaghetti code. Ruby had Rails and that was the cool kid on the block for a while, but Python answered with Django in 2005 and Flask in 2010.&lt;/p&gt;

&lt;p&gt;Django gave you the full kitchen, ORM, admin panel, authentication, the works. Flask gave you a knife and a cutting board and said "go build whatever you want." Between the two of them, Python carved out real territory in web development. It wasn't the dominant web language, but it was a serious contender, and startups loved it for getting things shipped fast.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 3: The Data Science Revolution (2010-2020)
&lt;/h3&gt;

&lt;p&gt;This is where things went nuclear. NumPy and SciPy had been around for a while, but when Pandas matured and Jupyter Notebooks made exploratory analysis actually pleasant, Python became the default language for anyone touching data. Then TensorFlow and PyTorch showed up, and suddenly Python wasn't just a data language, it was &lt;em&gt;the&lt;/em&gt; AI language.&lt;/p&gt;

&lt;p&gt;Researchers, data scientists and machine learning engineers all converged on Python. The network effects were enormous. If you wanted to do ML, you used Python. Period. The ecosystem was too deep, the community too large, the tooling too mature to ignore.&lt;/p&gt;

&lt;p&gt;Python's identity shifted from "solid web language" to "the language of data and AI." And that identity has only gotten stronger since.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 4: The Platform Era (2020-Present)
&lt;/h3&gt;

&lt;p&gt;Now we're in the era where Python is everywhere, and I mean &lt;em&gt;everywhere&lt;/em&gt;. FastAPI brought modern, async-first API development with automatic OpenAPI docs. Python runs DevOps pipelines, orchestrates cloud infrastructure, powers AI agents and serves as the glue language connecting systems across the entire stack.&lt;/p&gt;

&lt;p&gt;It's not just a language anymore, it's a universal integration platform. You can prototype an idea in the morning, deploy an API by lunch, hook it up to an AI model in the afternoon and automate the whole thing before dinner. That's the power of what Python has become.&lt;/p&gt;

&lt;h2&gt;
  
  
  So What Actually Kept Python Alive for 35 Years?
&lt;/h2&gt;

&lt;p&gt;Plenty of languages had momentum at some point. Perl was huge. Ruby was everywhere for a while. CoffeeScript had its moment. They all faded or shrank. Python didn't. Why?&lt;/p&gt;

&lt;h3&gt;
  
  
  Human-Centered Design
&lt;/h3&gt;

&lt;p&gt;This is the big one, and it goes back to Guido's original philosophy. Python optimized for the person reading the code, not the person writing it. That sounds like a small thing, but it's massive over time. Code is read far more often than it's written, and Python's insistence on readability meant that projects stayed maintainable longer, onboarding new developers was easier and collaboration just worked better.&lt;/p&gt;

&lt;p&gt;The famous "there should be one obvious way to do it" mantra meant less time arguing about style and more time building things.&lt;/p&gt;

&lt;h3&gt;
  
  
  Batteries Included
&lt;/h3&gt;

&lt;p&gt;Python's standard library was always surprisingly complete. Need to parse JSON? It's there. HTTP requests? There. CSV files, email, regex, unit testing, threading? All there. You could get a lot done before you ever needed to &lt;code&gt;pip install&lt;/code&gt; anything.&lt;/p&gt;

&lt;p&gt;This mattered enormously in the early days when package management was rough, and it still matters today when you just want to write a quick script without pulling in half the internet.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Ecosystem Flywheel
&lt;/h3&gt;

&lt;p&gt;Once Python hit critical mass in universities, the flywheel started spinning. Students learned Python, graduated, used Python at work, wrote libraries in Python, taught Python to the next generation. Researchers published papers with Python code. Startups built MVPs in Python. Every new library made the ecosystem richer, which attracted more developers, which produced more libraries.&lt;/p&gt;

&lt;p&gt;It's the classic network effect, and Python benefited from it more than almost any other language in history.&lt;/p&gt;

&lt;h3&gt;
  
  
  Low Barrier of Entry
&lt;/h3&gt;

&lt;p&gt;Python never stopped being approachable. You can teach a complete beginner to write meaningful Python code in a day. That constant influx of new developers kept the community fresh, energetic and growing. Languages that become too complex or too niche eventually stagnate. Python avoided that trap by always keeping the front door wide open.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adaptability
&lt;/h3&gt;

&lt;p&gt;This might be the most underrated factor. Python didn't fight paradigm shifts, it absorbed them. Web frameworks? Python adapted. Data science? Python adapted. Machine learning? Python adapted. Cloud-native microservices? Adapted again. Every time the industry moved, Python found a way to be relevant in the new landscape.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Strong Right Now
&lt;/h2&gt;

&lt;p&gt;Let's be honest about where Python genuinely excels today, because the list is impressive:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Developer productivity is unmatched.&lt;/strong&gt; For getting from idea to working code, nothing beats Python. The read-write-test cycle is incredibly fast, and the language stays out of your way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI and ML dominance is real.&lt;/strong&gt; PyTorch, TensorFlow, scikit-learn, Hugging Face, LangChain, the entire AI stack runs on Python. If you're doing anything with AI, you're writing Python or you're calling Python.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The ecosystem is massive.&lt;/strong&gt; PyPI has hundreds of thousands of packages. Whatever problem you're trying to solve, someone's probably already built a library for it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cross-domain reach.&lt;/strong&gt; Python is one of the very few languages where the same syntax works for web backends, data analysis, automation scripts, AI models and system administration. That versatility is genuinely rare.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prototyping speed.&lt;/strong&gt; When you need to validate an idea quickly, Python lets you move fast without accumulating too much technical debt in the prototype phase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Orchestration.&lt;/strong&gt; Python has become the default "glue language", the thing that ties together databases, APIs, AI models, cloud services and everything else. FastAPI made this even more compelling with its modern async approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Could Still Get Better
&lt;/h2&gt;

&lt;p&gt;I love Python, but I'm not going to pretend it's flawless. There are real pain points that the community has been wrestling with for years.&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance
&lt;/h3&gt;

&lt;p&gt;Let's get the elephant out of the room. Python is slow compared to compiled languages. It uses more memory and CPU time than Go, Rust, Java or C++. Yes, there's Cython, PyPy and the ongoing work on faster CPython. Yes, you can drop into C extensions for hot paths. But the baseline performance story is still a weakness, especially as workloads scale up.&lt;/p&gt;

&lt;p&gt;The good news is that the core team is actively working on this. The "Faster CPython" project has already delivered meaningful speedups in recent releases, and JIT compilation is on the roadmap. It won't match Rust anytime soon, but the gap is narrowing.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Packaging Mess
&lt;/h3&gt;

&lt;p&gt;Oh, the packaging. We've got pip, poetry, conda, pipenv, pdm, hatch and now uv. Each one has its fans, each one does things slightly differently, and none of them has emerged as the single obvious choice. Compare this to npm in JavaScript or cargo in Rust, where there's basically one answer, and you can see why this frustrates people.&lt;/p&gt;

&lt;p&gt;Yes, uv is making a strong case as the future here, it's fast, it's well-designed, and it's backed by the Astral team that gave us Ruff. But we're still in the "multiple competing standards" phase, and it creates real friction for teams and newcomers alike.&lt;/p&gt;

&lt;h3&gt;
  
  
  The GIL
&lt;/h3&gt;

&lt;p&gt;The Global Interpreter Lock has been Python's concurrency bottleneck for decades. It prevents true parallel execution of Python threads on multiple CPU cores. For I/O-bound work it doesn't matter much, but for CPU-intensive parallel processing it's a real limitation.&lt;/p&gt;

&lt;p&gt;The exciting development is PEP 703 and the experimental no-GIL builds. Python 3.13 shipped with an experimental free-threaded mode, and the community is cautiously optimistic. This could be a game-changer, but it'll take years for the ecosystem to fully adapt.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enterprise Governance
&lt;/h3&gt;

&lt;p&gt;Dynamic typing is great for speed but can be a headache at scale. Large Python codebases without disciplined use of type hints, linters and testing can become maintenance nightmares. Java and C# have built-in guardrails that Python relies on developers to self-impose.&lt;/p&gt;

&lt;p&gt;The gradual typing story with mypy, pyright and type hints has improved enormously, but it's still opt-in. In enterprise environments where dozens of teams touch the same codebase, that "opt-in" nature can be a real challenge.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Java Angle: Rivals or Partners?
&lt;/h2&gt;

&lt;p&gt;Java turned 30 last year. Python turns 35 today. And people still love asking "which one should I learn?" as if it's a zero-sum game. It's not.&lt;/p&gt;

&lt;p&gt;Here's the thing, Python and Java don't actually compete for the same jobs in most modern architectures. Java is the infrastructure backbone. It runs the banking systems, the telecom platforms, the enterprise middleware that needs to be rock-solid, handle massive concurrency and run for years without surprises. The JVM is a masterpiece of engineering, and Java's static typing and mature tooling make it ideal for large-scale systems where reliability matters more than development speed.&lt;/p&gt;

&lt;p&gt;Python is the intelligence layer. It runs the AI models, the data pipelines, the automation scripts and the rapid-prototype APIs. It's where experimentation happens, where new ideas get tested and where developers move fast.&lt;/p&gt;

&lt;p&gt;In practice, modern platforms often use both. Java handles the core transactional processing. Python handles the analytics, ML inference and orchestration. They complement each other beautifully, and arguing about which one is "better" misses the point entirely. They're optimized for different things, Java for systems, Python for humans.&lt;/p&gt;

&lt;p&gt;If you're early in your career, learn both. Seriously. Having Python and Java in your toolkit makes you valuable in almost any engineering organization.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Take on Python's Future
&lt;/h2&gt;

&lt;p&gt;I've been writing Python for years, alongside Java and a handful of other languages. Here's what I think the next decade looks like.&lt;/p&gt;

&lt;p&gt;Python isn't going anywhere. The AI wave alone guarantees its relevance for at least another ten years. But more than that, Python has demonstrated something powerful: the ability to reinvent itself without losing its soul. It's still readable, still approachable, still the language where you can teach a beginner in the morning and deploy production AI in the afternoon.&lt;/p&gt;

&lt;p&gt;The things that need fixing, performance, packaging, the GIL, are all actively being worked on. The community is engaged, the core team is focused and the commercial investment (from companies like Microsoft, Google and Meta) is substantial. Python's governance model, with its steering council and PEP process, has proven resilient and effective.&lt;/p&gt;

&lt;p&gt;My prediction? Python at 40 will be faster, better packaged, truly concurrent and even more deeply embedded in AI infrastructure. The language itself will probably look mostly the same, and that's the point. Python's superpower was never about being the most innovative syntax or the fastest runtime. It was about being the most &lt;em&gt;useful&lt;/em&gt; language for the most people, and that hasn't changed in 35 years.&lt;/p&gt;

&lt;p&gt;Happy birthday, Python. Here's to 35 more.&lt;/p&gt;




&lt;h2&gt;
  
  
  Let's Discuss
&lt;/h2&gt;

&lt;p&gt;I'd love to hear your perspective on Python's journey:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When did you first start using Python, and what was the first thing you built with it?&lt;/li&gt;
&lt;li&gt;What's your biggest frustration with Python today?&lt;/li&gt;
&lt;li&gt;Do you use Python alongside another language? How do they complement each other?&lt;/li&gt;
&lt;li&gt;Where do you think Python will be in 10 years?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Drop your thoughts in the comments. I'm genuinely curious what this community thinks.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by Wallace Espindola, Software Engineer and Python Enthusiast.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Connect with me:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.linkedin.com/in/wallaceespindola/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://github.com/wallaceespindola/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>softwaredevelopment</category>
      <category>programming</category>
      <category>development</category>
    </item>
    <item>
      <title>Contract-First Integration: A Practical Guide for Developers</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Tue, 10 Feb 2026 20:12:47 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/contract-first-integration-a-practical-guide-for-developers-49nf</link>
      <guid>https://dev.to/wallaceespindola/contract-first-integration-a-practical-guide-for-developers-49nf</guid>
      <description>&lt;p&gt;Ever had that moment where you finish building an API, tell the frontend team "it's ready," and then spend two days debugging why their requests keep failing? Yeah, me too.&lt;/p&gt;

&lt;p&gt;Turns out there's a better way: Define the contract first, then build the code to match it. In this guide, I'll show you exactly how to do contract-first integration with Spring Boot, OpenAPI, and Kafka.&lt;/p&gt;

&lt;p&gt;No theory. Just practical steps you can use today.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is Contract-First Integration?
&lt;/h2&gt;

&lt;p&gt;Simple version: You write the API specification before you write any code.&lt;/p&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Code the API&lt;/li&gt;
&lt;li&gt;Test it&lt;/li&gt;
&lt;li&gt;Document it&lt;/li&gt;
&lt;li&gt;Hope it matches what consumers expected&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write the contract (OpenAPI spec or Avro schema)&lt;/li&gt;
&lt;li&gt;Get everyone to agree on it&lt;/li&gt;
&lt;li&gt;Generate code from the contract&lt;/li&gt;
&lt;li&gt;Implement the logic&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The contract is the single source of truth. Code, tests, and docs all come from it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Should You Care?
&lt;/h2&gt;

&lt;p&gt;Three reasons:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. No more "but I thought you meant..."&lt;/strong&gt; conversations&lt;/p&gt;

&lt;p&gt;When you define the contract upfront, there's no ambiguity. The spec says exactly what fields are required, what types they are, and what errors to expect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Teams can work in parallel&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Frontend doesn't have to wait for backend. They can generate a client SDK from the contract and develop against a mock&lt;br&gt;
server. When the real API is ready, they just switch the URL. No code changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Breaking changes get caught in CI, not production&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You set up automated checks that fail the build if someone tries to remove a required field or change a response type. No more "oops, we broke all the mobile clients" moments.&lt;/p&gt;


&lt;h2&gt;
  
  
  Quick Start: Your First OpenAPI Contract
&lt;/h2&gt;

&lt;p&gt;Let's build a simple orders API. We'll start with the contract.&lt;/p&gt;

&lt;p&gt;Create a file: &lt;code&gt;contracts/openapi/orders-api.yaml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;openapi&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;3.2.0&lt;/span&gt;
&lt;span class="na"&gt;info&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Orders API&lt;/span&gt;
  &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1.0.0&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Contract-first REST API for order management&lt;/span&gt;

&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;/v1/orders&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;post&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;summary&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create a new order&lt;/span&gt;
      &lt;span class="na"&gt;requestBody&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;application/json&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;$ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#/components/schemas/CreateOrderRequest'&lt;/span&gt;
      &lt;span class="na"&gt;responses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;201'&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Order created successfully&lt;/span&gt;
          &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;application/json&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;$ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#/components/schemas/OrderResponse'&lt;/span&gt;
      &lt;span class="err"&gt;  &lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;400'&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Invalid request&lt;/span&gt;
          &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;application/json&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;$ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#/components/schemas/ErrorResponse'&lt;/span&gt;

  &lt;span class="s"&gt;/v1/orders/{orderId}&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;summary&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get an order by ID&lt;/span&gt;
      &lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;orderId&lt;/span&gt;
          &lt;span class="na"&gt;in&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;path&lt;/span&gt;
          &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
          &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
      &lt;span class="na"&gt;responses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;200'&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Order found&lt;/span&gt;
          &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;application/json&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;schema&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;$ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#/components/schemas/OrderResponse'&lt;/span&gt;
      &lt;span class="err"&gt;  &lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;404'&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Order not found&lt;/span&gt;

&lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;schemas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;CreateOrderRequest&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;object&lt;/span&gt;
      &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;customerId&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;items&lt;/span&gt;
      &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;customerId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;example&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;CUST-123"&lt;/span&gt;
        &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;array&lt;/span&gt;
          &lt;span class="na"&gt;minItems&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
          &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;$ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#/components/schemas/OrderItem'&lt;/span&gt;

    &lt;span class="na"&gt;OrderItem&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;object&lt;/span&gt;
      &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;sku&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;quantity&lt;/span&gt;
      &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;sku&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;example&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SKU-001"&lt;/span&gt;
        &lt;span class="na"&gt;quantity&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;integer&lt;/span&gt;
          &lt;span class="na"&gt;minimum&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
          &lt;span class="na"&gt;example&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;

    &lt;span class="na"&gt;OrderResponse&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;object&lt;/span&gt;
      &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;orderId&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;customerId&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;status&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;items&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;timestamp&lt;/span&gt;
      &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;orderId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;example&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ORD-10001"&lt;/span&gt;
        &lt;span class="na"&gt;customerId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
        &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;enum&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;CREATED&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;REJECTED&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt;
        &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;array&lt;/span&gt;
          &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;$ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#/components/schemas/OrderItem'&lt;/span&gt;
        &lt;span class="na"&gt;timestamp&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;date-time&lt;/span&gt;

    &lt;span class="na"&gt;ErrorResponse&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;object&lt;/span&gt;
      &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;code&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;message&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;timestamp&lt;/span&gt;
      &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;code&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;example&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;VALIDATION_ERROR"&lt;/span&gt;
        &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;example&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;items&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;must&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;not&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;be&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;empty"&lt;/span&gt;
        &lt;span class="na"&gt;timestamp&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
          &lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;date-time&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's your contract. It defines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Two endpoints: POST &lt;code&gt;/v1/orders&lt;/code&gt; and GET &lt;code&gt;/v1/orders/{orderId}&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Request and response structures&lt;/li&gt;
&lt;li&gt;Error responses&lt;/li&gt;
&lt;li&gt;Validation rules (like &lt;code&gt;minItems: 1&lt;/code&gt; for the items array)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Implementing the API in Spring Boot
&lt;/h2&gt;

&lt;p&gt;Now let's build the actual API. Create a Spring Boot controller:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
&lt;span class="nd"&gt;@RestController&lt;/span&gt;
&lt;span class="nd"&gt;@RequestMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/v1/orders"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@RequiredArgsConstructor&lt;/span&gt;
&lt;span class="nd"&gt;@Slf4j&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OrderController&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;OrderService&lt;/span&gt; &lt;span class="n"&gt;orderService&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@PostMapping&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;ResponseEntity&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;OrderResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;createOrder&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
            &lt;span class="nd"&gt;@Valid&lt;/span&gt; &lt;span class="nd"&gt;@RequestBody&lt;/span&gt; &lt;span class="nc"&gt;CreateOrderRequest&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

        &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;info&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Creating order for customer: {}"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;customerId&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;

        &lt;span class="nc"&gt;OrderResponse&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;orderService&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createOrder&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ResponseEntity&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HttpStatus&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;CREATED&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="nd"&gt;@GetMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/{orderId}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;ResponseEntity&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;OrderResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;getOrder&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@PathVariable&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;orderId&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;OrderResponse&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;orderService&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getOrder&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;orderId&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;orElseThrow&lt;/span&gt;&lt;span class="o"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
                        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ResourceNotFoundException&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Order not found: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;orderId&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ResponseEntity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ok&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key points:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;@Valid&lt;/code&gt; triggers validation based on the contract constraints&lt;/li&gt;
&lt;li&gt;HTTP status codes match what the contract specifies (201 for created, 404 for not found)&lt;/li&gt;
&lt;li&gt;DTOs (CreateOrderRequest, OrderResponse) match the contract schemas exactly&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Adding Contract Validation to CI
&lt;/h2&gt;

&lt;p&gt;Here's how to catch breaking changes before they reach production.&lt;/p&gt;

&lt;p&gt;Add this to your GitHub Actions workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Validate API Contract&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;pull_request&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contract-validation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v3&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;fetch-depth&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check for breaking changes&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;npx openapi-diff \&lt;/span&gt;
            &lt;span class="s"&gt;origin/main:contracts/openapi/orders-api.yaml \&lt;/span&gt;
            &lt;span class="s"&gt;HEAD:contracts/openapi/orders-api.yaml \&lt;/span&gt;
            &lt;span class="s"&gt;--fail-on-breaking&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now if someone tries to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove a required field&lt;/li&gt;
&lt;li&gt;Change a field type&lt;/li&gt;
&lt;li&gt;Remove an endpoint&lt;/li&gt;
&lt;li&gt;Change HTTP status codes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The PR build will fail. Breaking changes get caught in code review.&lt;/p&gt;




&lt;h2&gt;
  
  
  Contract-First for Kafka Events
&lt;/h2&gt;

&lt;p&gt;APIs are one thing, but what about event-driven systems? Let's look at Kafka.&lt;/p&gt;

&lt;p&gt;For Kafka, you need two contracts:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Topic Semantics (Human-Readable)
&lt;/h3&gt;

&lt;p&gt;Create: &lt;code&gt;contracts/events/topics.md&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## orders.order-created.v1&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Purpose: Emitted when an order is created
&lt;span class="p"&gt;-&lt;/span&gt; Key: orderId (for partition affinity)
&lt;span class="p"&gt;-&lt;/span&gt; Delivery: At-least-once (consumers must be idempotent)
&lt;span class="p"&gt;-&lt;/span&gt; Deduplication: Use eventId field
&lt;span class="p"&gt;-&lt;/span&gt; DLQ: orders.order-created.v1.dlq
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This documents the operational behavior.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Avro Schema (Machine-Validated)
&lt;/h3&gt;

&lt;p&gt;Create: &lt;code&gt;contracts/events/avro/OrderCreated.v1.avsc&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"record"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"OrderCreated"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"com.acme.events"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fields"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eventId"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"doc"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Unique event ID for deduplication"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"occurredAt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"doc"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ISO 8601 timestamp"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"orderId"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"customerId"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"items"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"array"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"items"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"record"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"OrderItem"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"fields"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sku"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"quantity"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"int"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Publishing Kafka Events
&lt;/h2&gt;

&lt;p&gt;Here's how to publish events in Spring Boot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
&lt;span class="nd"&gt;@Component&lt;/span&gt;
&lt;span class="nd"&gt;@RequiredArgsConstructor&lt;/span&gt;
&lt;span class="nd"&gt;@Slf4j&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OrderEventPublisher&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;KafkaTemplate&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Object&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;kafkaTemplate&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;publishOrderCreated&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OrderCreated&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getOrderId&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;debug&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Publishing OrderCreated: orderId={}"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="nc"&gt;CompletableFuture&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;SendResult&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Object&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;future&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
                &lt;span class="n"&gt;kafkaTemplate&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;send&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"orders.order-created.v1"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;future&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;whenComplete&lt;/span&gt;&lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ex&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;info&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Published OrderCreated: partition={}, offset={}"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
                        &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getRecordMetadata&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;partition&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt;
                        &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getRecordMetadata&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;offset&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Failed to publish OrderCreated"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;});&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why use orderId as the key?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Kafka partitions messages by key. Using &lt;code&gt;orderId&lt;/code&gt; ensures all events for the same order go to the same partition, preserving order.&lt;/p&gt;




&lt;h2&gt;
  
  
  Consuming Kafka Events (The Right Way)
&lt;/h2&gt;

&lt;p&gt;Kafka delivers messages at-least-once, which means duplicates are possible. Your consumer must be idempotent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
&lt;span class="nd"&gt;@KafkaListener&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;topics&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"orders.order-created.v1"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;groupId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"billing-service"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;onOrderCreated&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OrderCreated&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Check if we already processed this event&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;processedEventsRepo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;existsByEventId&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getEventId&lt;/span&gt;&lt;span class="o"&gt;()))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;debug&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Skipping duplicate event: {}"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getEventId&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Process the event&lt;/span&gt;
    &lt;span class="n"&gt;billingService&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createInvoice&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getOrderId&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt;
            &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getCustomerId&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt;
            &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getItems&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Mark as processed&lt;/span&gt;
    &lt;span class="n"&gt;processedEventsRepo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
            &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ProcessedEvent&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getEventId&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="nc"&gt;Instant&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;now&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt;
    &lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pattern prevents duplicate processing. Even if Kafka redelivers the same event, you check the &lt;code&gt;eventId&lt;/code&gt; and skip it if you've seen it before.&lt;/p&gt;




&lt;h2&gt;
  
  
  Schema Evolution Done Right
&lt;/h2&gt;

&lt;p&gt;Eventually you'll need to add fields to your events. Here's how to do it without breaking consumers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wrong way (breaks consumers):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"source"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes &lt;code&gt;source&lt;/code&gt; required. Old events don't have it. New consumers crash when reading old events.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Right way (backward compatible):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"source"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"null"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"default"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Old consumers reading new events: They ignore the &lt;code&gt;source&lt;/code&gt; field&lt;/li&gt;
&lt;li&gt;New consumers reading old events: They get &lt;code&gt;null&lt;/code&gt; for &lt;code&gt;source&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Nobody breaks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Always make new fields optional with defaults.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setting Up Schema Registry
&lt;/h2&gt;

&lt;p&gt;Schema Registry validates that your schema changes are backward compatible.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;application.yml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;spring&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;kafka&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;bootstrap-servers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;localhost:9092&lt;/span&gt;
    &lt;span class="na"&gt;producer&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;key-serializer&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;org.apache.kafka.common.serialization.StringSerializer&lt;/span&gt;
      &lt;span class="na"&gt;value-serializer&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;io.confluent.kafka.serializers.KafkaAvroSerializer&lt;/span&gt;
      &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;schema.registry.url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http://localhost:8081&lt;/span&gt;
        &lt;span class="na"&gt;auto.register.schemas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="na"&gt;use.latest.version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When your producer starts, it tries to register the schema. If the schema isn't backward compatible with the previous version, registration fails and your service won't start.&lt;/p&gt;

&lt;p&gt;This prevents breaking changes from reaching production.&lt;/p&gt;




&lt;h2&gt;
  
  
  Database Contracts With Flyway
&lt;/h2&gt;

&lt;p&gt;Database schemas are contracts too. Use Flyway to version your migrations.&lt;/p&gt;

&lt;p&gt;Create: &lt;code&gt;src/main/resources/db/migration/V1__create_orders.sql&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt;          &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt;      &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt;  &lt;span class="nb"&gt;TIMESTAMP&lt;/span&gt;   &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;order_items&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;sku&lt;/span&gt;      &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;quantity&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;         &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;quantity&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_orders_customer_id&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Flyway runs migrations in order on startup. If someone manually modified the schema, Flyway detects the mismatch and fails the deployment.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Wins Checklist
&lt;/h2&gt;

&lt;p&gt;Here's what you can do this week:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 1: Write one OpenAPI contract&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pick your simplest API endpoint&lt;/li&gt;
&lt;li&gt;Write the OpenAPI spec for it&lt;/li&gt;
&lt;li&gt;Validate it with &lt;a href="https://editor.swagger.io" rel="noopener noreferrer"&gt;editor.swagger.io&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Day 2: Set up contract validation in CI&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add openapi-diff to your GitHub Actions&lt;/li&gt;
&lt;li&gt;Test it by trying to make a breaking change&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Day 3: Create a mock server&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use Prism or Wiremock to serve responses based on your contract&lt;/li&gt;
&lt;li&gt;Give the mock URL to your frontend team&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Day 4: Implement the real API&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build the Spring Boot controller that matches the contract&lt;/li&gt;
&lt;li&gt;Run your contract validation to ensure it matches&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Day 5: Measure the difference&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Count integration bugs before and after&lt;/li&gt;
&lt;li&gt;Measure time to integration&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Common Mistakes to Avoid
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mistake 1: Generating contracts from code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Don't use annotations to generate OpenAPI specs. Write the spec first, then implement code that matches it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake 2: Skipping CI validation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Contracts are useless if they're not enforced. Always add automated checks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake 3: Breaking changes without versioning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you need to make a breaking change, create a new version (&lt;code&gt;/v2/orders&lt;/code&gt;) and deprecate the old one gradually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake 4: Forgetting about idempotency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Always include an &lt;code&gt;idempotencyKey&lt;/code&gt; field for POST requests and an &lt;code&gt;eventId&lt;/code&gt; for Kafka events. Retries happen. Your code must handle them gracefully.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tools That Help
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;OpenAPI:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://editor.swagger.io" rel="noopener noreferrer"&gt;Swagger Editor&lt;/a&gt; - Validate your specs&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://stoplight.io/open-source/prism" rel="noopener noreferrer"&gt;Prism&lt;/a&gt; - Mock server from OpenAPI&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://openapi-generator.tech" rel="noopener noreferrer"&gt;openapi-generator&lt;/a&gt; - Generate client SDKs&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/openapi-diff" rel="noopener noreferrer"&gt;openapi-diff&lt;/a&gt; - Detect breaking changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Kafka:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.confluent.io/platform/current/schema-registry/index.html" rel="noopener noreferrer"&gt;Confluent Schema Registry&lt;/a&gt; - Schema validation&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://avro.apache.org/docs/current/gettingstartedjava.html" rel="noopener noreferrer"&gt;Avro Tools&lt;/a&gt; - Generate Java classes from schemas&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Database:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://flywaydb.org" rel="noopener noreferrer"&gt;Flyway&lt;/a&gt; - Database migrations&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.liquibase.org" rel="noopener noreferrer"&gt;Liquibase&lt;/a&gt; - Alternative to Flyway&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What's Your Experience?
&lt;/h2&gt;

&lt;p&gt;Have you tried contract-first integration? What worked? What didn't?&lt;/p&gt;

&lt;p&gt;Drop a comment below. I'd love to hear about your experiences and answer any questions.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Want the full code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check out the complete working example: &lt;a href="https://github.com/wallaceespindola/contract-first-integrations" rel="noopener noreferrer"&gt;github.com/wallaceespindola/contract-first-integrations&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full OpenAPI specs&lt;/li&gt;
&lt;li&gt;Spring Boot implementation&lt;/li&gt;
&lt;li&gt;Kafka producer and consumer with Avro&lt;/li&gt;
&lt;li&gt;Flyway migrations&lt;/li&gt;
&lt;li&gt;CI/CD validation setup&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If this helped you, hit the ❤️ button and share it with your team. Follow me for more practical Spring Boot and Kafka tutorials.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Related posts you might like:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/wallaceespindola/generating-realistic-fake-data-in-java-with-quarkus-datafaker-easyrandom-5gi8"&gt;Generating Realistic Fake Data in Java with Quarkus, DataFaker &amp;amp; EasyRandom&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/wallaceespindola/cassandra-vs-postgresql-a-developers-guide-to-choose-the-right-database-3nhi"&gt;Cassandra vs PostgreSQL: A Developer’s Guide to Choose the Right Database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/wallaceespindola/fastapi-your-fast-and-modern-framework-for-apis-3mmo"&gt;FastAPI Unleashed: Building Modern and High-Performance APIs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Need more tech insights?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check out my &lt;a href="https://github.com/wallaceespindola" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/wallaceespindola/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, and &lt;a href="https://speakerdeck.com/wallacese" rel="noopener noreferrer"&gt;Speaker Deck&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Support my work: &lt;a href="//buymeacoffee.com/wallace.espindola"&gt;Buy Me A Coffee&lt;/a&gt; ☕&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>java</category>
      <category>microservices</category>
      <category>architecture</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Generating Realistic Fake Data in Java with Quarkus, DataFaker &amp; EasyRandom</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Tue, 07 Oct 2025 17:47:43 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/generating-realistic-fake-data-in-java-with-quarkus-datafaker-easyrandom-5gi8</link>
      <guid>https://dev.to/wallaceespindola/generating-realistic-fake-data-in-java-with-quarkus-datafaker-easyrandom-5gi8</guid>
      <description>&lt;p&gt;Let’s be honest — your test data probably looks a little… robotic.&lt;br&gt;
You know the drill: “John Doe”, “&lt;a href="mailto:test@example.com"&gt;test@example.com&lt;/a&gt;”, “123 Main Street”.&lt;/p&gt;

&lt;p&gt;It works, but it’s painfully obvious that it’s fake.&lt;/p&gt;

&lt;p&gt;And if you’re demoing your API, seeding a database, or stress-testing your app, that kind of data just doesn’t cut it anymore.&lt;/p&gt;

&lt;p&gt;The good news? With &lt;strong&gt;Quarkus&lt;/strong&gt;, &lt;strong&gt;DataFaker&lt;/strong&gt;, and &lt;strong&gt;EasyRandom&lt;/strong&gt;, you can generate realistic, varied, and structured data — fast, elegant, and believable.&lt;/p&gt;

&lt;p&gt;By the end of this article, you’ll have a &lt;strong&gt;Quarkus REST API&lt;/strong&gt; that returns lifelike fake users — names, emails, phones, and addresses — all neatly timestamped.&lt;/p&gt;

&lt;p&gt;Full code example here: &lt;br&gt;
👉 &lt;a href="https://github.com/wallaceespindola/fake-data-quarkus" rel="noopener noreferrer"&gt;github.com/wallaceespindola/fake-data-quarkus&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s dive in.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why Fake Data Matters More Than Ever
&lt;/h2&gt;

&lt;p&gt;If you’re a backend dev, you’ve probably needed mock data for one of these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Testing APIs or UI components&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Populating demo environments&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Running performance or load tests&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anonymizing real data for staging environments&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And sure, you could throw in “John Doe” again.&lt;br&gt;
But what if you could generate realistic, localized names, addresses, and emails that feel like real-world data — and do it dynamically, in a fast Quarkus service?&lt;/p&gt;

&lt;p&gt;That’s what we’re building.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;

&lt;p&gt;We’ll use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Quarkus&lt;/strong&gt; — the fast, lightweight Java framework for modern apps&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DataFaker&lt;/strong&gt; — for generating realistic values&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;EasyRandom&lt;/strong&gt; — for filling entire objects automatically&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lombok&lt;/strong&gt; — to cut boilerplate&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OpenAPI&lt;/strong&gt; + Swagger UI — for quick API testing&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Project Setup
&lt;/h2&gt;

&lt;p&gt;Generate a Quarkus project using the CLI or code.quarkus.io:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn io.quarkus.platform:quarkus-maven-plugin:3.12.1:create &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-DprojectGroupId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;com.example &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-DprojectArtifactId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;fake-data-quarkus &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-DclassName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"com.example.fakedata.UserResource"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-Dpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/api/users"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, add dependencies to your pom.xml:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dependencies&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;io.quarkus&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;quarkus-resteasy-reactive&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;io.quarkus&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;quarkus-smallrye-openapi&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;net.datafaker&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;datafaker&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;2.2.2&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;org.jeasy&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;easy-random-core&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;5.0.0&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;org.projectlombok&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;lombok&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;optional&amp;gt;&lt;/span&gt;true&lt;span class="nt"&gt;&amp;lt;/optional&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;io.quarkus&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;quarkus-junit5&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;scope&amp;gt;&lt;/span&gt;test&lt;span class="nt"&gt;&amp;lt;/scope&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dependencies&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  The Domain
&lt;/h2&gt;

&lt;p&gt;Let’s start small — our fake “User” object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.fakedata.domain&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Builder&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Data&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@Data&lt;/span&gt;
&lt;span class="nd"&gt;@Builder&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;fullName&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;phone&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And a DTO version for API responses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.fakedata.dto&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;record&lt;/span&gt; &lt;span class="nf"&gt;UserDto&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;fullName&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;phone&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We’re using &lt;strong&gt;Lombok&lt;/strong&gt; for the model and a &lt;strong&gt;Java Record&lt;/strong&gt; for the &lt;strong&gt;DTO&lt;/strong&gt; to keep things clean.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Data Generation Service
&lt;/h2&gt;

&lt;p&gt;Here’s where we mix &lt;strong&gt;DataFaker&lt;/strong&gt; and &lt;strong&gt;EasyRandom&lt;/strong&gt; for maximum awesomeness:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.fakedata.service&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.example.fakedata.domain.User&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.enterprise.context.ApplicationScoped&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;net.datafaker.Faker&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.jeasy.random.EasyRandom&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.jeasy.random.EasyRandomParameters&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.List&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Locale&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.UUID&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.stream.Collectors&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.stream.IntStream&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@ApplicationScoped&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DataGenService&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

  &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;Faker&lt;/span&gt; &lt;span class="n"&gt;faker&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Faker&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Locale&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ENGLISH&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;EasyRandom&lt;/span&gt; &lt;span class="n"&gt;easyRandom&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;DataGenService&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;EasyRandomParameters&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;EasyRandomParameters&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;seed&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentTimeMillis&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stringLengthRange&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;easyRandom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;EasyRandom&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="nf"&gt;randomUserViaDatafaker&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="no"&gt;UUID&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randomUUID&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fullName&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;faker&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;fullName&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;faker&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;internet&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;emailAddress&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;phone&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;faker&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;phoneNumber&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;cellPhone&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;faker&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;fullAddress&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="nf"&gt;randomUserViaEasyRandom&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;easyRandom&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextObject&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;isBlank&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt;
      &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setId&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="no"&gt;UUID&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randomUUID&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setFullName&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;faker&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;fullName&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setEmail&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;faker&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;internet&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;emailAddress&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;manyUsers&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;useEasyRandom&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;IntStream&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;range&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;max&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;mapToObj&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;useEasyRandom&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;randomUserViaEasyRandom&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;randomUserViaDatafaker&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;collect&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Collectors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toList&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here’s the beauty of it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DataFaker&lt;/strong&gt; generates names, addresses, and emails that sound real.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;EasyRandom&lt;/strong&gt; handles the object creation for you.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Combine them, and you’ve got structured data that looks human.&lt;/p&gt;




&lt;h2&gt;
  
  
  The REST API
&lt;/h2&gt;

&lt;p&gt;Now, let’s make it accessible with &lt;strong&gt;Quarkus RESTEasy Reactive&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.fakedata&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.example.fakedata.domain.User&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.example.fakedata.dto.UserDto&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.example.fakedata.service.DataGenService&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.inject.Inject&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.ws.rs.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.ws.rs.core.MediaType&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.ws.rs.core.Response&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.eclipse.microprofile.openapi.annotations.Operation&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.eclipse.microprofile.openapi.annotations.tags.Tag&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.time.Instant&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.List&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.stream.Collectors&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@Path&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/api/users"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@Produces&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MediaType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;APPLICATION_JSON&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@Tag&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Users"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Generate fake users with DataFaker + EasyRandom"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserResource&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

  &lt;span class="nd"&gt;@Inject&lt;/span&gt;
  &lt;span class="nc"&gt;DataGenService&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

  &lt;span class="n"&gt;record&lt;/span&gt; &lt;span class="nc"&gt;ApiResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Instant&lt;/span&gt; &lt;span class="n"&gt;timestamp&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;ApiResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="no"&gt;T&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ApiResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Instant&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;now&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;

  &lt;span class="nd"&gt;@GET&lt;/span&gt;
  &lt;span class="nd"&gt;@Path&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/{count}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nd"&gt;@Operation&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Generate a list of fake users"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt; &lt;span class="nf"&gt;generateUsers&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@PathParam&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"count"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
                                &lt;span class="nd"&gt;@QueryParam&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"easy"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nd"&gt;@DefaultValue&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"false"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;easy&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;UserDto&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;manyUsers&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;easy&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;map&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;UserDto&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getFullName&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getEmail&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getPhone&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getAddress&lt;/span&gt;&lt;span class="o"&gt;()))&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;collect&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Collectors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toList&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ok&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ApiResponse&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="o"&gt;)).&lt;/span&gt;&lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;

  &lt;span class="nd"&gt;@GET&lt;/span&gt;
  &lt;span class="nd"&gt;@Path&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/one"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nd"&gt;@Operation&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Generate one fake user"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt; &lt;span class="nf"&gt;oneUser&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randomUserViaDatafaker&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ok&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ApiResponse&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;UserDto&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getFullName&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getEmail&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getPhone&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getAddress&lt;/span&gt;&lt;span class="o"&gt;()))).&lt;/span&gt;&lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  This API gives you two simple endpoints:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;GET /api/users/{count}&lt;/code&gt; — returns N users&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;GET /api/users/one&lt;/code&gt; — returns a single fake user&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every response includes a timestamp, so you know exactly when it was generated.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run It
&lt;/h3&gt;

&lt;p&gt;Start Quarkus in dev mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./mvnw quarkus:dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Visit Home Test Page:
&lt;/h3&gt;

&lt;p&gt;👉 &lt;a href="http://localhost:8080/" rel="noopener noreferrer"&gt;http://localhost:8080/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtzt5jewabtlf03n4ll0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtzt5jewabtlf03n4ll0.png" alt=" " width="800" height="676"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Visit Swagger Page for Endpoints:
&lt;/h3&gt;

&lt;p&gt;👉 &lt;a href="http://localhost:8080/q/swagger-ui" rel="noopener noreferrer"&gt;http://localhost:8080/q/swagger-ui&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhqgymgffoxadi2ou74zm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhqgymgffoxadi2ou74zm.png" alt=" " width="800" height="732"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;GET /api/users/3&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Sample output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"a8a5fbb3-47b6-4387-9827-8c9b8ac6e9dc"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"fullName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Rosa Bianchi"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rosa.bianchi@example.it"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"phone"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"+39 349 123 4567"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Via Roma 45, Milano"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"c48de9e7-92f4-4b15-8bcb-3c1b3a710c0c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"fullName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"James Holloway"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"james.holloway@demo.io"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"phone"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"+1 415 555 1829"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"77 Market Street, San Francisco"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2025-10-06T18:45:33.982Z"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looks real enough to demo your next project, right?&lt;/p&gt;




&lt;h2&gt;
  
  
  Bonus: Built-In Swagger &amp;amp; OpenAPI
&lt;/h2&gt;

&lt;p&gt;Quarkus comes with OpenAPI + Swagger UI ready to go.&lt;/p&gt;

&lt;p&gt;No config hell, no dependencies to chase. Just hit &lt;code&gt;/q/swagger-ui&lt;/code&gt; and explore your endpoints visually.&lt;/p&gt;

&lt;h3&gt;
  
  
  Want to tweak the OpenAPI path?
&lt;/h3&gt;

&lt;p&gt;Just update application.properties:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="py"&gt;quarkus.smallrye-openapi.path&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/openapi&lt;/span&gt;
&lt;span class="py"&gt;quarkus.swagger-ui.always-include&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why This Combo Works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DataFaker&lt;/strong&gt; brings authenticity — localized names, realistic emails, believable data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;EasyRandom&lt;/strong&gt; handles complexity — fills entire objects without effort.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Quarkus&lt;/strong&gt; ties it together with speed and simplicity — minimal setup, instant hot reloads, and small footprint.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You end up with a lightning-fast, production-like data generator that’s perfect for modern development.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real Use Cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Preloading a test database&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Filling front-end prototypes with real-looking data&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stress-testing APIs with variety&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creating synthetic datasets for analytics&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replacing sensitive info in QA or sandbox environments&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Going Native (Optional)
&lt;/h2&gt;

&lt;p&gt;Want to go wild? Build it as a native binary using GraalVM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./mvnw package &lt;span class="nt"&gt;-Pnative&lt;/span&gt;
./target/fake-data-quarkus-1.0.0-runner
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Startup time? Instant.&lt;br&gt;
Memory footprint? Tiny.&lt;br&gt;
Speed? Ridiculous.&lt;/p&gt;

&lt;p&gt;Perfect for containers, CI pipelines, or quick mock environments.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Fake data doesn’t have to be boring.&lt;br&gt;
With Quarkus, DataFaker, and EasyRandom, you can generate realistic, rich, and structured data that makes your applications — and demos — feel alive.&lt;/p&gt;

&lt;p&gt;This setup is fast, modern, and ready to use for everything from testing to production seeding.&lt;/p&gt;

&lt;p&gt;So next time you’re building or testing an API, forget “John Doe”.&lt;br&gt;
Give your fake data a little soul.&lt;/p&gt;




&lt;h2&gt;
  
  
  Need more tech insights?
&lt;/h2&gt;

&lt;p&gt;Check out my &lt;a href="https://github.com/wallaceespindola" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/wallaceespindola" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, and &lt;a href="https://speakerdeck.com/wallacese" rel="noopener noreferrer"&gt;SpeakerDeck&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Support my work: &lt;a href="https://buymeacoffee.com/wallace.espindola" rel="noopener noreferrer"&gt;Buy Me A Coffee&lt;/a&gt; ☕&lt;/p&gt;

</description>
      <category>testing</category>
      <category>java</category>
      <category>quarkus</category>
      <category>restapi</category>
    </item>
    <item>
      <title>Cassandra vs PostgreSQL: A Developer’s Guide to Choose the Right Database</title>
      <dc:creator>Wallace Espindola</dc:creator>
      <pubDate>Wed, 09 Jul 2025 15:48:42 +0000</pubDate>
      <link>https://dev.to/wallaceespindola/cassandra-vs-postgresql-a-developers-guide-to-choose-the-right-database-3nhi</link>
      <guid>https://dev.to/wallaceespindola/cassandra-vs-postgresql-a-developers-guide-to-choose-the-right-database-3nhi</guid>
      <description>&lt;p&gt;Choosing the right database can feel a bit like picking the right tool for a job—you wouldn't use a hammer to tighten a screw, right? In the world of databases, two heavy-weight options often come up: &lt;strong&gt;Apache Cassandra&lt;/strong&gt; and &lt;strong&gt;PostgreSQL&lt;/strong&gt;. Both are powerful, but they shine in different scenarios. Let's dive into their strengths, weaknesses, and ideal use cases to help you make an informed decision.&lt;/p&gt;




&lt;h1&gt;
  
  
  Understanding the Basics
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Apache Cassandra
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cassandra&lt;/strong&gt; is a distributed NoSQL database designed for handling large amounts of data across many servers. It's known for its high availability and scalability. Companies like Apple and Netflix rely on Cassandra to manage massive datasets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Apple&lt;/strong&gt;: Reportedly runs over 75,000 Cassandra nodes, storing more than 10 petabytes of data. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Netflix&lt;/strong&gt;: Uses Cassandra to handle its ever-growing persistence needs. &lt;/p&gt;

&lt;h2&gt;
  
  
  PostgreSQL
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;PostgreSQL&lt;/strong&gt; is a powerful, open-source relational database system known for its robustness and standards compliance. It's widely used in various applications, from web development to data analysis. GitLab, for instance, uses PostgreSQL as its primary database system. &lt;/p&gt;




&lt;h2&gt;
  
  
  Key Differences
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Cassandra&lt;/th&gt;
&lt;th&gt;PostgreSQL&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data Model&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Wide-column store (NoSQL)&lt;/td&gt;
&lt;td&gt;Relational (SQL)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scalability&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Horizontally scalable across many servers&lt;/td&gt;
&lt;td&gt;Vertically scalable; horizontal scaling possible with extensions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Consistency&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Eventual consistency (tunable)&lt;/td&gt;
&lt;td&gt;Strong consistency (ACID compliant)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Query Language&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CQL (Cassandra Query Language)&lt;/td&gt;
&lt;td&gt;SQL (Structured Query Language)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Use Cases&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;High write throughput, IoT, real-time analytics&lt;/td&gt;
&lt;td&gt;Complex queries, transactional systems, analytics&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Community Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Active community with enterprise backing&lt;/td&gt;
&lt;td&gt;Large, active open-source community&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  When to Choose Cassandra
&lt;/h2&gt;

&lt;p&gt;Cassandra excels in scenarios where you need to handle large volumes of data with high availability and scalability. Consider Cassandra if:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;High Write Throughput&lt;/strong&gt;: Your application requires writing large amounts of data quickly, such as logging or sensor data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Distributed Architecture&lt;/strong&gt;: You need a database that can run across multiple data centers or cloud regions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fault Tolerance&lt;/strong&gt;: Your system must remain operational even if parts of it fail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: A global e-commerce platform tracking user activity in real-time across various regions.&lt;/p&gt;




&lt;h2&gt;
  
  
  When to Choose PostgreSQL
&lt;/h2&gt;

&lt;p&gt;PostgreSQL is ideal when your application requires complex queries, transactions, and data integrity. Opt for PostgreSQL if:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Complex Queries&lt;/strong&gt;: You need to perform joins, aggregations, and subqueries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Integrity&lt;/strong&gt;: Your application requires strict adherence to ACID properties.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Extensibility&lt;/strong&gt;: You plan to use extensions like PostGIS for geospatial data or TimescaleDB for time-series data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: A financial application managing transactions and generating detailed reports.&lt;/p&gt;




&lt;h1&gt;
  
  
  Real-World Use Cases
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Cassandra at Apple
&lt;/h2&gt;

&lt;p&gt;Apple uses Cassandra to manage services like iMessage and iTunes, running over 75,000 nodes and storing more than 10 petabytes of data. &lt;/p&gt;

&lt;h2&gt;
  
  
  PostgreSQL at GitLab
&lt;/h2&gt;

&lt;p&gt;GitLab relies on PostgreSQL for its database needs, emphasizing its robustness and reliability. &lt;/p&gt;




&lt;h1&gt;
  
  
  Performance and Scalability
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Cassandra
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Designed for horizontal scaling; adding more nodes increases capacity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance&lt;/strong&gt;: Optimized for write-heavy workloads; reads can be fast with proper data modeling.&lt;/p&gt;

&lt;h2&gt;
  
  
  PostgreSQL
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Primarily scales vertically; horizontal scaling achievable with tools like Citus.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance&lt;/strong&gt;: Excels in read-heavy workloads and complex queries; write performance is strong but may require tuning for very high volumes.&lt;/p&gt;




&lt;h1&gt;
  
  
  Community and Ecosystem
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Cassandra
&lt;/h2&gt;

&lt;p&gt;Backed by the Apache Software Foundation, Cassandra has a robust ecosystem with tools for monitoring, management, and integration.&lt;/p&gt;

&lt;h2&gt;
  
  
  PostgreSQL
&lt;/h2&gt;

&lt;p&gt;PostgreSQL boasts a vast array of extensions and tools, such as PostGIS for geospatial data and TimescaleDB for time-series data. Its active community ensures continuous improvement and support.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Choosing between Cassandra and PostgreSQL depends on your specific needs:&lt;/p&gt;

&lt;p&gt;Opt for Cassandra if you require a highly scalable, fault-tolerant system capable of handling massive write loads across distributed environments.&lt;/p&gt;

&lt;p&gt;Choose PostgreSQL when your application demands complex queries, strong data integrity, and a rich set of features out of the box.&lt;/p&gt;

&lt;p&gt;Both databases are powerful in their domains. Understanding your application's requirements will guide you to the right choice.&lt;/p&gt;




&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;p&gt;Cassandra's documentation: &lt;a href="https://cassandra.apache.org/" rel="noopener noreferrer"&gt;https://cassandra.apache.org/&lt;/a&gt;&lt;br&gt;
PostgreSQL's documentation: &lt;a href="https://www.postgresql.org/" rel="noopener noreferrer"&gt;https://www.postgresql.org/&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Need more tech insights?
&lt;/h2&gt;

&lt;p&gt;Check out my &lt;a href="https://github.com/wallaceespindola" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; repo and my &lt;a href="https://www.linkedin.com/in/wallaceespindola" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; page. &lt;br&gt;
Some of my presentation slides are available &lt;a href="https://speakerdeck.com/wallacese" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
Do you want to buy me a coffee to elevate my energy? You can do it &lt;a href="https://buymeacoffee.com/wallace.espindola" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>database</category>
      <category>architecture</category>
      <category>performance</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
