<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anupam Haldkar on Medium]]></title>
        <description><![CDATA[Stories by Anupam Haldkar on Medium]]></description>
        <link>https://medium.com/@anupamhaldkar?source=rss-b061864b94c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*o2eQeXzJFX0zOBtMUo-q0Q.png</url>
            <title>Stories by Anupam Haldkar on Medium</title>
            <link>https://medium.com/@anupamhaldkar?source=rss-b061864b94c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 20:24:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anupamhaldkar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How OTT Platforms Prevent Screenshots & Screen Recording]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/aimonks/how-ott-platforms-prevent-screenshots-screen-recording-bad74f28563d?source=rss-b061864b94c------2"><img src="https://cdn-images-1.medium.com/max/1983/0*psdZmr9K9Wnztzz2" width="1983"></a></p><p class="medium-feed-snippet">What actually happens when you press Screenshot while watching a movie?</p><p class="medium-feed-link"><a href="https://medium.com/aimonks/how-ott-platforms-prevent-screenshots-screen-recording-bad74f28563d?source=rss-b061864b94c------2">Continue reading on  . »</a></p></div>]]></description>
            <link>https://medium.com/aimonks/how-ott-platforms-prevent-screenshots-screen-recording-bad74f28563d?source=rss-b061864b94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/bad74f28563d</guid>
            <category><![CDATA[screenshots]]></category>
            <category><![CDATA[drm]]></category>
            <category><![CDATA[ott]]></category>
            <category><![CDATA[data-protection]]></category>
            <category><![CDATA[screen-recording]]></category>
            <dc:creator><![CDATA[Anupam Haldkar]]></dc:creator>
            <pubDate>Sun, 06 Sep 2026 06:17:27 GMT</pubDate>
            <atom:updated>2026-09-14T14:28:28.723Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Apple Pay in India: What Actually Happens Behind the “Pay” Button]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/aimonks/apple-pay-in-india-what-actually-happens-behind-the-pay-button-4b514f6209ed?source=rss-b061864b94c------2"><img src="https://cdn-images-1.medium.com/max/1200/0*uN9H47282dUze7gd.jpg" width="1200"></a></p><p class="medium-feed-snippet">A backend engineer&#x2019;s view of Apple Pay integration, tokenization, payment authorization, and what changes when Apple Pay enters the Indian&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/aimonks/apple-pay-in-india-what-actually-happens-behind-the-pay-button-4b514f6209ed?source=rss-b061864b94c------2">Continue reading on  . »</a></p></div>]]></description>
            <link>https://medium.com/aimonks/apple-pay-in-india-what-actually-happens-behind-the-pay-button-4b514f6209ed?source=rss-b061864b94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b514f6209ed</guid>
            <category><![CDATA[payment-gateway]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[merchant-account]]></category>
            <category><![CDATA[api-integration]]></category>
            <category><![CDATA[upi]]></category>
            <dc:creator><![CDATA[Anupam Haldkar]]></dc:creator>
            <pubDate>Sat, 29 Aug 2026 09:28:19 GMT</pubDate>
            <atom:updated>2026-09-07T12:45:20.512Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Hexagonal Architecture in Backend Systems: Why Modern Applications Need It]]></title>
            <link>https://anupamhaldkar.medium.com/hexagonal-architecture-in-backend-systems-why-modern-applications-need-it-30d51b9df4b2?source=rss-b061864b94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/30d51b9df4b2</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[design-thinking]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[hexagonal-architecture]]></category>
            <dc:creator><![CDATA[Anupam Haldkar]]></dc:creator>
            <pubDate>Sun, 31 May 2026 11:13:55 GMT</pubDate>
            <atom:updated>2026-05-31T11:15:05.832Z</atom:updated>
            <content:encoded><![CDATA[<p>Most backend systems start simple.</p><p>A controller receives a request, calls a service, saves data through a repository, and returns a response. In the beginning, this feels clean and manageable. But as the system grows, business logic slowly becomes coupled with frameworks, databases, external APIs, queues, and infrastructure concerns.</p><p>Over time, changing one thing starts affecting everything else.</p><p>Switching databases becomes painful.<br>Replacing a messaging system requires touching business logic.<br>Testing core functionality without spinning up the entire application becomes difficult.</p><p>This is exactly the kind of problem Hexagonal Architecture was designed to solve.</p><h3>What is Hexagonal Architecture?</h3><p>Hexagonal Architecture, also known as <strong>Ports and Adapters Architecture</strong>, was introduced by <a href="https://www.linkedin.com/in/alistaircockburn/">Alistair Cockburn</a> to separate the core business logic of an application from external systems.</p><p>The central idea is simple:</p><blockquote><em>The business logic should not depend on frameworks, databases, UI, or external services.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rkZnP4hgTUYmZMbdBIV0vA.png" /></figure><p>Instead, the application core communicates with the outside world through well-defined interfaces called <strong>ports</strong>, while concrete implementations are handled by <strong>adapters</strong>.</p><p>This creates a system where the domain remains independent and protected from infrastructure changes.</p><h3>Why the Name “Hexagonal”?</h3><p>The “hexagon” is symbolic.</p><p>Unlike layered architectures that imply a strict top-to-bottom dependency flow, the hexagonal shape represents the idea that the application can interact with multiple external actors equally:</p><ul><li>REST APIs</li><li>Databases</li><li>Kafka</li><li>RabbitMQ</li><li>External payment gateways</li><li>Schedulers</li><li>CLI tools</li><li>Test environments</li></ul><p>All of these communicate with the application through ports.</p><p>The shape itself is less important than the principle:</p><blockquote><em>Keep the core isolated.</em></blockquote><h3>Core Components of Hexagonal Architecture</h3><p>A typical backend system using Hexagonal Architecture consists of:</p><h4>1. Domain Layer</h4><p>This is the heart of the application.</p><p>It contains:</p><ul><li>Business rules</li><li>Domain models</li><li>Core use cases</li><li>Validation logic</li></ul><p>The domain should not know:</p><ul><li>Which database is being used</li><li>Which framework is running the app</li><li>Whether the request came from REST, GraphQL, or Kafka</li></ul><p>It only knows business behavior.</p><h4>2. Ports</h4><p>Ports define contracts through which the application communicates.</p><p>There are two major types:</p><p><strong>Incoming Ports</strong></p><p>These represent actions the application exposes.</p><p>Example:</p><pre>public interface CreateOrderUseCase {<br>    Order create(OrderRequest request);<br>}</pre><p><strong>Outgoing Ports</strong></p><p>These define dependencies required by the application.</p><p>Example:</p><pre>public interface PaymentGatewayPort {<br>    PaymentResponse processPayment(PaymentRequest request);<br>}</pre><p>The domain depends only on interfaces, never implementations.</p><h4>3. Adapters</h4><p>Adapters connect the external world to the ports.</p><p>Examples include:</p><ul><li>REST controllers</li><li>Database repositories</li><li>Kafka consumers</li><li>Third-party integrations</li><li>Email services</li></ul><p>Adapters implement the ports.</p><p>Example:</p><pre>@Component<br>public class StripePaymentAdapter implements PaymentGatewayPort {<br>    <br>@Override<br>    public PaymentResponse processPayment(PaymentRequest request) {<br>        // Stripe integration logic<br>    }<br></pre><p>The core business logic never directly depends on Stripe.</p><h3>Request Flow in Hexagonal Architecture</h3><p>A request typically flows like this:</p><pre>Client Request<br>    ↓<br>REST Controller (Adapter)<br>    ↓<br>Application Service / Use Case (Port)<br>    ↓<br>Domain Logic<br>    ↓<br>Outgoing Port<br>    ↓<br>Database / External API Adapter</pre><p>The important thing is that dependencies always point inward toward the domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1i8km-JElP9tQLHPB47oaQ.png" /></figure><h3>Why Backend Engineers Prefer Hexagonal Architecture</h3><h4>Better Testability</h4><p>Since the domain is isolated, unit tests become extremely simple.</p><p>You can mock ports without needing:</p><ul><li>Databases</li><li>Kafka</li><li>External APIs</li><li>Spring context</li></ul><p>This dramatically improves testing speed and reliability.</p><h3>Framework Independence</h3><p>In many traditional applications, business logic becomes tightly coupled with frameworks.</p><p>For example:</p><pre>@Service<br>@Transactional<br>public class OrderService {<br><br>Order getOrderById(String id){<br>    //logic <br>  }<br>}</pre><p>Eventually the framework starts driving the architecture., hexagonal Architecture reverses that.</p><p>Frameworks become implementation details rather than the center of the system.</p><h4>Easier Infrastructure Changes</h4><p>Suppose today you use: <em>MySQL, Kafka, Stripe</em></p><p>Tomorrow you decide to migrate to: <em>PostgreSQL </em>or<em> RabbitMQ </em>or<em> Razorpay</em></p><p>In a tightly coupled system, this can ripple through the entire codebase.</p><p>In a hexagonal system, only adapters change, The business logic remains untouched.</p><h4>Cleaner Boundaries in Microservices</h4><p>In microservice ecosystems, services constantly interact with external systems.</p><p>Hexagonal Architecture provides a clean separation between:</p><ul><li>Business capabilities</li><li>Transport protocols</li><li>Infrastructure concerns</li></ul><p>This makes services easier to evolve independently.</p><h3>⚠ Common Mistakes Teams Make</h3><h4>Turning Everything into Abstractions</h4><p>Not every class needs an interface.</p><p>Some teams over-engineer the architecture and create unnecessary complexity.</p><p>Hexagonal Architecture is about isolating meaningful boundaries, not generating extra files.</p><h4>Leaking Framework Logic into Domain</h4><p>The domain layer should not contain:</p><ul><li>Spring annotations</li><li>JPA entities tightly coupled with persistence</li><li>HTTP concepts</li></ul><p>Once infrastructure leaks inward, the architecture starts collapsing.</p><h4>Treating It as Folder Structure Only</h4><p>Many developers create packages like:</p><pre>ports/<br>adapters/<br>domain/</pre><p>but still tightly couple everything internally, Hexagonal Architecture is not about naming conventions.</p><p>It is about dependency direction.</p><h3>Real-World Example</h3><p>Imagine an airline booking system.</p><p>The core domain handles:</p><ul><li>Ticket booking</li><li>Reward points</li><li>Payment validation</li><li>Seat allocation</li></ul><p>The application might expose:</p><ul><li>REST APIs</li><li>Kafka events</li><li>Scheduled jobs</li><li>Admin dashboards</li></ul><p>It might integrate with:</p><ul><li>Payment gateways</li><li>Notification systems</li><li>External airline APIs</li></ul><p>With Hexagonal Architecture:</p><ul><li>The booking logic remains isolated</li><li>External integrations become adapters</li><li>Infrastructure can evolve independently</li></ul><p>This becomes extremely valuable in large-scale systems.</p><h3>Hexagonal Architecture with Spring Boot</h3><p>Frameworks like Spring Boot”, ”Java framework” work very well with Hexagonal Architecture when used correctly.</p><p>A common structure looks like:</p><pre>com.example<br> ├── domain<br> ├── application<br> ├── adapters<br> │    ├── inbound<br> │    └── outbound<br> └── configuration</pre><h4>Inbound Adapters</h4><ul><li>REST Controllers</li><li>GraphQL APIs</li><li>Kafka consumers</li></ul><h4>Outbound Adapters</h4><ul><li>JPA repositories</li><li>Redis</li><li>External APIs</li><li>Messaging systems</li></ul><h3>Hexagonal vs Layered Architecture</h3><p>Traditional layered architecture:</p><pre>Controller → Service → Repository</pre><p>Looks clean initially, but business logic often gets mixed with infrastructure.</p><p>Hexagonal Architecture focuses more on:</p><pre>Business Core ← Ports → Adapters</pre><p>The domain becomes the center instead of the framework.</p><h3>Is Hexagonal Architecture Always Necessary?</h3><p>Not always.</p><p>For:</p><ul><li>Small CRUD applications</li><li>Internal tools</li><li>Short-lived systems</li></ul><p>Traditional layered architecture may be perfectly fine.</p><p>But once systems start involving:</p><ul><li>Multiple integrations</li><li>Event-driven communication</li><li>Scalability requirements</li><li>Long-term maintainability</li><li>Complex business logic</li></ul><p>Hexagonal Architecture starts providing enormous value.</p><h3>Final Thoughts</h3><p>Hexagonal Architecture is not about making applications look “<em>architecturally advanced</em>.”</p><p>It is about protecting the most important part of the system:</p><p><em>The business logic - </em>As backend systems grow, infrastructure changes constantly.</p><p>Databases evolve.<br>Messaging systems change.<br>Frameworks get replaced.<br>Cloud providers shift.</p><p>But business rules often remain valuable for years.</p><p>Hexagonal Architecture ensures those rules stay isolated, testable, and resilient against external change.</p><p>At its core, it encourages a mindset that many mature engineering teams eventually realize:</p><blockquote><em>Frameworks should support the business.<br>The business should never depend on the framework.</em></blockquote><h3>What’s your take?</h3><p>Are you using Hexagonal Architecture in production systems?<br>Or do you still prefer traditional layered architecture for backend services?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30d51b9df4b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an AI Support Triage Agent: A Developer’s Journey]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/aimonks/building-an-ai-support-triage-agent-a-developers-journey-13d05a58b3fd?source=rss-b061864b94c------2"><img src="https://cdn-images-1.medium.com/max/959/0*JR9ClP7tnFeuq7C3.jpg" width="959"></a></p><p class="medium-feed-snippet">24 hours, 29 tickets, 4 edge cases, and countless trade-offs. Here&#x2019;s what I learned building a RAG-based support agent from scratch.</p><p class="medium-feed-link"><a href="https://medium.com/aimonks/building-an-ai-support-triage-agent-a-developers-journey-13d05a58b3fd?source=rss-b061864b94c------2">Continue reading on  . »</a></p></div>]]></description>
            <link>https://medium.com/aimonks/building-an-ai-support-triage-agent-a-developers-journey-13d05a58b3fd?source=rss-b061864b94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/13d05a58b3fd</guid>
            <category><![CDATA[customer-support]]></category>
            <category><![CDATA[ai-agents-in-action]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Anupam Haldkar]]></dc:creator>
            <pubDate>Sun, 03 May 2026 06:59:02 GMT</pubDate>
            <atom:updated>2026-08-29T12:18:10.726Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Check-ins before go-live Production]]></title>
            <link>https://medium.com/follower-booster-hub/check-ins-before-go-live-production-bdd86b582c25?source=rss-b061864b94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdd86b582c25</guid>
            <category><![CDATA[golive]]></category>
            <category><![CDATA[checksums]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[production]]></category>
            <dc:creator><![CDATA[Anupam Haldkar]]></dc:creator>
            <pubDate>Fri, 24 Apr 2026 14:31:45 GMT</pubDate>
            <atom:updated>2026-04-24T14:31:45.791Z</atom:updated>
            <content:encoded><![CDATA[<p>When an article talks about <strong>“gatehouse checks” in the context of check-ins before production</strong>, it’s referring to the final layer of validation that every change must pass before it is allowed into production.</p><h3>What “check-ins before production” really means</h3><p>it’s referring to:</p><p>👉 The <strong>controlled flow of a change</strong>:</p><pre>Dev → PR → CI → Staging → Gatehouse Checks → Production</pre><p>Gatehouse sits right before production as the <strong>final decision layer</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pFtOe_VjMNvSEDlJ9-O3Ew.png" /></figure><h3>🏗️ Internal Architecture View</h3><p>In mature systems (like big tech / fintech / SaaS):</p><p>👉 Gatehouse is often implemented as:</p><ul><li>A <strong>pipeline stage in CI/CD</strong></li><li>A <strong>policy engine</strong> (rules-based)</li><li>Sometimes a <strong>separate service</strong> enforcing release rules</li></ul><h3>Why most companies use it</h3><pre><br>Without gatehouse:<br> ❌ Direct deploy → risky<br> ❌ Hidden bugs → production outages<br> ❌ Security leaks → major incidents<br><br>With gatehouse:<br> ✅ Controlled releases<br> ✅ Predictable deployments<br> ✅ Audit trail of approvals</pre><p>Before diving deeper, here’s what typically falls under gatehouse checks in real-world systems:</p><h4><strong>Typical Gatehouse Checks (Real-world)</strong></h4><p><strong>1. Code &amp; Build Integrity</strong><br> Build success, unit and integration tests, and code review approvals</p><p><strong>2. Security &amp; Compliance</strong><br> Vulnerability scans, dependency checks, and secrets detection</p><p><strong>3. Quality Gates</strong><br> Code coverage thresholds, static analysis (like Sonar), and no critical issues</p><p><strong>4. Deployment Readiness</strong><br> Configuration validation, environment compatibility, and feature flags in place</p><p><strong>5. Pre-Production Validation</strong><br> Smoke tests in staging, API contract validation, and backward compatibility</p><p><strong>6. Manual / Organizational Approvals</strong><br> Tech lead approval, QA sign-off, and sometimes product/business approval</p><p>At a glance, this might look like just another checklist in a pipeline. But in practice, <strong>gatehouse checks represent something much more important — a controlled decision point</strong>.</p><p>By the time a change reaches this stage, it has already gone through development, peer review, and automated testing. Everything might look “green” on the surface. But experienced teams know that green pipelines don’t always guarantee production safety. Subtle issues — misconfigurations, edge-case failures, security gaps — often slip through earlier stages.</p><p>This is where gatehouse checks step in.</p><p>The process begins by ensuring <strong>code and build integrity</strong>, confirming that the artifact being deployed is stable, reproducible, and properly reviewed. This is the baseline — if this isn’t solid, nothing else matters.</p><p>From there, the focus expands to <strong>security and compliance</strong>, where the system verifies that the change doesn’t introduce vulnerabilities, unsafe dependencies, or exposed secrets. In many organizations, this is treated as a strict boundary, because the impact of security failures in production can be severe.</p><p>Next comes <strong>quality enforcement</strong>, where teams ensure that the codebase continues to meet defined standards. This includes coverage thresholds and static analysis checks, not just as metrics, but as safeguards to prevent long-term degradation of the system.</p><p>Equally important is <strong>deployment readiness</strong>. A change might be technically correct but still fail in production due to configuration mismatches or environment differences. Gatehouse checks validate that everything — from environment variables to feature flags — is correctly set up to support a safe rollout.</p><p>Before giving the final green signal, changes are typically verified in a <strong>pre-production or staging environment</strong>. This is where real-world conditions are simulated, ensuring that basic functionality works (via smoke tests), APIs remain compatible, and existing integrations are not broken.</p><p>What truly distinguishes gatehouse checks, however, is the inclusion of <strong>human and organizational validation</strong>. Automated systems can verify correctness, but they cannot fully assess impact. That’s why approvals from tech leads, QA engineers, or even product stakeholders are often required. This ensures that the change aligns not just with technical standards, but also with business expectations.</p><p>All these signals come together at a single point — the gatehouse — which acts as a <strong>hard boundary before production</strong>. If any requirement fails, the release does not proceed. There are no shortcuts here, because this layer is what gives teams confidence in their releases.</p><p>In well-structured systems, this is not just a process, but a philosophy. It ensures that every change, regardless of who made it, is held to the same standard before reaching users.</p><p>In simple terms, gatehouse checks are where a system pauses and asks:</p><blockquote>“Is this change not just working, but truly ready to be trusted in production?”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdd86b582c25" width="1" height="1" alt=""><hr><p><a href="https://medium.com/follower-booster-hub/check-ins-before-go-live-production-bdd86b582c25">Check-ins before go-live Production</a> was originally published in <a href="https://medium.com/follower-booster-hub">Follower Booster Hub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java Records vs Lombok]]></title>
            <link>https://anupamhaldkar.medium.com/java-records-vs-lombok-2016c9811881?source=rss-b061864b94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2016c9811881</guid>
            <category><![CDATA[lombok]]></category>
            <category><![CDATA[annotations]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[immutability]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Anupam Haldkar]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 14:39:52 GMT</pubDate>
            <atom:updated>2026-03-22T14:39:52.097Z</atom:updated>
            <content:encoded><![CDATA[<p>The Truth Experienced Developers Actually Care About</p><blockquote>“Lombok is dead. Java Records replaced it.”</blockquote><p>If you’ve been following Java discussions lately, you’ve probably seen this statement floating around blogs, X threads, and conference talks.</p><p>But as someone building real systems — not just toy examples — the reality is far more nuanced.</p><p>Let’s break it down from a <strong>practical, production-grade perspective</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qwT_bsesVOQvXnUtZXZHGQ.png" /><figcaption>records vs lombok</figcaption></figure><h4>The Intent Behind Java Records</h4><p>With modern versions of Java, <strong>Records</strong> were introduced to solve a very specific problem:</p><p>🔖 <em>Reducing boilerplate for immutable data carriers.</em></p><p>A simple example:</p><pre>public record User(String name, int age) {}</pre><p>Out of the box, this gives you:</p><ul><li><em>Constructor, Getters</em></li><li>equals() / hashCode()</li><li>toString()</li></ul><p>No annotations, No code generation, No surprises, That’s powerful.</p><h4>What Lombok Was Solving (and Still Does)</h4><p>Before records, most teams relied heavily on Project Lombok to reduce boilerplate.</p><pre>@Data<br>@AllArgsConstructor<br>public class User {<br>    private final String name;<br>    private final int age;<br>}</pre><p>But Lombok goes far beyond this:</p><ul><li>@Builder → Fluent object creation</li><li>@Slf4j → Logging</li><li>@Getter / @Setter → Fine control</li><li>@RequiredArgsConstructor → Dependency injection</li></ul><p>🔖 <em>Lombok is not just a DTO tool — it’s a </em><strong><em>developer productivity layer</em></strong><em>.</em></p><h4>Where Records Actually Shine</h4><p><strong>1. DTOs and API Models</strong></p><p>Records are perfect for:</p><ul><li>Request/Response objects</li><li>External API contracts</li><li>Lightweight data carriers</li></ul><p>Example:</p><pre>public record OrderResponse(String id, double amount) {}</pre><p><em>🔖 Clean, readable, and immutable by design.</em></p><p><strong>2. Functional and Data-Oriented Design</strong></p><p>Records push you toward:</p><ul><li>Immutable thinking</li><li>Safer concurrency</li><li>Predictable behavior</li></ul><p><em>🔖 Less bugs, fewer side effects.</em></p><p><strong>3. Reduced Magic</strong></p><p>With Lombok:</p><ul><li>Code is generated at compile time</li><li>IDE/debugging can sometimes be confusing</li></ul><p>With records:</p><p><em>🔖 What you see is what you get.</em></p><h4>Where Records Fall Short (Real-World Scenarios)</h4><p><strong>1. No Builder Pattern</strong></p><p>This is a big one</p><blockquote>With Lombok:</blockquote><pre>User user = User.builder()<br>    .name(&quot;Anupam&quot;)<br>    .age(25)<br>    .build();</pre><blockquote>With records:</blockquote><pre>User user = new User(&quot;Anupam&quot;, 25);</pre><p><em>🔖 Fine for small objects<br>🔖 Painful for large, optional-heavy models</em></p><p><strong>2. Immutability is Not Always Practical</strong></p><p>Records are:</p><p><em>🔖 Always immutable</em></p><p>But in real systems:</p><ul><li>State changes</li><li>Partial updates</li><li>ORM lifecycle</li></ul><p><em>🔖 You often need mutability.</em></p><p><strong>3. Framework Limitations</strong></p><p>In frameworks like Spring Boot:</p><p><strong>JPA / Hibernate issues:</strong></p><ul><li>No no-arg constructor ╳</li><li>Proxying limitations ╳</li><li>Lazy loading challenges ╳</li></ul><p>🔖<em> Records are NOT suitable for entities.</em></p><p><strong>4. Missing Ecosystem Features</strong></p><p>Lombok still provides:</p><ul><li>Logging (@Slf4j)</li><li>Constructors</li><li>Builders</li><li>Experimental features</li></ul><p><em>🔖 Records don’t aim to replace these.</em></p><h4>The Bigger Shift: Language vs Library vs Dead</h4><p>This is where things get interesting.</p><p>🔖 Records are a <strong>language feature</strong><br> 🔖 Lombok is a <strong>library workaround</strong></p><p>Java is slowly absorbing features that Lombok once solved. But <em>not</em> all of them.</p><p>Let’s be clear:</p><p>╳ Lombok is NOT obsolete<br>╳ Records do NOT replace Lombok</p><p>🔖<em> What is true:</em></p><blockquote><em>Records reduce the need for Lombok in simple use cases.</em></blockquote><h4>My Insight</h4><p>If you’re building real systems:</p><ul><li>Use <strong>Records</strong> for simple, immutable data</li><li>Use <strong>Lombok</strong> for flexibility and productivity</li><li>Don’t force one tool everywhere, The best teams use both strategically</li></ul><blockquote>╳ It’s not Records vs Lombok.<br> ✓ It’s Records + Lombok.</blockquote><h4>What do you think?</h4><p>Are you replacing Lombok with Records in your projects?<br> Or using both together?</p><p>Let’s discuss …</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2016c9811881" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monorepo vs Polyrepo: A Detailed Architecture Decision Guide]]></title>
            <link>https://anupamhaldkar.medium.com/monorepo-vs-polyrepo-a-detailed-architecture-decision-guide-e65a0f688c9d?source=rss-b061864b94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e65a0f688c9d</guid>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[monorepo]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[scale]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Anupam Haldkar]]></dc:creator>
            <pubDate>Sat, 28 Feb 2026 18:00:51 GMT</pubDate>
            <atom:updated>2026-02-28T18:00:51.291Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>their mechanics, trade-offs, tooling ecosystems, and the organizational contexts where each thrives.</strong></p><h3><strong>Overview</strong></h3><p>The question of how to organize source code across repositories is one of the most consequential and least reversible decisions in software architecture. It shapes how teams collaborate, how code is shared, how CI/CD pipelines run, and how the organization scales. Yet it is often made implicitly, by default, rather than deliberately.</p><p><strong>Key insight: </strong>Neither approach is universally superior. The right choice depends on your <em>team size</em>, codebase <em>interdependencies</em>, <em>deployment model</em>, and engineering maturity. Many mature organizations use a hybrid — a small number of monorepos organized around business domains, rather than one giant repo or hundreds of isolated ones.</p><h3><strong>Definitions</strong></h3><h4><strong>Monorepo</strong></h4><p>A monorepo (monolithic repository) stores all projects, services, libraries, and tools for an organization — or a significant subset — in a single version-controlled repository. Teams work from a shared history, shared toolchain, and shared dependency graph.</p><blockquote>Examples: Google (Piper / CitC), Meta (fbsource), Twitter, Airbnb, Uber, Microsoft (Windows), and open-source projects like Babel, Jest, and the AWS CDK.</blockquote><h4><strong>Polyrepo</strong></h4><p>A polyrepo strategy assigns each service, library, or component its own independent repository. Each team owns its repo entirely — its CI, its dependency versions, its release cadence.</p><blockquote>Examples: Most microservices organizations, GitHub itself, Stripe, HashiCorp, and the majority of enterprises running Kubernetes-based platforms.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BAVCewkevhCjQEz5uFpw8A.png" /></figure><h3><strong>The Case for Monorepo</strong></h3><h4><strong>Atomic cross-service changes</strong></h4><p>The single most compelling argument for a monorepo is the ability to make a change across multiple services or libraries in a single commit. When you rename an API, change a shared interface, or update a foundational library, every affected consumer is updated in the same PR. There is no “update consumers in a follow-up PR” — the entire change is consistent at every commit hash.</p><p>In a polyrepo world, this same change requires coordinating PRs across N repositories, managing version bumps, and accepting a period of inconsistency during rollout. The blast radius of a bad change is also harder to reason about.</p><h4><strong>Unified dependency management</strong></h4><p>one version of every third-party dependency used across all projects. This eliminates entire categories of problems:</p><ul><li>No diamond dependency conflicts between services that share a library</li><li>Security patches applied once, everywhere, in a single PR</li><li>Consistent behavior — all services test against the same runtime versions</li><li>Simpler auditing — one lockfile to review</li></ul><h4><strong>Developer experience and discoverability</strong></h4><p>A new engineer can clone one repository and have access to the entire codebase. They can grep globally, navigate with a single IDE, and understand system-wide behavior without context-switching between repos. Code review for cross-cutting changes happens in one place.</p><h4><strong>Simplified toolchain and standards enforcement</strong></h4><p>npm test or gradle build has consistent semantics across all projects.</p><h4><strong>Easier large-scale refactoring</strong></h4><p>With global search and replace, AST-based codemods, and unified test coverage, large refactors that would take weeks across a polyrepo can be done in hours. This is particularly powerful when evolving shared APIs, migrating frameworks, or enforcing new architectural patterns.</p><h4><strong>The cost: tooling investment</strong></h4><p>None of this comes free. A monorepo at scale requires specialized tooling to stay manageable:</p><ul><li><strong>Build systems: </strong>Bazel (Google’s open-source Blaze), Nx, Turborepo, Pants, Buck. These tools understand the dependency graph and only rebuild/retest what changed.</li><li><strong>CI intelligence: </strong>Naive CI that runs all tests on every PR becomes untenable at scale. Affected-only test selection and remote caching are prerequisites.</li><li>C<strong>ode ownership: </strong>CODEOWNERS files become complex. Clear governance is required to prevent the repo from becoming ungovernable.</li><li><strong>Repo size: </strong>Git performance degrades at large scales. Techniques like sparse checkout, partial clone, and virtual file systems (VFS for Git, used by Microsoft) become necessary.</li></ul><h3><strong>The Case for Polyrepo</strong></h3><h4><strong>Team autonomy and independent velocity</strong></h4><p>Each team owns their repository completely. They choose their dependency versions, their CI configuration, their release cadence, their branching strategy. There is no coordination overhead with other teams for routine changes. A team can move fast without impacting or requiring permission from others.</p><p>This is not just about speed — it’s about accountability. A team that fully owns a repository has a much clearer sense of responsibility for its health, test coverage, and operational state.</p><h4><strong>Independent deployment and versioning</strong></h4><p>Services can be versioned with independent semver, deployed on their own schedules, and rolled back without affecting other services. This is essential for microservices architectures where different services have radically different change frequencies — a payment service might deploy once a week, while an experimentation service deploys dozens of times a day.</p><h4><strong>Granular access control</strong></h4><p>In regulated industries (finance, healthcare, defense), access control is not optional. A polyrepo allows you to grant engineers access only to the repositories relevant to their role. In a monorepo, this is extremely difficult — you typically get all-or-nothing.</p><h4><strong>Smaller cognitive footprint</strong></h4><p>A developer working on a polyrepo service only needs to understand that service’s codebase. The repo is small, fast to clone, fast to search, and fast to build. CI is simple — you run the tests for this service, full stop.</p><h4><strong>Technology heterogeneity</strong></h4><p>Not all services need to use the same language, framework, or toolchain. A polyrepo naturally accommodates a Rust service, a Go service, and a Python service coexisting without forcing any shared build infrastructure. A monorepo effectively mandates convergence on tooling or requires a multi-language build system like Bazel.</p><h4><strong>The cost: integration friction</strong></h4><p>The primary tax of polyrepo is the friction introduced at integration points:</p><ul><li><strong>Dependency updates: </strong>Updating a shared library requires opening PRs in every consumer repo. Tooling like Renovate or Dependabot automates some of this, but the cognitive load remains.</li><li><strong>Cross-repo changes: </strong>A change that spans service boundaries requires multiple PRs, coordinated merges, and careful sequencing — or it requires deploying backward-compatible intermediates.</li><li><strong>Discovery: </strong>Finding code across hundreds of repos requires either good documentation or centralized search tooling (Sourcegraph, GitHub Code Search).</li><li><strong>Inconsistency drift: </strong>Without active enforcement, repos diverge — different versions of shared utilities, different linting rules, different test frameworks. This is entropy in action.</li></ul><h3><strong>Tooling Ecosystem</strong></h3><h4><strong>Monorepo tooling</strong></h4><ol><li><strong><em>Nx</em> - </strong>nx affected (run tasks only for changed projects), remote caching, and a dependency graph visualization. It integrates deeply with React, Angular, Node, and NestJS. Excellent for frontend-heavy organizations.</li></ol><p><strong>2. <em>Turborepo</em> -</strong>Acquired by Vercel, Turborepo focuses on task orchestration and caching for JavaScript/TypeScript monorepos. It is simpler than Nx with less opinion, making it easier to adopt incrementally. Ideal when you want fast CI without committing to a full framework.</p><p><strong><em>3. Bazel</em> -</strong> Google’s open-source build system, originally called Blaze. Truly language-agnostic (Java, Go, Python, Rust, C++, TypeScript). Understands the complete dependency graph and produces hermetic, reproducible builds. The learning curve is steep — BUILD files require significant up-front investment — but the ceiling is the highest of any build tool. Used by Google, Spotify, LinkedIn, Dropbox.</p><p><strong><em>4. Pants </em>- </strong>A Python-first build system inspired by Bazel with a gentler adoption curve. Strong support for Python, Go, Java, and Scala. Good choice for data engineering organizations where Python is dominant but build reproducibility matters.</p><h4><strong>Polyrepo tooling</strong></h4><ol><li><strong>Renovate / Dependabot - </strong>Automated dependency update bots that open PRs when new versions are available. Essential in polyrepo setups to prevent dependency rot. Renovate is more configurable and supports grouping updates across repos.</li><li><strong>Sourcegraph -</strong> Find all usages of this function across all repos becomes a first-class query. Also supports batch changes (automated PRs across hundreds of repos simultaneously).</li><li><strong>GitHub / GitLab / Bitbucket - </strong>Standard Git hosting platforms work naturally with polyrepo. Features like GitHub’s organization-level templates, required status checks, and CODEOWNERS apply per-repository.</li></ol><h3><strong>Real-World Strategies</strong></h3><h4><strong>Google’s approach: one giant monorepo</strong></h4><blockquote>Google maintains a single repository (Piper) containing the majority of its code — reportedly over 2 billion lines across 9 million source files. Every Googler works from tip-of-trunk. The key enablers are a custom distributed version control system, hermetic builds via Blaze/Bazel, and massive investment in test infrastructure. This is not a model most organizations can or should replicate directly.</blockquote><blockquote><strong>The lesson from Google is not “use a monorepo” — it’s that a monorepo at scale requires treating the build and developer experience as a product that dedicated engineering teams maintain.</strong></blockquote><h4>Meta’s approach: monorepo with smart tooling</h4><blockquote>Meta uses a monorepo (fbsource) with a custom DVCS (Sapling) optimized for large-scale use. Rather than committing to one build system, different parts of the organization use different tools. The shared infrastructure team invests heavily in making large-repo operations fast through lazy loading, virtual filesystems, and intelligent indexing.</blockquote><h4><strong>Netflix’s approach: polyrepo with strong conventions</strong></h4><blockquote>Netflix operates hundreds of independent microservice repositories. Consistency is maintained through shared tooling libraries, standardized CI templates, and a strong internal platform team (the Paved Road philosophy) that makes the right thing the easy thing. Engineers have high autonomy because the infrastructure team has done the work of making consistent patterns the path of least resistance.</blockquote><h4><strong>The “segmented monorepo” hybrid</strong></h4><blockquote>Many organizations land on a middle ground: a small number of monorepos organized by business domain or platform layer, rather than a single global repo or per-service repos. For example:</blockquote><ul><li>One monorepo for the frontend platform (web apps, design system, shared React components)</li><li>One monorepo for the data platform (ETL pipelines, ML infrastructure, analytics)</li><li>Separate repos for backend services that share little with each other</li></ul><p>This captures most of the atomic commit and code sharing benefits within domains while limiting the blast radius and tooling complexity of a single global repo.</p><h3><strong>Decision Guide</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-G0pGSoXnWK0oacD-rSiQ.png" /></figure><h3><strong>Migration Considerations</strong></h3><h4><strong>Polyrepo → Monorepo</strong></h4><p>Migrating to a monorepo is technically tractable but organizationally challenging. Git’s history can be preserved using tools like <strong>git subtree</strong> or <strong>git filter-repo</strong> to merge histories without losing blame and log. The harder problem is cultural: teams must accept shared ownership norms, agree on a unified toolchain, and buy into a shared CI infrastructure.</p><blockquote>The practical approach is incremental: start by migrating closely related services that already share significant code, prove the value, then expand. Avoid the “big bang” migration.</blockquote><h4><strong>Monorepo → Polyrepo</strong></h4><p><strong>git filter-repo</strong> tool can extract subdirectories with history, but the dependency graph must be explicitly modeled and versioned once things are separated.</p><p>This migration is most often motivated by access control requirements, team scaling challenges, or the need for genuinely independent deployment of services that have grown to have nothing in common.</p><h3><strong>Final recommendation:</strong></h3><p>Start with a monorepo. Migrate strategically when team autonomy, access control, or genuine independence of deployment becomes a bottleneck — not before. The cost of migration is real, but doing it once with a clear reason is far better than starting with a polyrepo and fighting integration friction before you have the engineering maturity to manage it well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e65a0f688c9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From JPA to jOOQ: A Spring Boot Developer’s Practical Guide]]></title>
            <link>https://medium.com/follower-booster-hub/from-jpa-to-jooq-a-spring-boot-developers-practical-guide-3c4c85369b08?source=rss-b061864b94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c4c85369b08</guid>
            <category><![CDATA[jooq]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[jpa]]></category>
            <category><![CDATA[spring]]></category>
            <dc:creator><![CDATA[Anupam Haldkar]]></dc:creator>
            <pubDate>Fri, 27 Feb 2026 14:52:08 GMT</pubDate>
            <atom:updated>2026-02-27T14:52:08.839Z</atom:updated>
            <content:encoded><![CDATA[<p>You know Spring Boot. You know JPA/Hibernate. Now let’s talk about why jOOQ might change how you think about database access — and how to wire it all up with a real working project.</p><p><strong>Why Even Consider jOOQ?</strong></p><p>If you’ve been building Spring Boot apps for a while, JPA feels like home. Annotations, repositories, entity relationships — it all just works. Until it doesn’t.</p><p>You’ve probably hit moments like these:</p><ul><li>Writing a @Query that&#39;s basically raw SQL anyway, but wrapped in JPQL</li><li>Trying to write a report query with 4 joins, grouping, and window functions — and watching Hibernate generate something unrecognizable</li><li>Debugging N+1 problems with @EntityGraph gymnastics</li><li>Crying into your coffee at the SQL Hibernate actually ran vs. what you intended</li></ul><p><strong>jOOQ (Java Object Oriented Querying)</strong> takes a different philosophy: SQL is not the enemy. SQL is powerful. Let’s write it in Java — type-safely, fluently, and with full control over what hits the database.</p><p>JPA is great for <strong>write-heavy, domain-driven</strong> applications where your object model maps cleanly to your schema. jOOQ shines for <strong>read-heavy, query-complex</strong> workloads where SQL is the natural expression.</p><p>Many production apps use <strong>both</strong> — JPA for entity persistence, jOOQ for complex reads. This guide will set you up for exactly that scenario.</p><h4>What We’re Building</h4><p>A simple <strong>Book Store API</strong> with:</p><ul><li>A books table and an authors table</li><li>CRUD via jOOQ (no JPA entities needed)</li><li>A complex reporting query (books with author info + aggregation)</li><li>Spring Boot 3.x, PostgreSQL, jOOQ 3.19</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uI2CTAlO3Ke-Ict8t6PrfQ.png" /></figure><p>Project structure:</p><p>bookstore/<br>├── src/main/java/com/example/bookstore/<br>│ ├── BookstoreApplication.java<br>│ ├── config/<br>│ │ └── JooqConfig.java<br>│ ├── repository/<br>│ │ ├── BookRepository.java<br>│ │ └── AuthorRepository.java<br>│ ├── service/<br>│ │ └── BookService.java<br>│ └── controller/<br>│ └── BookController.java<br>├── src/main/resources/<br>│ ├── application.yml<br>│ └── db/migration/<br>│ └── V1__init.sql<br>└── pom.xml</p><blockquote>Step 1: Project Setup</blockquote><blockquote>pom.xml</blockquote><pre>&lt;dependencies&gt;<br>    &lt;!-- Spring Boot --&gt;<br>    &lt;dependency&gt;<br>        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>        &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;<br>    &lt;/dependency&gt;<br>    &lt;dependency&gt;<br>        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>        &lt;artifactId&gt;spring-boot-starter-jooq&lt;/artifactId&gt;<br>    &lt;/dependency&gt;<br><br>    &lt;!-- Database --&gt;<br>    &lt;dependency&gt;<br>        &lt;groupId&gt;org.postgresql&lt;/groupId&gt;<br>        &lt;artifactId&gt;postgresql&lt;/artifactId&gt;<br>        &lt;scope&gt;runtime&lt;/scope&gt;<br>    &lt;/dependency&gt;<br><br>    &lt;!-- Flyway for migrations --&gt;<br>    &lt;dependency&gt;<br>        &lt;groupId&gt;org.flywaydb&lt;/groupId&gt;<br>        &lt;artifactId&gt;flyway-core&lt;/artifactId&gt;<br>    &lt;/dependency&gt;<br><br>    &lt;!-- Lombok --&gt;<br>    &lt;dependency&gt;<br>        &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;<br>        &lt;artifactId&gt;lombok&lt;/artifactId&gt;<br>        &lt;optional&gt;true&lt;/optional&gt;<br>    &lt;/dependency&gt;<br>&lt;/dependencies&gt;<br><br>&lt;build&gt;<br>    &lt;plugins&gt;<br>        &lt;!-- jOOQ Code Generator --&gt;<br>        &lt;plugin&gt;<br>            &lt;groupId&gt;org.jooq&lt;/groupId&gt;<br>            &lt;artifactId&gt;jooq-codegen-maven&lt;/artifactId&gt;<br>            &lt;executions&gt;<br>                &lt;execution&gt;<br>                    &lt;goals&gt;&lt;goal&gt;generate&lt;/goal&gt;&lt;/goals&gt;<br>                &lt;/execution&gt;<br>            &lt;/executions&gt;<br>            &lt;configuration&gt;<br>                &lt;jdbc&gt;<br>                    &lt;driver&gt;org.postgresql.Driver&lt;/driver&gt;<br>                    &lt;url&gt;jdbc:postgresql://localhost:5432/bookstore&lt;/url&gt;<br>                    &lt;user&gt;postgres&lt;/user&gt;<br>                    &lt;password&gt;postgres&lt;/password&gt;<br>                &lt;/jdbc&gt;<br>                &lt;generator&gt;<br>                    &lt;database&gt;<br>                        &lt;name&gt;org.jooq.meta.postgres.PostgresDatabase&lt;/name&gt;<br>                        &lt;includes&gt;.*&lt;/includes&gt;<br>                        &lt;excludes&gt;flyway_schema_history&lt;/excludes&gt;<br>                        &lt;inputSchema&gt;public&lt;/inputSchema&gt;<br>                    &lt;/database&gt;<br>                    &lt;target&gt;<br>                        &lt;packageName&gt;com.example.bookstore.jooq&lt;/packageName&gt;<br>                        &lt;directory&gt;src/main/java&lt;/directory&gt;<br>                    &lt;/target&gt;<br>                &lt;/generator&gt;<br>            &lt;/configuration&gt;<br>        &lt;/plugin&gt;<br>    &lt;/plugins&gt;<br>&lt;/build&gt;</pre><blockquote>Step 2: Database Schema &amp; Migration</blockquote><blockquote>src/main/resources/db/migration/V1__init.sql</blockquote><pre>CREATE TABLE authors (<br>    id         SERIAL PRIMARY KEY,<br>    name       VARCHAR(255) NOT NULL,<br>    country    VARCHAR(100),<br>    created_at TIMESTAMP DEFAULT NOW()<br>);<br><br>CREATE TABLE books (<br>    id          SERIAL PRIMARY KEY,<br>    title       VARCHAR(500) NOT NULL,<br>    author_id   INT REFERENCES authors(id),<br>    price       NUMERIC(10, 2) NOT NULL,<br>    genre       VARCHAR(100),<br>    published   DATE,<br>    created_at  TIMESTAMP DEFAULT NOW()<br>);<br><br>-- Seed data<br>INSERT INTO authors (name, country) VALUES<br>    (&#39;George Orwell&#39;, &#39;UK&#39;),<br>    (&#39;Haruki Murakami&#39;, &#39;Japan&#39;),<br>    (&#39;Chimamanda Ngozi Adichie&#39;, &#39;Nigeria&#39;);<br><br>INSERT INTO books (title, author_id, price, genre, published) VALUES<br>    (&#39;1984&#39;, 1, 12.99, &#39;Dystopian&#39;, &#39;1949-06-08&#39;),<br>    (&#39;Norwegian Wood&#39;, 2, 14.99, &#39;Literary Fiction&#39;, &#39;1987-09-04&#39;),<br>    (&#39;Americanah&#39;, 3, 13.99, &#39;Literary Fiction&#39;, &#39;2013-05-14&#39;),<br>    (&#39;Animal Farm&#39;, 1, 9.99, &#39;Political Satire&#39;, &#39;1945-08-17&#39;);</pre><blockquote>Step 3: application.yml</blockquote><pre>spring:<br>  datasource:<br>    url: jdbc:postgresql://localhost:5432/bookstore<br>    username: postgres<br>    password: postgres<br>    driver-class-name: org.postgresql.Driver<br><br>  flyway:<br>    enabled: true<br>    locations: classpath:db/migration<br><br>  jooq:<br>    sql-dialect: POSTGRES<br><br>logging:<br>  level:<br>    org.jooq.tools.LoggerListener: DEBUG  # See the SQL jOOQ generates</pre><p>Step 4: Generate the jOOQ Classes</p><p>Run Flyway migrations first, then generate:</p><pre># Start Postgres (Docker)<br>docker run -d --name bookstore-pg \<br>  -e POSTGRES_DB=bookstore \<br>  -e POSTGRES_PASSWORD=postgres \<br>  -p 5432:5432 postgres:16<br><br># Generate jOOQ classes from schema<br>mvn jooq-codegen:generate</pre><p>This creates classes under com.example.bookstore.jooq:</p><p>jooq/<br>├── Tables.java ← Table references (Tables.BOOKS, Tables.AUTHORS)<br>├── tables/<br>│ ├── Books.java ← Typed table with all columns<br>│ ├── Authors.java<br>│ └── records/<br>│ ├── BooksRecord.java ← ActiveRecord-style (optional)<br>│ └── AuthorsRecord.java</p><p>You’ll use Tables.BOOKS, Tables.AUTHORS, and column fields like Tables.BOOKS.TITLE throughout your queries.</p><blockquote>Step 5: jOOQ Configuration</blockquote><p>Spring Boot auto-configures jOOQ’s DSLContext via the spring-boot-starter-jooq dependency. You just inject it. But let&#39;s add explicit config for clarity:</p><blockquote>config/JooqConfig.java</blockquote><pre>@Configuration<br>public class JooqConfig {<br><br>    // Spring Boot auto-creates DSLContext from your DataSource + sql-dialect<br>    // This bean is available for injection anywhere in your app.<br><br>    // Optional: customize exception translation<br>    @Bean<br>    public DefaultConfigurationCustomizer jooqCustomizer() {<br>        return config -&gt; config<br>            .settings()<br>            .withRenderFormatted(true)           // Pretty-print SQL in logs<br>            .withExecuteLogging(true);           // Log all queries<br>    }<br>}</pre><p>Step 6: The Repository Layer</p><p>This is where jOOQ gets fun. Compare these two approaches side by side:</p><blockquote>With JPA (what you know)</blockquote><pre>// Interface magic — convenient but opaque<br>public interface BookRepository extends JpaRepository&lt;Book, Long&gt; {<br>    List&lt;Book&gt; findByGenreOrderByPriceDesc(String genre);<br><br>    @Query(&quot;SELECT b FROM Book b JOIN FETCH b.author WHERE b.price &lt; :price&quot;)<br>    List&lt;Book&gt; findCheapBooks(@Param(&quot;price&quot;) BigDecimal price);<br>}</pre><blockquote>With jOOQ (explicit, composable, powerful)</blockquote><pre>// repository/BookRepository.java<br>@Repository<br>@RequiredArgsConstructor<br>public class BookRepository {<br><br>    private final DSLContext dsl;<br><br>    // Static imports make queries cleaner<br>    // import static com.example.bookstore.jooq.Tables.*;<br><br>    public List&lt;BookRecord&gt; findAll() {<br>        return dsl<br>            .selectFrom(BOOKS)<br>            .orderBy(BOOKS.CREATED_AT.desc())<br>            .fetchInto(BookRecord.class);<br>    }<br><br>    public Optional&lt;BookRecord&gt; findById(int id) {<br>        return dsl<br>            .selectFrom(BOOKS)<br>            .where(BOOKS.ID.eq(id))<br>            .fetchOptionalInto(BookRecord.class);<br>    }<br><br>    public List&lt;BookRecord&gt; findByGenre(String genre) {<br>        return dsl<br>            .selectFrom(BOOKS)<br>            .where(BOOKS.GENRE.eq(genre))<br>            .orderBy(BOOKS.PRICE.desc())<br>            .fetchInto(BookRecord.class);<br>    }<br><br>    public int create(String title, int authorId, BigDecimal price, String genre) {<br>        return dsl<br>            .insertInto(BOOKS)<br>            .set(BOOKS.TITLE, title)<br>            .set(BOOKS.AUTHOR_ID, authorId)<br>            .set(BOOKS.PRICE, price)<br>            .set(BOOKS.GENRE, genre)<br>            .set(BOOKS.PUBLISHED, LocalDate.now())<br>            .returningResult(BOOKS.ID)<br>            .fetchOne()<br>            .getValue(BOOKS.ID);<br>    }<br><br>    public int update(int id, BigDecimal newPrice) {<br>        return dsl<br>            .update(BOOKS)<br>            .set(BOOKS.PRICE, newPrice)<br>            .where(BOOKS.ID.eq(id))<br>            .execute();<br>    }<br><br>    public int delete(int id) {<br>        return dsl<br>            .deleteFrom(BOOKS)<br>            .where(BOOKS.ID.eq(id))<br>            .execute();<br>    }<br>}</pre><p>Notice what’s happening: every query is <strong>readable as SQL</strong>, but expressed in Java with full type checking. If you rename a column in your schema, regenerate jOOQ classes, and your code <strong>won’t compile</strong> until you fix it. That’s the contract. 🤝</p><blockquote>Step 7: Complex Queries — Where jOOQ Earns Its Keep</blockquote><p>Here’s a query that would be awkward in JPQL but reads naturally in jOOQ:</p><pre>// DTO Record for the result<br>public record BookWithAuthorDto(<br>    int bookId,<br>    String title,<br>    String authorName,<br>    String country,<br>    BigDecimal price,<br>    String genre<br>) {}<br><br>// repository/BookRepository.java (continued)<br><br>public List&lt;BookWithAuthorDto&gt; findBooksWithAuthor() {<br>    return dsl<br>        .select(<br>            BOOKS.ID,<br>            BOOKS.TITLE,<br>            AUTHORS.NAME.as(&quot;author_name&quot;),<br>            AUTHORS.COUNTRY,<br>            BOOKS.PRICE,<br>            BOOKS.GENRE<br>        )<br>        .from(BOOKS)<br>        .join(AUTHORS).on(BOOKS.AUTHOR_ID.eq(AUTHORS.ID))<br>        .orderBy(BOOKS.PRICE.desc())<br>        .fetchInto(BookWithAuthorDto.class);<br>}<br><br>// Aggregation: author stats<br>public record AuthorStatsDto(String authorName, int bookCount, BigDecimal avgPrice) {}<br><br>public List&lt;AuthorStatsDto&gt; getAuthorStats() {<br>    return dsl<br>        .select(<br>            AUTHORS.NAME,<br>            DSL.count(BOOKS.ID).as(&quot;book_count&quot;),<br>            DSL.avg(BOOKS.PRICE).as(&quot;avg_price&quot;)<br>        )<br>        .from(AUTHORS)<br>        .leftJoin(BOOKS).on(BOOKS.AUTHOR_ID.eq(AUTHORS.ID))<br>        .groupBy(AUTHORS.ID, AUTHORS.NAME)<br>        .having(DSL.count(BOOKS.ID).gt(0))<br>        .orderBy(DSL.count(BOOKS.ID).desc())<br>        .fetchInto(AuthorStatsDto.class);<br>}</pre><p>Try writing that getAuthorStats() query in JPA&#39;s Criteria API. Then come back and appreciate this.</p><blockquote>Step 8: Transactions</blockquote><p>jOOQ respects Spring’s @Transactional out of the box — no extra config needed.</p><pre>// service/BookService.java<br>@Service<br>@RequiredArgsConstructor<br>@Transactional<br>public class BookService {<br><br>    private final BookRepository bookRepository;<br>    private final AuthorRepository authorRepository;<br><br>    public int createBookWithNewAuthor(String authorName, String country,<br>                                       String title, BigDecimal price, String genre) {<br>        // Both operations run in the same transaction<br>        int authorId = authorRepository.create(authorName, country);<br>        return bookRepository.create(title, authorId, price, genre);<br>    }<br><br>    @Transactional(readOnly = true)<br>    public List&lt;BookWithAuthorDto&gt; getAllBooksWithAuthors() {<br>        return bookRepository.findBooksWithAuthor();<br>    }<br>}</pre><pre>// controller/BookController.java<br>@RestController<br>@RequestMapping(&quot;/api/books&quot;)<br>@RequiredArgsConstructor<br>public class BookController {<br><br>    private final BookService bookService;<br>    private final BookRepository bookRepository;<br><br>    @GetMapping<br>    public List&lt;BookWithAuthorDto&gt; getAll() {<br>        return bookService.getAllBooksWithAuthors();<br>    }<br><br>    @GetMapping(&quot;/{id}&quot;)<br>    public ResponseEntity&lt;BookRecord&gt; getById(@PathVariable int id) {<br>        return bookRepository.findById(id)<br>            .map(ResponseEntity::ok)<br>            .orElse(ResponseEntity.notFound().build());<br>    }<br><br>    @GetMapping(&quot;/genre/{genre}&quot;)<br>    public List&lt;BookRecord&gt; getByGenre(@PathVariable String genre) {<br>        return bookRepository.findByGenre(genre);<br>    }<br><br>    @GetMapping(&quot;/stats/authors&quot;)<br>    public List&lt;AuthorStatsDto&gt; getAuthorStats() {<br>        return bookRepository.getAuthorStats();<br>    }<br><br>    @PostMapping<br>    @ResponseStatus(HttpStatus.CREATED)<br>    public Map&lt;String, Integer&gt; create(@RequestBody CreateBookRequest req) {<br>        int id = bookRepository.create(req.title(), req.authorId(), req.price(), req.genre());<br>        return Map.of(&quot;id&quot;, id);<br>    }<br><br>    @PatchMapping(&quot;/{id}/price&quot;)<br>    public Map&lt;String, Integer&gt; updatePrice(@PathVariable int id,<br>                                             @RequestBody Map&lt;String, BigDecimal&gt; body) {<br>        int rows = bookRepository.update(id, body.get(&quot;price&quot;));<br>        return Map.of(&quot;updated&quot;, rows);<br>    }<br><br>    @DeleteMapping(&quot;/{id}&quot;)<br>    public Map&lt;String, Integer&gt; delete(@PathVariable int id) {<br>        int rows = bookRepository.delete(id);<br>        return Map.of(&quot;deleted&quot;, rows);<br>    }<br>}<br><br>record CreateBookRequest(String title, int authorId, BigDecimal price, String genre) {}</pre><blockquote>Step 10: Run It</blockquote><pre>mvn spring-boot:run</pre><p>Test the endpoints:</p><pre># Get all books with author info<br>curl http://localhost:8080/api/books<br><br># Get books by genre<br>curl http://localhost:8080/api/books/genre/Dystopian<br><br># Author stats<br>curl http://localhost:8080/api/books/stats/authors<br><br># Create a book<br>curl -X POST http://localhost:8080/api/books \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;title&quot;:&quot;Kafka on the Shore&quot;,&quot;authorId&quot;:2,&quot;price&quot;:15.99,&quot;genre&quot;:&quot;Magical Realism&quot;}&#39;</pre><p>With org.jooq.tools.LoggerListener: DEBUG enabled, you&#39;ll see the exact SQL in your logs — no surprises.</p><h3>Bonus: Using jOOQ and JPA Together</h3><p>This is the real-world pattern. Keep JPA for simple entity persistence, add jOOQ for complex reads:</p><pre>@Service<br>@RequiredArgsConstructor<br>public class HybridBookService {<br><br>    private final BookJpaRepository jpaRepo;   // Spring Data JPA<br>    private final BookRepository jooqRepo;     // jOOQ<br><br>    // Simple save? JPA is fine.<br>    public Book save(Book book) {<br>        return jpaRepo.save(book);<br>    }<br><br>    // Complex report? jOOQ all the way.<br>    public List&lt;AuthorStatsDto&gt; getAuthorReport() {<br>        return jooqRepo.getAuthorStats();<br>    }<br>}</pre><p>Both share the same DataSource and transaction manager. They coexist without conflict.</p><h4>When to Choose What</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/0*4xfvAvpfWOkiAyem" /></figure><p><strong>Reach for jOOQ when:</strong></p><ul><li>Your query involves multiple joins, aggregations, or window functions</li><li>You need guaranteed, predictable SQL output</li><li>You’re building reports, dashboards, or analytics endpoints</li><li>You want compile-time safety on schema changes</li></ul><p><strong>Stick with JPA when:</strong></p><ul><li>Simple CRUD with no complex reads</li><li>Your domain model is the center of the app</li><li>You rely heavily on lazy loading and entity relationships</li><li>Your team is more comfortable with the ORM mental model</li></ul><h3>Key Takeaways</h3><p>jOOQ doesn’t replace JPA — it fills the gaps JPA was never designed for. Once you write your first complex join or aggregation query in jOOQ and see clean, predictable SQL in your logs, you’ll reach for it again. The type-safe DSL pays dividends every time your schema changes and your IDE catches the breakage before your tests do.</p><p>The code generator is the secret weapon. Run it, commit the generated classes, and treat your schema as the source of truth. That’s the jOOQ way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c4c85369b08" width="1" height="1" alt=""><hr><p><a href="https://medium.com/follower-booster-hub/from-jpa-to-jooq-a-spring-boot-developers-practical-guide-3c4c85369b08">From JPA to jOOQ: A Spring Boot Developer’s Practical Guide</a> was originally published in <a href="https://medium.com/follower-booster-hub">Follower Booster Hub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[12-Factor App Principles Applied to Microservices (With Real-World Meaning)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/follower-booster-hub/12-factor-app-principles-applied-to-microservices-with-real-world-meaning-ddd8fa5ca579?source=rss-b061864b94c------2"><img src="https://cdn-images-1.medium.com/max/1536/1*9f6z7Ww5kzo2mugqBaCo0w.png" width="1536"></a></p><p class="medium-feed-snippet">Microservices fail not because of scale, but because of poor operational discipline.</p><p class="medium-feed-link"><a href="https://medium.com/follower-booster-hub/12-factor-app-principles-applied-to-microservices-with-real-world-meaning-ddd8fa5ca579?source=rss-b061864b94c------2">Continue reading on Follower Booster Hub »</a></p></div>]]></description>
            <link>https://medium.com/follower-booster-hub/12-factor-app-principles-applied-to-microservices-with-real-world-meaning-ddd8fa5ca579?source=rss-b061864b94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddd8fa5ca579</guid>
            <category><![CDATA[web-dev-projects]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[12-factor-app]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Anupam Haldkar]]></dc:creator>
            <pubDate>Sat, 10 Jan 2026 00:37:29 GMT</pubDate>
            <atom:updated>2026-01-10T00:37:29.608Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Apache Druid Deep Dive: Internals, Query Execution & Why It’s Blazingly Fast]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/follower-booster-hub/apache-druid-deep-dive-internals-query-execution-why-its-blazingly-fast-dff6cf9aefba?source=rss-b061864b94c------2"><img src="https://cdn-images-1.medium.com/max/1536/1*gB4oUARv0tLieuGr08lKMA.png" width="1536"></a></p><p class="medium-feed-snippet">Apache Druid Deep Dive: Internals, Query Execution &amp; Why It&#x2019;s Blazingly Fast</p><p class="medium-feed-link"><a href="https://medium.com/follower-booster-hub/apache-druid-deep-dive-internals-query-execution-why-its-blazingly-fast-dff6cf9aefba?source=rss-b061864b94c------2">Continue reading on Follower Booster Hub »</a></p></div>]]></description>
            <link>https://medium.com/follower-booster-hub/apache-druid-deep-dive-internals-query-execution-why-its-blazingly-fast-dff6cf9aefba?source=rss-b061864b94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/dff6cf9aefba</guid>
            <category><![CDATA[query]]></category>
            <category><![CDATA[druid]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Anupam Haldkar]]></dc:creator>
            <pubDate>Sun, 21 Dec 2025 00:35:28 GMT</pubDate>
            <atom:updated>2025-12-21T00:35:28.431Z</atom:updated>
        </item>
    </channel>
</rss>