<?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 Carol Mendonca on Medium]]></title>
        <description><![CDATA[Stories by Carol Mendonca on Medium]]></description>
        <link>https://medium.com/@carol18012000?source=rss-ba209e116ac1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wBR2aLEEXBhrDONqWvnQMA.jpeg</url>
            <title>Stories by Carol Mendonca on Medium</title>
            <link>https://medium.com/@carol18012000?source=rss-ba209e116ac1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 16:13:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@carol18012000/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[System Design Estimation Cheat Sheet]]></title>
            <link>https://medium.com/@carol18012000/system-design-estimation-cheat-sheet-4ed110603266?source=rss-ba209e116ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ed110603266</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Carol Mendonca]]></dc:creator>
            <pubDate>Sun, 10 May 2026 17:41:27 GMT</pubDate>
            <atom:updated>2026-05-10T17:41:27.924Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NnM84ON8GQJ-Vx3FRCgStQ.jpeg" /></figure><p>When designing large-scale systems, you won’t always have precise numbers. Yet, you’re still expected to make decisions about scalability, storage, and performance.</p><p>This is where back-of-the-envelope calculations come in. This will help you estimate quickly, reason clearly, and avoid bad design decisions early.</p><h3>What Are Back-of-the-Envelope Calculations?</h3><p>Back-of-the-envelope calculations are rough, quick estimations used to understand the scale of a system without needing exact data.</p><h3>Common Things You Estimate</h3><ul><li>RPS (Requests per second)</li><li>QPS (Queries Per second)</li><li>Storage Estimation</li><li>Bandwidth</li><li>Latency</li><li>Throughput</li><li>Read/Write Ratio</li></ul><h3><strong>RPS (Requests per second)</strong></h3><p>RPS refers to the total number of requests received by a server in one second. This metric encompasses all types of requests, including those for static resources (like images) and dynamic content (like API calls).</p><pre>RPS = Total Requests / Total Time (in seconds)</pre><p>Just RPS alone is not very meaningful, since system load depends more on what each request does than how many there are.</p><h3><strong>QPS (Queries Per second)</strong></h3><p>QPS focuses on the interactions with the database layer, indicating how many queries are processed within a second</p><pre>QPS = Total Queries / Total Time (in seconds)</pre><ul><li><strong>Low QPS: &lt; 100 QPS:</strong> At this level, a traditional monolithic architecture can often suffice</li><li><strong>Medium QPS: 100–1,000 QPS : </strong>At this stage, monolithic architecture may struggle and horizontal scaling, caching and decoupling become more important.</li><li><strong>High QPS: 1,000–100,000 QPS: </strong>Microservices, message queues, redundancy, and distributed systems are commonly adopted to meet these needs.</li><li><strong>Very High QPS: &gt; 100,000QPS:</strong> Systems must be highly distributed and resilient, leveraging multi-region deployments, global replication, CDNs.</li></ul><h3><strong>Storage Estimation</strong></h3><p>Storage Estimation helps ensure the system can handle long-term data growth and prevent capacity issues. For storage estimation, the key factors are:</p><ul><li><strong>Number of write queries- </strong>Only write operations increase storage; read queries do not.</li><li><strong>Size of each record- </strong>Determines how much space each operation consumes.</li><li><strong>Data retention period- </strong>Defines how long the data will be kept, which affects long-term capacity planning.</li></ul><pre>Storage Estimation=No. Write Queries × Size per Record × Retention Period Factor</pre><ul><li><strong>Low&lt; 1 TB: </strong>Single database instance is sufficient; simple backup; minimal partitioning.</li><li><strong>Medium 1–10 TB: </strong>Start partitioning tables; consider replication for fault tolerance.</li><li><strong>High 10–100 TB: </strong>Introduce sharding; multi-region replication; use distributed storage (e.g., S3, HDFS); optimize writes; implement archiving policies.</li><li><strong>Very High&gt; 100 TB: </strong>Fully distributed architecture; multi-cloud or multi-region deployment; tiered storage (hot, warm, cold); automatic archiving and pruning; advanced monitoring for capacity.</li></ul><h3>Read/Write Ratio</h3><p>The <strong>Read/Write Ratio</strong> represents how many read operations occur compared to write operations in a system. It’s a critical metric that helps you understand workload patterns and choose the right architecture.</p><ul><li>Helps decide whether to optimize for reads (e.g., caching, CDNs, replicas) or writes (e.g., batching, queues).</li><li>Influences database design (read replicas vs write-optimized stores).</li><li>Impacts scaling strategy and cost.</li></ul><pre>Read/Write Ratio = Number of Reads : Number of Writes</pre><ul><li><strong>Read-heavy systems (80:20, 90:10):</strong> Optimize reads: caching, replicas, CDN</li><li><strong>Balanced systems (50:50, 60:40):</strong> Optimize both paths</li><li><strong>Write-heavy systems (20:80, 10:90)</strong>: Optimize writes: batching, queues</li></ul><h3><strong>Bandwidth</strong></h3><p>Bandwidth measures <strong>how much data is transferred per unit time</strong>. Estimating it is critical to ensure your network and servers can handle peak load without bottlenecks. Mostly calculated for media heavy services.</p><pre>Bandwidth (per second)=QPS × Average Response Size</pre><h3><strong>Latency</strong></h3><p>Latency is the delay between when a client makes a request and when it begins to receive the first byte of the response.</p><h4>Rough Latency Reference</h4><ul><li>Memory access → ~100 ns</li><li>SSD → ~100 µs</li><li>Network call → ~1–10 ms</li><li>DB query → ~5–50 ms</li></ul><h3>Throughput</h3><p>Throughput is defined as the amount of information or the number of transactions a system can process within a given period.</p><pre>#Basic Formula (Most Common)<br>Throughput = Requests per second × Data per request<br><br>#In Terms of Time<br>Throughput = Total data processed / Total time<br><br>#Using Concurrency (Little Advanced)<br>Throughput = Concurrent requests / Average response time</pre><p>It’s important to understand that throughput by itself is not enough to evaluate a system’s performance. Two systems can have the same throughput but behave very differently depending on their request patterns.Let’s look at two scenarios:</p><p>Consider a system that streams high-quality videos.</p><ul><li>Average data per request: 200 MB</li><li>Requests per second: 5</li></ul><p>Throughput = 5 × 200 MB = 1000 MB/s</p><p>Now consider a backend service that sends notifications (likes, messages, alerts).</p><ul><li>Average data per request: 0.5 MB</li><li>Requests per second: 2000</li></ul><p>Throughput = 2000 × 0.5 MB = 1000 MB/s</p><p>The streaming service handles only 5 requests/sec while the notification system handles 2000 requests/sec</p><h3>Core Conversions (Memorize These)</h3><ul><li>1 KB ≈ 10³ bytes</li><li>1 MB ≈ 10⁶ bytes</li><li>1 GB ≈ 10⁹ bytes</li><li>1 TB ≈ 10¹² bytes</li><li>1 day = 86,400 seconds</li><li>1 million = 10⁶</li><li>1 billion = 10⁹</li></ul><h3>Example: Calculating RPS, QPS, Throughput, and Storage Estimation</h3><h4>Scenario</h4><ul><li>A website has 1 million users per day</li><li>Each user makes 10 requests/day</li><li>Each request triggers:</li><li>1 read query + 1 write query = 2 database queries</li><li>Each write stores 1 KB of data</li><li>Each request/response size ≈ 2 KB</li><li>Data Retention Period= 1 year</li></ul><h4>Step 1: Calculate Total Requests per Day</h4><p>Total requests = Users × Requests per user<br>Total requests = 1,000,000 × 10 = 10,000,000 requests/day</p><h4>Step 2: Convert to RPS (Requests Per Second)</h4><p>RPS = Total requests / Seconds in a day<br>RPS = 10,000,000 / 86,400<br>RPS ≈ 116</p><h4>Step 3: Calculate Total Queries per Day</h4><p>Each request = 2 queries<br>Total queries = 10,000,000 × 2 = 20,000,000 queries/day</p><h4>Step 4: Calculate QPS (Queries Per Second)</h4><p>QPS = Total queries / Seconds in a day<br>QPS = 20,000,000 / 86,400<br>QPS ≈ 231</p><h4>Step 5: Calculate Throughput</h4><p>Throughput = RPS × Data per request<br>Throughput = 116 × 2 KB<br>Throughput ≈ 232 KB/s</p><h4>Step 6: Storage Estimation</h4><p>Only writes consume storage<br>Total writes per day = 10,000,000<br>Each write = 1 KB<br>Storage per day = 10,000,000 × 1 KB = 10 GB/day</p><h4>Step 7: Read/Write Ratio</h4><p>Each request triggers: 1 read + 1 write<br>Total reads per day = 10,000,000<br>Total writes per day = 10,000,000<br>Read/Write Ratio = 1:1 (or 50% reads, 50% writes)</p><h4>Final Summary</h4><p>On average, the database handles ~231 queries/sec<br>Design for peak: <strong>500–1000 QPS</strong></p><ul><li><strong>RPS</strong> ≈ 116 requests/sec</li><li><strong>QPS</strong> ≈ 231 queries/sec</li><li><strong>Throughput</strong> ≈ 232 KB/s</li><li><strong>Storage</strong> ≈ 10 GB/day</li><li><strong>Read/Write Ratio</strong> ≈ 1:1</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ed110603266" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inside Online Payments: System Design of Stripe (Phase 1: Authorization)]]></title>
            <link>https://medium.com/@carol18012000/inside-online-payments-system-design-of-stripe-phase-1-authorization-1fb6f59951a4?source=rss-ba209e116ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fb6f59951a4</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Carol Mendonca]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 02:27:37 GMT</pubDate>
            <atom:updated>2026-04-14T02:27:37.588Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X3AtWjO2_0z21FUadlxi3A.png" /></figure><p>In today’s digital world, seamless payments are something users expect — not notice. Whether you’re buying a product online or subscribing to a service, the experience feels instant and reliable.Behind this simplicity lies a complex distributed system.</p><p>In this article, we’ll break down how an online payments platform like Stripe, is designed at a system level.</p><h3>What Are We Building?</h3><p>We are designing an online payments platform similar to <strong>Stripe</strong> — a system that enables businesses to accept and manage digital payments efficiently and securely.</p><h4>Functional Requirements</h4><ul><li>Accept payments (cards, wallets, bank transfers)</li><li>Process transactions via banking networks</li><li>Store transaction history</li><li>Support refunds and cancellations</li><li>Notify merchants of payment status</li></ul><h4>Non-Functional Requirements</h4><ul><li>High availability (payments should never go down)</li><li>Strong consistency (no double charges, no missing money)</li><li>Low latency (responses within seconds)</li><li>High security (PCI compliance, encryption)</li></ul><h3>The Three Phases of a Bank Transaction</h3><h4>Phase 1: Authorization (The “Promise”)</h4><ul><li><strong>Timing</strong>: Instant (Real-time).</li><li><strong>Action</strong>: When a user pays, the merchant requests a “hold” on the funds. The Issuing Bank (user’s bank) checks for sufficient balance and fraud risk.</li><li><strong>Outcome</strong>: If approved, the customer’s available balance drops immediately, but the money remains in their account. It is essentially a guaranteed promise to pay.</li></ul><h4>Phase 2: Settlement (The “Movement”)</h4><ul><li><strong>Timing</strong>: T+1 to T+3 business days.</li><li><strong>Action</strong>: At the end of the day, the merchant “captures” their batch of approved authorizations. The Merchant’s bank requests the actual cash from the Issuing Bank via the card network.</li><li><strong>Outcome</strong>: The actual transfer of value occurs. The merchant receives the funds in their bank account, minus processing fees (interchange).</li></ul><h4>Phase 3: Reconciliation (The “Audit”)</h4><ul><li><strong>Timing</strong>: Post-settlement (Daily or Monthly).</li><li><strong>Action</strong>: The merchant’s internal systems compare three data points: internal order logs, processor reports (e.g., Stripe), and actual bank deposits.</li><li><strong>Outcome</strong>: This ensures every transaction is accounted for. It is the critical final step for identifying “breaks,” such as missing payments, fees, or disputed charges (chargebacks).</li></ul><p>In this article, we will walk through Phase 1 of the end-to-end payment flow.</p><h3>What happens?</h3><p>Before integration begins, a business like Amazon creates and verifies an account with <strong>Stripe</strong>. Stripe then provides three key components:</p><ul><li><strong>Publishable Key</strong> — Public, used in the frontend to collect payment details</li><li><strong>Secret Key</strong> — Private, stored on the backend for sensitive operations</li><li><strong>Webhook URL</strong> — Backend endpoint to receive real-time payment updates</li></ul><p>This setup ensures the frontend can safely handle user input, while all critical payment actions are securely managed on the backend.</p><h3>End-to-End Payment Flow</h3><h4>Step 0: Pre-requisites</h4><p>Before any payment is initiated:</p><ul><li>The <strong>backend</strong> securely stores the <strong>Secret Key</strong></li><li>The <strong>frontend</strong> uses the <strong>Publishable Key</strong></li><li>A <strong>webhook endpoint</strong> is pre-registered to receive payment updates</li></ul><h4>Step 1: User Initiates Checkout (Frontend → Backend)</h4><p>When a user clicks <strong>“Buy Now”</strong> on a $50 product on an online platform like Amazon, the frontend sends a <strong>Create Payment Intent</strong> request to the backend to initiate the payment process.</p><pre>POST /create-payment-intent</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NHzdvpJA_mRMLBpgsIGBDw.png" /></figure><h4>Step 2: Backend Creates Payment Intent (Backend → Stripe)</h4><p>The backend creates a <strong>Payment Intent</strong> containing the amount, currency, and metadata (such as orderId and userId). It then calls <strong>Stripe’s API</strong>, including the <strong>Secret Key</strong> in the Authorization header to authenticate the request. <em>(Important: the Secret Key must never be exposed in the frontend.)</em></p><pre>POST /v1/payment_intents<br>Authorization: Bearer &lt;SECRET_KEY&gt;</pre><p>A <strong>Payment Intent</strong> acts like a <strong>state machine</strong> to track the lifecycle of a payment:</p><ul><li>requires_payment_method – Waiting for payment details</li><li>requires_action – Additional user authentication needed</li><li>processing – Payment is being processed</li><li>succeeded – Payment completed successfully</li><li>failed – Payment could not be completed</li></ul><p>This is essential because payments are <strong>not instant or guaranteed</strong>, and tracking their state ensures reliability and proper handling of each step.</p><p>Note: To guarantee consistency and prevent accidental double charges such as when a user double-clicks the ‘Pay’ button, the backend must include a unique <strong>Idempotency Key</strong> (typically the orderId) in the header of the Stripe API request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nXwmQ-zDolSBrpzWAR2TUQ.png" /></figure><h4>Step 3: Stripe Returns Client Secret (Stripe -&gt; Backend -&gt; Frontend)</h4><p>When Stripe receives the request:</p><ol><li>Validates the <strong>Secret Key</strong></li><li>Maps it to a <strong>merchant account</strong></li><li>Creates the PaymentIntent under that merchant</li><li>Stripe creates a client_secret for respective PaymentIntent</li><li>Stripe responds with the client_secret</li><li>Backend sends it to frontend.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ssnit_TlCFbrf099Fv5WaQ.png" /></figure><h4>Step 4: Frontend Confirms Payment (Frontend → Stripe)</h4><p>Using the <strong>Stripe SDK</strong>:</p><ul><li>The <strong>Publishable Key</strong> is used on the frontend to safely identify the merchant.</li><li>Payment details, such as card information, are entered into <strong>Stripe-hosted fields</strong>.</li></ul><p>What Frontend does:</p><pre><br>const stripe = Stripe(&quot;pk_live_abc123&quot;); // publishable key<br><br>const elements = stripe.elements();<br><br>const cardElement = elements.create(&quot;card&quot;);<br>cardElement.mount(&quot;#card-element&quot;);<br><br>stripe.confirmCardPayment(client_secret, {<br>  payment_method: {<br>    card: cardElement<br>  }<br>});</pre><p>SDK uses POST request under the hood</p><pre>POST https://api.stripe.com/v1/payment_intents/client_secret/confirm</pre><p><strong>Key Security Point:</strong><br>Card data never touches your backend<strong>, </strong>it is sent directly to Stripe, ensuring sensitive information is never exposed on your servers so the backend avoids full PCI DSS scope for handling card data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fUFR9EnYhWpGZhRz8PX8-g.png" /></figure><h4>Step 5: Fraud Detection (Stripe Internal)</h4><p>Before payment is confirmed, Fraud Service kicks in Analyzes IP address, Device, Card history, Behavior and save the outcome (success, block, require verification) in the DB. Fraud Service usually uses ML model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2bBro58lv5FTWP0Q0sLSOQ.png" /></figure><h4>Step 6: Handoff to Payment Processor for Authorization (Fraud Service -&gt; Payment Processor Service)</h4><p>When Fraud service approves a transaction, it stores the result and forwards it to the payment processor.A <strong>payment processor</strong> is the service that communicates with partner banks of Stripe.</p><p>A synchronous call can tightly couple the services and overwhelm the processor under load. Letting the processor read from the database avoids this, but constant polling can strain the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*26Oo8e9E-PPs9MZDQ0KgfQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cQDs9wend0qapQbdWixo8g.png" /></figure><p>A better approach is to use an event bus like Apache Kafka. The fraud service publishes an event (e.g., <em>TransactionApproved</em>), and the payment processor consumes it asynchronously at its own pace. This enables loose coupling, scalability, and efficient load handling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P8EHG_NDXJW8-JGX2r8_Hw.png" /></figure><p>However, there’s a risk that the event is lost if the service crashes after updating the database but before publishing to Kafka. Since this is a payment service, consistency is critical. To ensure it, we can use the <a href="https://medium.com/@carol18012000/the-outbox-pattern-a-consistent-approach-to-distributed-transactions-0e0bb85cfcb3">O<strong>utbox pattern</strong></a> write events to a dedicated outbox table within the same transaction, then have a separate worker process reliably publish them to Kafka, guaranteeing consistency between the database and event stream.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oKfd-fESDh4hn2R3MymU4g.png" /></figure><h4>Step 7: Payment Authorization Request to the Partner Bank (Payment Processor -&gt; Partner Bank)</h4><p>PaymentProcessor in Stripe sends a <strong>payment authorization message containing amount + merchant + card token + risk/authentication data</strong> to the partner bank.</p><p>Typically, Stripe sends authorization requests <strong>via direct synchronous bank API / ISO8583 ( a binary message protocol over TCP).</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLlqh5LdaoGQefhoBOmGog.png" /></figure><h4>Step 8: Partner Bank Validation and Routing (Partner Bank -&gt; Card Network)</h4><p>The partner bank <strong>validates the Payment Authorization message, performs basic risk checks saves the Authorization record in the Db and then converts the Payment Authorization to ISO 8583, and routes the it to the card network</strong>, then relays the issuer’s response back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6mlKJCoq_sn3trFupSUHnw.png" /></figure><h4>Step 9: Authorization Processing (Card Network-&gt; User Bank -&gt; Card Network )</h4><p>Visa records each <strong>Payment Authorization in the Db </strong>and facilitates communication between the issuing and partner banks using <strong>ISO 8583 messages</strong> over <strong>VisaNet</strong>, its private network. The flow is as follows: the transaction authorization request is sent to the <strong>cardholder’s issuing bank and in response it sends if it has succesffully approved or not</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v8NwZNflpX5U-JrYMFstDw.png" /></figure><h4>Step 10: Authorization Response Route (Card Network-&gt; Partner Bank -&gt; Stripe)</h4><p>The Card Network routes the authorization result (Approved or Declined) back to Stripe’s <strong>Partner Bank</strong> via the ISO 8583 protocol. The Partner Bank forwards the response to <strong>Stripe’s Payment Processor</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TozrjZ_bJJaU8e10mGK4vg.png" /></figure><h4>Step 11: PaymentIntent State Update and Final Event Propagation (Stripe -&gt; Amazon)</h4><p>Stripe updates the <strong>PaymentIntent</strong> state (e.g., to succeeded) in its Db. This update acts as the &quot;Source of Truth,&quot; triggering the final response to the Frontend SDK and firing the <strong>Webhook</strong> to the Merchant’s backend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9LBSxvKy5RSBHoSFy62yMg.png" /></figure><h4>Step 12 Merchant-Side Webhook Processing and Order Fulfillment Flow (Amazon-&gt; User)</h4><p>When the <strong>Webhook</strong> hits your backend, Amazon (the merchant) saves the successful status to its own database to finalize the transaction. This internal record serves as the “source of truth” for fulfillment, ensuring that even if the customer’s browser crashes, the order is safely marked as <strong>Paid</strong>. This database update can then trigger downstream business logic, such as updating inventory levels, generating a digital invoice, and notifying the warehouse to begin the shipping process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34ipjlzO4gvlJuN__s5i_A.png" /></figure><h3>Conclusion</h3><p>We’ve finished Phase One, but here is the truth: <strong>not a single cent has actually moved yet.</strong> Everything so far has been the “talking phase” — verifying funds and securing a digital promise. We have successfully authorized the transaction, but the money is still in the customer’s account.</p><p>In the next article, we’ll move beyond the promise to explore <strong>Settlement and Reconciliation</strong>, where the actual cash flow begins. We will also cover how to scale this architecture and make it <strong>fault-tolerant</strong> to handle millions of transactions without a hitch.</p><p>The real money movement starts in part two. Stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fb6f59951a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Concurrency ≠ Parallelism: A Simple Explanation Every Developer Needs]]></title>
            <link>https://medium.com/@carol18012000/concurrency-parallelism-a-simple-explanation-every-developer-needs-f788063d5fb0?source=rss-ba209e116ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f788063d5fb0</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[concurrency]]></category>
            <dc:creator><![CDATA[Carol Mendonca]]></dc:creator>
            <pubDate>Fri, 03 Apr 2026 02:26:51 GMT</pubDate>
            <atom:updated>2026-04-03T02:26:51.832Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iav7Fh6BROqCCQvAoYJBMw.png" /></figure><p>It’s one of the most common mix-ups in software development. We often use them interchangeably in casual conversations, but in the world of system architecture they are very different concepts.</p><p>To put it simply: Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once.</p><h3>Concurrency: The Art of Multi-tasking</h3><p>Concurrency is a structural property of an application.It means that a program is designed to handle multiple tasks by overlapping their execution periods</p><p>Think of a single-core processor. It achieves concurrency through context switching. It runs a bit of Task A, pauses it, runs a bit of Task B, and then jumps back to Task A. Because it happens so fast, it <em>looks</em> like everything is happening at once.</p><h3>Parallelism: The Art of Raw Speed</h3><p>Parallelism is a hardware property. It requires multiple processing units (multiple cores or CPUs) to physically execute different tasks — or different parts of the same task — at the exact same moment.</p><p>If you have a four-core CPU and you run four separate threads, each on its own core, you are achieving true parallelism.</p><h3>Four Models of Task Execution</h3><h4>1. Not Concurrent, Not Parallel</h4><p>A single CPU core processes tasks strictly one after another. Task A must fully complete before Task B begins. There is no overlap in execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OwsAP2KZemGYsRedbRmmjg.png" /></figure><h4>2. Concurrent, Not Parallel</h4><p>A single CPU core switches between multiple tasks. Task A and Task B make progress in an interleaved manner (context switching), giving the illusion that both are running at the same time. However, only one task is executing at any given instant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXMO75O7uATXcj9wVcHpEw.png" /></figure><h4>3. Not Concurrent, Parallel</h4><p>Multiple CPU cores are available, but tasks may or may not run in parallel.<br>Task A can run on Core 1 while Task B runs on Core 2 at the same time which is true parallelism.However, if tasks are scheduled one after another, there is no overlap despite multiple cores.Actual parallelism depends on program design (multi-threading), the OS scheduler, and task distribution across cores.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kOBnHIL76VQKeIHZDJUgQw.png" /></figure><h4>4. Concurrent and Parallel</h4><p>Multiple CPU cores execute multiple tasks at the same time.<br>Task 1, Task2 and Task 3, Task 4 run simultaneously on different cores respectively , leading to true parallel execution and faster completion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kSfJfQg870QOp4VjPHWarw.png" /></figure><h3>Why the Distinction Matters</h3><p>Understanding this helps you choose the right tool for the job.</p><ul><li>If your app is <strong>I/O bound</strong> (waiting for databases or APIs), you need <strong>Concurrency</strong>.</li><li>If your app is <strong>CPU bound</strong> (heavy image processing or data crunching), you need <strong>Parallelism</strong>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f788063d5fb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Outbox Pattern: A Consistent Approach to Distributed Transactions]]></title>
            <link>https://medium.com/@carol18012000/the-outbox-pattern-a-consistent-approach-to-distributed-transactions-0e0bb85cfcb3?source=rss-ba209e116ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e0bb85cfcb3</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Carol Mendonca]]></dc:creator>
            <pubDate>Sun, 29 Mar 2026 02:36:25 GMT</pubDate>
            <atom:updated>2026-03-29T02:42:08.943Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lrkTCFT5gtM834KEEO5MtA.png" /></figure><p>Modern applications rely on multiple services communicating with each other. However, ensuring data consistency across systems is hard, especially when failures happen mid process. This is where Outbox Pattern becomes extremely useful.</p><h3>What Problem Does the Outbox Pattern Solve?</h3><p>Consider a typical workflow in an event-driven system</p><ul><li>A service performs a database operation — such as creating an order</li><li>Then publishes an event to a message broker (like Apache Kafka or RabbitMQ) to notify other services.</li></ul><p>Now, what if the database transaction may succeed, but the event publication might fail due to a network issue or broker downtime. This leads to an inconsistent state where the data is stored, but other services remain unaware of the change.</p><h3>What Is the Outbox Pattern?</h3><p>The Outbox Pattern ensures <strong>atomicity between database writes and event publishing</strong>.</p><p>Instead of directly publishing events</p><ul><li>Write the event into an <strong>outbox table</strong> along with the order data stored in the order table, within the<strong> same database transaction</strong>.</li><li>Then a separate process later reads from the outbox and publishes events.</li></ul><p>Since, both <strong>data (</strong>order table<strong>) + event</strong> (outbox table ) are saved in the same transaction, either both succeed or both fail. This eliminates partial updates.</p><h3>Outbox Table Structure</h3><p>A typical outbox table contains fields that describe the event and its state. By maintaining a status field (for example, <em>PENDING</em> or <em>SENT</em>), the system can track which events have been processed and which need retries.</p><pre>outbox (<br>  id UUID PRIMARY KEY,<br>  event_type VARCHAR,<br>  payload JSON,<br>  status VARCHAR, -- PENDING, SENT<br>  created_at TIMESTAMP<br>)</pre><h3>Event Delivery Mechanisms</h3><p>To publish events from the outbox table, systems generally adopt one of two approaches.</p><p>The first approach is <strong>polling</strong>, where a background job periodically checks the outbox table for new entries. While simple to implement, polling may introduce slight delays in event delivery.</p><p>The second approach uses <strong>Change Data Capture (CDC)</strong> tools like <a href="https://github.com/debezium/debezium">Debezium</a>. CDC monitors database changes in real time and streams them to message brokers, reducing latency and improving efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v-oqPBtwhB7VG8SAWwy00w.png" /></figure><h3>Benefits of Outbox Pattern</h3><ul><li>Strong Consistency- No risk of losing events after DB commit.</li><li>Retry Mechanism- Failed events stay in outbox and can be retried.</li><li>Decoupling- Business logic doesn’t depend on message broker availability.</li></ul><h3>Trade-offs of Outbox Pattern</h3><ul><li>Increased Complexity- Need to introduce extra table and a background worker.</li><li>Latency -Events are not published instantly.</li><li>Cleanup Required- Outbox table can grow large.</li></ul><h3>When to Use the Outbox Pattern</h3><p>The Outbox Pattern is particularly useful in systems where reliable event delivery is critical. This includes microservices architectures, financial systems, order processing platforms, and any application where data consistency across services must be preserved.</p><p>It is especially valuable when failures cannot be tolerated silently and when recovery mechanisms must be built into the system design.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e0bb85cfcb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Maven Velocity Playbook: Mastering Build Speed, Dependency Scopes, and Modern Caching]]></title>
            <link>https://medium.com/@carol18012000/the-maven-velocity-playbook-mastering-build-speed-dependency-scopes-and-modern-caching-ab709559361c?source=rss-ba209e116ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab709559361c</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Carol Mendonca]]></dc:creator>
            <pubDate>Fri, 20 Mar 2026 15:39:44 GMT</pubDate>
            <atom:updated>2026-03-20T16:12:24.447Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTL2y8qxw95M4hZmzdzt7A.png" /></figure><p>Building maven projects usually takes time, these delays are frequently long enough to disrupt deep work, leading to a loss of concentration and the common tendency to switch to other non-work-related platforms. Here are some tips to speed up your build.</p><h4><strong>Maven Daemon (</strong>mvnd<strong>)</strong></h4><p>Maven Daemon or mvnd is designed to make builds significantly faster by addressing biggest bottleneck : JVM startup time and sequential processing. Standard maven runs a fresh JVM every time you run the command —requiring class loading and JIT compilation each time. mvnd maintains a persistent background process and combines parallel thread processing.</p><p><a href="https://github.com/apache/maven-mvnd">Install Apache Maven Daemon</a> and then run</p><pre># maven daemon<br>mvnd clean install</pre><h4>Lifecycle</h4><p>Knowledge of the lifecycle allows you to jump into the assembly line exactly where you need to. Maven has majorly 3 distinct lifecycles.</p><ul><li><strong>Default:</strong> Handles project deployment (compilation, testing, packaging).</li><li><strong>Clean:</strong> Handles project cleaning (removing the target directory).</li><li><strong>Site:</strong> Handles the creation of project documentation.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/410f0bb501114d488fbdeaab05e72e27/href">https://medium.com/media/410f0bb501114d488fbdeaab05e72e27/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53204344e745bb00ca83682789eb54a0/href">https://medium.com/media/53204344e745bb00ca83682789eb54a0/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26db4edf7cf75833c045c3edbb8ff0e3/href">https://medium.com/media/26db4edf7cf75833c045c3edbb8ff0e3/href</a></iframe><p>To maximize your speed, you need to combine <strong>lifecycle </strong>with <strong>Maven flags</strong>. This allows you to cut out the bloat of a standard build.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/496d24aee1775405b9be3fa54e3101da/href">https://medium.com/media/496d24aee1775405b9be3fa54e3101da/href</a></iframe><h4>The Ultimate Developer Shortcut</h4><p>For your daily local development, this is the command that effectively strips the bloat to give you a fresh build in the shortest time possible:</p><pre>mvn clean install -T 1C -o -DskipTests -am -pl &lt;your-module-name&gt;</pre><p>Why this works:</p><ul><li><strong>clean</strong>: Wipes the target folder to ensure no stale artifacts.</li><li><strong>install</strong>: Compiles and moves the new JAR to your local .m2.</li><li><strong>-T 1C</strong>: Tells Maven to run multi-module tasks in parallel.</li><li><strong>-o</strong>: Eliminates the &quot;Connecting to Central...&quot; lag.</li><li><strong>-DskipTests</strong>: Avoids the longest-running part of the build that is tests.</li><li><strong>-pl &amp; </strong><strong>-am</strong>: Limits the work strictly to what you are currently working on.</li></ul><h4>Analyze</h4><p>In large multi module project, deleting unused dependencies is a high reward task that reduce JAR bloat, speeds up build time and simplifies security audits. However its a task that should be done in caution because Maven built in tools can be sometime blind<em> </em>to certain types of usages.</p><p>The first step is to run dependency analyzer. This will compare your pom.xml declarations against actual bytecode in your target folder.</p><pre>mvn dependency:analyze</pre><p>Once the analysis completes, you’ll likely encounter two types of findings</p><ul><li><strong>Used undeclared dependencies:</strong> These are libraries you are using in your code, but they are only coming in transitively (via another library). <strong>The Fix:</strong> Add them explicitly to your pom.xml.</li><li><strong>Unused declared dependencies:</strong> These are libraries listed in your pom.xml that Maven thinks you aren&#39;t using. <br><strong>The Fix: </strong>Potential candidates for deletion.</li></ul><p>Before you delete everything in the unused list, you must check for these three scenarios where the tool will lie to you:</p><ul><li><strong>Reflection &amp; DI:</strong> If you are using a library via reflection or a Dependency Injection framework (like Spring or Guice) where the class name is a String in a config file, Maven won’t see it in the bytecode.</li><li><strong>Runtime-only Libraries:</strong> Database drivers (JDBC) or logging implementations (Log4j) are often needed at runtime but never imported in your Java code.</li><li><strong>Annotations:</strong> Some annotations (like those from Lombok or certain JPA providers) have source retention, meaning they disappear after compilation. Maven will think the library is unused.</li></ul><p>To keep your dependency:analyze reports clean, you can configure the <strong>maven-dependency-plugin</strong> to ignore specific dependencies that it incorrectly flags as unused.</p><pre>&lt;plugin&gt;<br>    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>    &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;<br>    &lt;version&gt;3.6.1&lt;/version&gt;<br>    &lt;configuration&gt;<br>        &lt;ignoredUnusedDeclaredDependencies&gt;<br>            &lt;ignoredUnusedDeclaredDependency&gt;org.postgresql:postgresql&lt;/ignoredUnusedDeclaredDependency&gt;<br>            &lt;ignoredUnusedDeclaredDependency&gt;org.springframework.boot:*&lt;/ignoredUnusedDeclaredDependency&gt;<br>            &lt;ignoredUnusedDeclaredDependency&gt;org.projectlombok:lombok&lt;/ignoredUnusedDeclaredDependency&gt;<br>        &lt;/ignoredUnusedDeclaredDependencies&gt;<br>    &lt;/configuration&gt;<br>&lt;/plugin&gt;</pre><p>For very large projects, manual cleanup is impossible. You can use <strong>OpenRewrite</strong>, a tool that uses “Recipes” to safely refactor code.</p><pre>mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-micronaut:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.micronaut.RemoveUnnecessaryDependencies -Drewrite.exportDatatables=true</pre><p>What it does It performs a much deeper analysis, taking into account many common false positives.</p><p>Never delete a dependency without running a full mvn clean install immediately after.</p><h4>Scopes</h4><p>In Maven, scope is a setting that determines when a dependency is available to your project. Choosing right scope is critical for preventing artifact bloat and avoiding classpath conflict ( where two versions of your library crash your app).</p><p>Maven majorly has 6 scopes and here is how they behave across the different stages of the lifecycle.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1a8db752257e8f8b36c0b07ecf6547b/href">https://medium.com/media/e1a8db752257e8f8b36c0b07ecf6547b/href</a></iframe><h4>Profiling</h4><p>While standard maven build tells you the jvm took 5 mins, profiling tells you which 10 sec were spent on a specific unit test and which 40 seconds were wasted on a redundant resource-copying task.</p><p>Cretate a .mvn/extensions.xml file with</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;extensions&gt;<br>    &lt;extension&gt;<br>      &lt;groupId&gt;fr.jcgay.maven&lt;/groupId&gt;<br>      &lt;artifactId&gt;maven-profiler&lt;/artifactId&gt;<br>      &lt;version&gt;3.3&lt;/version&gt;<br>    &lt;/extension&gt;<br>&lt;/extensions&gt;</pre><p>Use profile when running Maven.</p><pre>mvn clean install -Dprofile</pre><p>The tool generates an HTML report (usually in a .profiler folder). It provides</p><ul><li>Mojo Breakdown: It lists every single plugin execution (Mojo) and sorts them by time.</li><li>Waterfall View: You can see if one specific module is a bottleneck that prevents others from starting in a parallel build.</li><li>Format Options: You can also output to the console or JSON using -DprofileFormat=CONSOLE,JSON.</li></ul><h4>Profiles</h4><p>Profiles allow you to create a “Fast Lane” for development and a “Deep Scan” lane for CI.</p><p>To speed up your local development builds you can<strong> c</strong>reate a profile in your pom.xml that skips non-essential tasks during local development. This is the inner loop optimization.</p><pre>  &lt;profiles&gt;<br>        &lt;profile&gt;<br>            &lt;id&gt;dev-fast&lt;/id&gt;<br>            &lt;properties&gt;<br>                &lt;skipTests&gt;true&lt;/skipTests&gt;<br>                &lt;maven.javadoc.skip&gt;true&lt;/maven.javadoc.skip&gt;<br>                &lt;enforcer.skip&gt;true&lt;/enforcer.skip&gt;<br>                &lt;checkstyle.skip&gt;true&lt;/checkstyle.skip&gt;<br>            &lt;/properties&gt;<br>        &lt;/profile&gt;<br>    &lt;/profiles&gt;</pre><p>You run mvn install -P dev-fast and the build finishes in few seconds because it only compiles the code.</p><h4>Parallel Test</h4><p>Parallelizing tests can significantly reduce your build times, especially for the high-performance distributed systems you’re used to building.</p><p>To enable JUnit 5 (compatible with java 8 and above), you need the junit-jupiter aggregator dependency. If you have legacy JUnit 4 tests that need to run in the same build, add the junit-vintage-engine.</p><pre>&lt;dependencies&gt;<br>    &lt;dependency&gt;<br>        &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;<br>        &lt;artifactId&gt;junit-jupiter&lt;/artifactId&gt;<br>        &lt;version&gt;5.10.2&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt;<br>    &lt;/dependency&gt;<br>    <br>    &lt;dependency&gt;<br>        &lt;groupId&gt;org.junit.vintage&lt;/groupId&gt;<br>        &lt;artifactId&gt;junit-vintage-engine&lt;/artifactId&gt;<br>        &lt;version&gt;5.10.2&lt;/version&gt;<br>        &lt;scope&gt;test&lt;/scope&gt;<br>    &lt;/dependency&gt;<br>&lt;/dependencies&gt;</pre><p>Unit 5 parallel execution is an opt-in feature. You can configure it either via a properties file or directly in your pom.xml.</p><p><strong>Option A:</strong> src/test/resources/junit-platform.properties (Recommended)</p><p>This keeps your test configuration separate from your build logic.</p><pre># Enable parallel execution<br>junit.jupiter.execution.parallel.enabled = true<br><br># Options: &#39;concurrent&#39; (all parallel) or &#39;same_thread&#39; (selective)<br>junit.jupiter.execution.parallel.mode.default = concurrent<br>junit.jupiter.execution.parallel.mode.classes.default = concurrent<br><br># Strategy: &#39;dynamic&#39; (based on CPU cores) or &#39;fixed&#39;<br>junit.jupiter.execution.parallel.config.strategy = dynamic<br>junit.jupiter.execution.parallel.config.dynamic.factor = 1</pre><p><strong>Option B:</strong> Maven XML Properties</p><p>If you prefer keeping it in the pom.xml, use the maven-surefire-plugin configuration:</p><pre>&lt;plugin&gt;<br>    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>    &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;<br>    &lt;version&gt;3.2.5&lt;/version&gt;<br>    &lt;configuration&gt;<br>        &lt;properties&gt;<br>            &lt;configurationParameters&gt;<br>                junit.jupiter.execution.parallel.enabled = true<br>                junit.jupiter.execution.parallel.mode.default = concurrent<br>            &lt;/configurationParameters&gt;<br>        &lt;/properties&gt;<br>    &lt;/configuration&gt;<br>&lt;/plugin&gt;</pre><p>While properties define the global behavior of tests, some test cases may require sequential or isolated execution. In such cases, annotations provide granular control over specific classes or methods. For these scenarios, to the relevant JUnit 5 annotations.</p><h4>Caching</h4><p>Build caching is your ultimate time-saver. On the first run, Maven fingerprints your code and environment, storing the results in a local or remote cache. On subsequent runs, if the fingerprints match, Maven skips compilation and testing entirely — simply “replaying” the results from the cache. While Incremental builds rely on fragile file timestamps and are wiped out by mvn clean, forcing you to restart from zero. The Build Cache uses permanent content fingerprints (checksums) that survive mvn clean, allowing you to skip compilation and testing even after a total workspace reset.</p><p>Create a file at .mvn/extensions.xml in your project root. This tells Maven to load the cache engine before it starts the build.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;extensions&gt;<br>    &lt;extension&gt;<br>        &lt;groupId&gt;org.apache.maven.extensions&lt;/groupId&gt;<br>        &lt;artifactId&gt;maven-build-cache-extension&lt;/artifactId&gt;<br>        &lt;version&gt;1.1.0&lt;/version&gt;<br>    &lt;/extension&gt;<br>&lt;/extensions&gt;</pre><p>Create a file at .mvn/maven-build-cache-config.xml. This is where you define what Maven should &quot;watch&quot; to calculate those fingerprints.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;cache xmlns=&quot;http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0&quot;&gt;<br>    &lt;configuration&gt;<br>        &lt;enabled&gt;true&lt;/enabled&gt;<br>        &lt;hashAlgorithm&gt;XXH64&lt;/hashAlgorithm&gt; &lt;/configuration&gt;<br>    &lt;input&gt;<br>        &lt;global&gt;<br>            &lt;glob&gt;{*.java,*.xml,*.properties}&lt;/glob&gt;<br>        &lt;/global&gt;<br>    &lt;/input&gt;<br>&lt;/cache&gt;</pre><p>Run your build twice. The second time, you should see the “Magic”</p><p>If your build generates a build.number or a timestamp in some files, the cache will miss. Use the &lt;exclude&gt; tag in your config file to ignore these non-code changes.</p><p>Here is how you implement that in your .mvn/maven-build-cache-config.xml:</p><pre>&lt;cache&gt;<br>    &lt;input&gt;<br>        &lt;global&gt;<br>            &lt;excludes&gt;<br>                &lt;exclude&gt;**/build.number&lt;/exclude&gt;<br>                &lt;exclude&gt;**/version.properties&lt;/exclude&gt;<br>            &lt;/excludes&gt;<br>        &lt;/global&gt;<br>    &lt;/input&gt;<br>&lt;/cache&gt;</pre><h4>The Maven Build Cache Extension</h4><p>Caching in a CI/CD pipeline for Maven (mvn) is one of the most effective ways to slash your build times. Since Maven downloads artifacts (JARs, POMs, and plugins) into a local repository the first time it runs, caching that repository allows subsequent builds to skip the download phase entirely.</p><h4>JVM Tuning for Maven</h4><p>Maven is a Java application. If the JVM running Maven is starving for memory or spending all its time on Garbage Collection (GC), your build will crawl.</p><p>Create a .mvn/jvm.config file in your project root with these settings:</p><ul><li><strong>-Xmx4g</strong>: Increase the heap size. Modern builds with many plugins need more than the default.</li><li><strong>-XX:+UseG1GC</strong>: Use the G1 Garbage Collector for more predictable pause times.</li><li><strong>-XX:+TieredCompilation</strong>: Speeds up the startup time of the JVM itself, which is vital for short-lived Maven processes.</li></ul><h4>Modern Dependency Hygiene</h4><p>Clean projects build faster. Bloated dependency trees slow down the reactor and increase the risk of classpath conflicts.</p><ul><li><strong>Bill of Materials (BOM):</strong> Use a BOM to manage versions across microservices. This ensures that your projects use consistent, compatible library versions.</li><li><strong>Avoid Snapshot Bloat:</strong> Limit the use of -SNAPSHOT versions in common libraries, as they force Maven to check the remote repository for updates on every single build, adding significant network latency.</li></ul><h4>Pitfalls</h4><p>Knowing your lifecycles, scopes and commands is great, but maven has certain “<em>silent killers” </em>that can ruin your build performance or introduce “<em>ghost bugs</em>” that disappears on restart.</p><p>Here are the most common pitfalls you will encounter in high-scale projects.</p><p><strong>“Clean” Addiction</strong>:</p><p>Running mvn clean for every build out of habit. It forces Maven to delete and re-download/re-generate everything. You lose all the benefits of incremental compilation.</p><p>Only use clean when changing versions in pom.xml, switching branches, or if you see &quot;Class Not Found&quot; errors. For regular coding, just use mvn compile.</p><p><strong>Dependency Hell (Version Mismatch):</strong></p><p>Relying on Transitive Dependencies (dependencies of your. dependencies) without locking them down. If Library A uses Log4j 2.1 and Library B uses Log4j 2.17, Maven might pick the &quot;nearest&quot; one in the tree, which isn&#39;t always the newest or safest.</p><p>Use the &lt;dependencyManagement&gt; section in your parent POM to &quot;pin&quot; specific versions for the entire project.</p><p><strong>Missing Plugin Versions:</strong></p><p>Not specifying a version for your plugins (e.g., maven-surefire-plugin). Maven will grab the “latest” version available. If a new version of the plugin is released tomorrow and it has a bug, your build will suddenly fail even though you didn’t change a single line of code.</p><p>Always wrap your plugins in a &lt;pluginManagement&gt; block with explicit versions to ensure <strong>Reproducible Builds</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab709559361c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>