<?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 Manoj Kumar on Medium]]></title>
        <description><![CDATA[Stories by Manoj Kumar on Medium]]></description>
        <link>https://medium.com/@gmanojkumar03?source=rss-33c0cbce4fc7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_zwtRMT6S2pJp4GCk1H5wA.jpeg</url>
            <title>Stories by Manoj Kumar on Medium</title>
            <link>https://medium.com/@gmanojkumar03?source=rss-33c0cbce4fc7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 18:09:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gmanojkumar03/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[The Modern AI Stack: What These Terms Actually Mean in Code]]></title>
            <link>https://medium.com/@gmanojkumar03/the-modern-ai-stack-what-these-terms-actually-mean-in-code-90117790da60?source=rss-33c0cbce4fc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/90117790da60</guid>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm-agent]]></category>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Manoj Kumar]]></dc:creator>
            <pubDate>Thu, 29 Oct 2026 08:08:01 GMT</pubDate>
            <atom:updated>2026-10-29T08:08:01.290Z</atom:updated>
            <content:encoded><![CDATA[<p>The Modern AI Stack: What These Terms Actually Mean in Code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O9NGWaBXsq9E69VC4w5irA.png" /></figure><p>If you strip away the hype, building with AI comes down to a few specific software patterns. Here is the concrete, technical definition of the core concepts, how they work, and how they connect.<br>1. LLM (Large Language Model)<br>An LLM is a giant neural network (usually a Transformer) that takes an array of text tokens as input and outputs a probability score for what token should come next.<br>It does not have memory between API calls. Every HTTP request you make to OpenAI, Anthropic, or an open-source model like Llama is completely independent. If you want the model to remember what you said two seconds ago, your code must send the entire previous conversation back into the new request payload.<br>2. Tokens &amp; Context Window<br>LLMs do not see characters or words. A tokenizer turns strings into integer IDs using Byte-Pair Encoding (BPE).<br>Common words like “apple” might be a single token (17060).<br>Complex or rare words like “unbelievable” get split into sub-tokens: “un”, “believ”, “able”.<br>Code syntax or whitespace uses tokens too.</p><p>The Context Window is the maximum array length (in tokens) the model can accept in a single request. If a model has a 128k context window, len(input_tokens) + len(output_tokens) cannot exceed 131,072. If you exceed this limit, the API simply throws a 400 error.<br>3. Temperature<br>Whenever a model prepares to emit the next token, it ranks all possible words in its vocabulary by probability score. Temperature is a simple slider (usually set between 0.0 and 1.0 or 2.0) that dictates how the model picks from that list:<br>At 0.0: The model always picks the single highest-probability token. This makes the output deterministic and repeatable. It is the setting you want when extracting JSON, writing code, or running math.<br>At higher values (e.g., 0.7 to 1.0): The model allows less probable tokens to be chosen. This introduces variety and phrasing differences across runs, which is helpful for creative drafting or brainstorming, but increases the odds of inaccuracies.</p><p>4. RAG (Retrieval-Augmented Generation)<br>An LLM only knows what was in its training set up to its training cutoff date, and it does not know your private database.<br>RAG is a three-step data pipeline to fix this:<br>Indexing: You take your raw documents (PDFs, docs, DB rows), split them into small text chunks (e.g., 500 characters each), run them through an embedding model to turn them into numerical vectors, and store them in a vector database.<br>Retrieval: When a user asks a question, you embed their query using the same embedding model, perform a cosine similarity search against your vector database, and grab the top 3–5 most relevant text chunks.<br>Generation: You dynamically construct a prompt containing those chunks:</p><p>Context: [Retrieved chunk 1, Retrieved chunk 2] <br>User Question: How do I configure SSO? <br>Instruction: Answer the question using ONLY the provided context.<br>This avoids expensive model retraining and stops the model from hallucinating facts.<br>5. Function Calling / Tool Use<br>By design, an LLM only outputs text. It cannot query an API or run code directly.<br>Tool Use is a handshake between your backend and the model:<br>In your API call, you pass a JSON schema describing a local function:</p><p>{ <br>“name”: “get_user_balance”,<br>“description”: “Fetch user balance by ID”,<br>“parameters”: <br> {“type”: “object”,<br> “properties”: <br>{ “user_id”: <br> { “type”: “string” } <br>}, <br>“required”: [“user_id”] } }<br>2. The model detects that the user’s prompt (“What is Alice’s balance?”) requires this function. Instead of answering in natural text, it returns a structured JSON payload:<br>{ “function_call”: <br> { “name”: “get_user_balance”,<br> “arguments”: “{\”user_id\”: \”12345\”}”<br>}<br> }<br>3. Your application code parses this JSON, runs the real database query, gets the balance ($450.00), and sends that result back to the model in a follow-up message so the model can write: “Alice’s balance is $450.00.”<br>6. AI Agent<br>A standard LLM app is a one-way pipeline: Input $\rightarrow$ Prompt $\rightarrow$ Model $\rightarrow$ Output.<br>An Agent is code that puts the LLM inside a while loop with access to tools:<br>Python<br>while not task_completed and step_count &lt; MAX_STEPS:<br> response = call_llm(prompt_history, tools)<br> <br> if response.has_tool_call():<br> tool_result = execute_tool(response.tool_call)<br> prompt_history.append(tool_result)<br> step_count += 1<br> else:<br> task_completed = True<br> return response.text<br>The agent runs tools, looks at the output, decides if it achieved the goal, and if not, calls another tool or tries a different approach until the loop terminates.<br>7. Harness (Agent Harness vs. Eval Harness)<br>The word “harness” comes up frequently in AI engineering in two distinct contexts:<br>A. The Agent Harness (The Runtime Wrapper)<br>An LLM inside a raw while loop will easily break in production. An Agent Harness is the infrastructure layer written around the loop to keep it functional:<br>State Management: Storing the execution graph, state checkpoints, and message history in a database (e.g., PostgreSQL or Redis).<br>Recursion &amp; Budget Limits: Enforcing hard cutoffs (e.g., stop execution if cost &gt; $0.50 or steps &gt; 15) to prevent infinite loops.<br>Sandboxing: Running untrusted generated bash/Python commands inside isolated Docker containers or WebAssembly rather than directly on your host server.</p><p>B. The Eval Harness (Automated Benchmarking)<br>Because LLM outputs vary, you cannot just write standard assert output == “expected” tests.<br>An Eval Harness is a testing framework (such as lm-evaluation-harness or custom Python test suites) that feeds a fixed dataset of hundreds of prompts through your pipeline and scores the outputs against defined metrics:<br>Exact match / regex validation (for structured code or JSON).<br>LLM-as-a-judge (using a stronger model like GPT-4 to grade answers on a 1–5 scale for accuracy and groundedness).<br>Latency and cost tracking across model updates.</p><p>Summary: How a Real Request Moves Through the System<br>A user sends a request to your application.<br>The Harness checks rate limits, cost budgets, and sets up session memory.<br>The RAG pipeline fetches relevant domain documents via vector search.<br>The system injects the context into the prompt and sends it to the LLM with a specific Temperature setting.<br>The LLM chooses to call a Tool via structured JSON output.<br>The Harness executes that tool securely and feeds the result back to the LLM.<br>If configured as an Agent, this cycle loops until the goal is verified.<br>The final output is tested and monitored against an Eval Harness to detect regressions over time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90117790da60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Secret Git Toolkit: 6 Commands Bootcamps Never Taught You]]></title>
            <link>https://medium.com/@gmanojkumar03/the-secret-git-toolkit-6-commands-bootcamps-never-taught-you-f41fc2255021?source=rss-33c0cbce4fc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f41fc2255021</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Manoj Kumar]]></dc:creator>
            <pubDate>Tue, 18 Aug 2026 08:28:29 GMT</pubDate>
            <atom:updated>2026-08-18T08:28:29.868Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*Cdhl_TybcOqS5a3VcuIKVQ.png" /></figure><p>If you peek into the terminal history of a typical software engineer, you will see a monotonous loop of five commands: git status, git add ., git commit -m, git push, and the occasional panicked git pull.</p><p>When I joined my first enterprise codebase — a decade-old monolithic repository with hundreds of active contributors — I treated Git as a simple file backup tool. But when you are dealing with dozens of microservices, massive merge conflicts, feature branches that drag on for months, and bug reports referencing code written by engineers who left the company in 2019, those five basic commands quickly reach their limit.</p><p>Over the years, I have discovered a subculture of underutilized, surprisingly powerful Git tools. These aren’t the commands taught in bootcamps, but they are the ones that turn multi-hour debugging nightmares into single-command solutions.</p><p>Here are six unpopular Git commands, how to use them, and how they solve real-world problems in large-scale projects.</p><h3>1. git rerere — Reuse Recorded Resolution</h3><h4>The Real-World Scenario</h4><p>Imagine working on a massive feature branch for three weeks. The main branch moves fast, so you pull main into your branch every few days to keep things fresh. Every single time you merge, you spend 45 minutes resolving the exact same complex merge conflict in a shared configuration file or API schema.</p><h4>How It Helps</h4><p>rerere stands for <strong>Re</strong>use <strong>Re</strong>corded <strong>Re</strong>solution. When enabled, Git takes a snapshot of what your files looked like before a conflict resolution, records how you resolved it, and saves that pattern. The next time Git encounters the exact same conflict, it automatically applies your previous fix without asking.</p><h4>How to Use It</h4><p>You only need to enable it once globally:</p><pre>git config --global rerere.enabled true</pre><p>From then on, Git silently works in the background. When a conflict happens, you will see:</p><pre>Recorded preimage for &#39;src/config.json&#39;</pre><p>Once you resolve the conflict and commit, Git saves your solution (Recorded resolution for &#39;src/config.json&#39;). If that exact conflict happens again next week, Git resolves it automatically.</p><h3>2. git bisect — Binary Search for Bugs</h3><h4>The Real-World Scenario</h4><p>A critical bug hits production. The client reports that a calculation endpoint is returning invalid JSON. You check the code, but you have no idea when it broke. The repo has 3,000 commits between the last stable release and today’s build. Manual code reviews are impossible.</p><h4>How It Helps</h4><p>Instead of checking commits one by one (O(n) complexity), git bisect performs a binary search (O(log n)) through your commit history to find the exact commit that introduced the bug. Out of 3,000 commits, it will find the culprit in about 11 steps.</p><h4>How to Use It</h4><ul><li>Start the bisecting process:</li></ul><pre>git bisect start</pre><ul><li>Mark your current (broken) commit as bad:</li></ul><pre>git bisect bad</pre><ul><li>Mark a known older commit (where things worked fine) as good:</li></ul><pre>git bisect good v2.4.0</pre><ul><li>Git automatically checks out a commit right in the middle. You test your code, and tell Git if it’s good or bad.</li><li>Repeat until Git prints the exact commit hash and author that introduced the regression.</li></ul><blockquote><strong><em>Pro-Tip:</em></strong><em> If you have an automated test script that checks for the bug, you can automate the entire search in seconds:</em></blockquote><pre>git bisect run ./mvnw test -Dtest=PaymentServiceTest#testTaxCalculation</pre><h3>3. git worktree — Context Switching Without the Stash Chaos</h3><h4>The Real-World Scenario</h4><p>You are halfway through a complex refactoring spanning 20 uncommitted files. Suddenly, a severity-1 outage occurs in production. You need to hotfix main immediately.</p><p>Usually, this means scrambling to write git stash, checking out main, fixing the bug, pushing, checking back to your feature branch, and running git stash pop (and praying your local changes survive cleanly).</p><h4>How It Helps</h4><p>git worktree lets you check out multiple branches at the exact same time into completely separate directories on your computer, all linked to the same single .git repository.</p><h4>How to Use It</h4><p>To create a clean workspace for a hotfix without disturbing your ongoing feature branch work:</p><pre>git worktree add ../hotfix-dir main</pre><p>This creates a brand new directory (hotfix-dir) right next to your project folder, already checked out to main. You simply open that directory in your editor, write the hotfix, push it, and delete the worktree folder when done:</p><pre>git worktree remove ../hotfix-dir</pre><p>Your original working directory remains completely untouched — no stashing, no dirty state, no lost uncommitted work.</p><h3>4. git log -S (Pickaxe) — Search Code History, Not Commit Messages</h3><h4>The Real-World Scenario</h4><p>You spot a legacy utility function in the codebase, calculateTaxRate(), but you need to know <em>why</em> a specific edge-case block inside it was modified two years ago. Searching standard git log only searches commit <em>messages</em>, which are often unhelpful (e.g., &quot;Fix bugs&quot; or &quot;Refactoring&quot;).</p><h4>How It Helps</h4><p>The -S flag (often called the <strong>Pickaxe</strong>) searches the actual <em>diff content</em> across the entire history of the project. It filters for commits where the specified string was added or removed.</p><h4>How to Use It</h4><pre>git log -S &quot;calculateTaxRate&quot; --oneline</pre><p>If you want to view the actual diffs line-by-line as you search:</p><pre>git log -S &quot;calculateTaxRate&quot; -p</pre><p>This skips thousands of irrelevant commits and takes you straight to the exact commits that introduced or modified that specific snippet.</p><h3>5. git blame -L &amp; git blame -w — Laser-Focused Code Forensic</h3><h4>The Real-World Scenario</h4><p>You use standard git blame on a file to see who wrote a buggy line of code, but the output tells you that <em>every single line</em> was written yesterday by a teammate who ran a auto-linter or code formatter (like Prettier or ESLint) across the file.</p><h4>How It Helps</h4><p>git blame accepts flags that ignore whitespace changes and restrict execution to targeted line numbers, allowing you to bypass formatting noise.</p><h4>How to Use It</h4><ul><li><strong>Ignore Whitespace/Formatting Changes:</strong></li></ul><pre>git blame -w path/to/file.java</pre><ul><li><strong>Target Specific Lines Only:</strong></li></ul><pre>git blame -L 45,60 path/to/file.java</pre><ul><li><strong>Ignore Bulk Formatting Commits:</strong> You can tell Git to ignore full commits (like linting passes) by storing their hashes in a .git-blame-ignore-revs file:</li></ul><pre>git config blame.ignoreRevsFile .git-blame-ignore-revs</pre><h3>6. git reflog — The Universal Undo Button</h3><h4>The Real-World Scenario</h4><p>During a tricky interactive rebase (git rebase -i), you make a wrong move, run git reset --hard, and suddenly notice three days of work have disappeared from your local branch. Panic sets in.</p><h4>How It Helps</h4><p>Git almost <strong>never</strong> deletes history immediately. Every single time your HEAD pointer moves (when you commit, rebase, checkout, merge, or reset), Git logs that movement in the <strong>Reference Log (Reflog)</strong>. Even if a commit is detached or detached from a branch, reflog keeps track of it for up to 90 days.</p><h4>How to Use It</h4><p>Run git reflog to view your complete local activity history:</p><p>Plaintext</p><pre>e4a2b10 HEAD@{0}: reset: moving to HEAD~3<br>7f3a9d2 HEAD@{1}: rebase (finish): returning to refs/heads/feature<br>1c9b8f4 HEAD@{2}: commit: Added payment integration</pre><p>Locate the reference right before you made the mistake (e.g., HEAD@{2} or commit hash 1c9b8f4), and reset back to it:</p><pre>git reset --hard 1c9b8f4</pre><p>Your deleted work is fully restored.</p><h3>Quick Reference Matrix</h3><p><strong>CommandBest Used ForPrimary Benefit</strong><strong>git rerere</strong>Long-running feature branchesAuto-resolves repeated merge conflicts<strong>git bisect</strong>Tracking down silent regressionsFinds broken commits using binary search<strong>git worktree</strong>Urgent hotfixes during active developmentWorks on multiple branches simultaneously<strong>git log -S</strong>Finding when a code snippet changedSearches inside diffs instead of commit messages<strong>git blame -w</strong>Investigating file changesFilters out formatting/linter noise<strong>git reflog</strong>Recovering lost local commitsThe ultimate safety net for local mistakes</p><h3>Summary</h3><p>Mastering Git isn’t about memorizing every obscure flag in the manual; it’s about knowing which tool to reach for when the standard workflow breaks down under enterprise scale. Integrating worktree, bisect, and rerere into your daily developer toolkit will save hours of frustration and keep your focus where it belongs: writing great software.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f41fc2255021" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Credit Card Tokenization? A Deep Dive into Modern Payment Security]]></title>
            <link>https://medium.com/javarevisited/what-is-card-tokenization-a-deep-dive-into-modern-payment-security-3ea2436d39f7?source=rss-33c0cbce4fc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ea2436d39f7</guid>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[tokenization]]></category>
            <category><![CDATA[fintech]]></category>
            <dc:creator><![CDATA[Manoj Kumar]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 15:22:30 GMT</pubDate>
            <atom:updated>2026-06-27T04:19:05.409Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xo8XmOE-QMo3--GNZf80kw.jpeg" /></figure><p>Every time you tap your phone to buy a coffee, click “Order Now” on Amazon, or watch your monthly Netflix subscription automatically renew, a highly sophisticated security dance happens behind the scenes.</p><p>Despite millions of transactions occurring every second, your actual 16-digit credit card number is rarely sent across the internet. Instead, a technology called <strong>Tokenization</strong> acts as an invisible shield, protecting your financial data from hackers and fraudsters.</p><p>Here is a complete, detailed guide to understanding what card tokenization is, how it is generated, how it functions in the real world, and why it has become the backbone of modern digital payments.</p><h3>1. What is Tokenization?</h3><p>At its core, <strong>Tokenization</strong> is a security process that replaces sensitive data — such as a credit card’s Primary Account Number (PAN) — with a non-sensitive substitute called a <strong>Token</strong>.</p><p>A token is a randomly generated string of alphanumeric characters that mimics the format of a standard card number but holds absolutely no intrinsic value.</p><h3>The Problem: Legacy Storage (Without Tokenization)</h3><p>In the early days of e-commerce, when you saved your card on a website, the merchant stored your actual card number, expiry date, and sometimes CVV in their databases.</p><ul><li><strong>The Vulnerability:</strong> If a cybercriminal breached the merchant’s database, they could steal millions of raw card details and immediately use them to make fraudulent purchases anywhere in the world.</li></ul><h3>The Solution: Modern Storage (With Tokenization)</h3><p>With tokenization, the merchant never stores your actual card details. Instead, they store a token.</p><ul><li><strong>The Security:</strong> If a hacker breaches the merchant’s server, they only steal a list of tokens. Because these tokens are locked to that specific merchant or device, they are completely useless to an attacker.</li></ul><h3>2. How a Token is Generated</h3><p>Tokenization isn’t just about generating a random number; it involves a highly regulated ecosystem governed by <strong>Token Service Providers (TSPs)</strong>. TSPs are typically the major card networks (like Visa, Mastercard, and American Express) or specialized banking infrastructure providers.</p><pre>[Customer Card Data] <br>       │<br>       ▼<br>[Token Service Provider (TSP)] ───► Generates Alphanumeric Token<br>       │<br>       ▼<br>[Token Vault] (Securely maps Token ──► Real Card Details)</pre><p>The generation process relies on three primary methods:</p><ul><li><strong>Cryptographic Tokens:</strong> The token is generated using mathematical algorithms and cryptographic keys.</li><li><strong>Random Number Generation:</strong> The system assigns a purely random number to the card data, ensuring there is no mathematical link between the token and the original card number.</li><li><strong>Format-Preserving Encryption (FPE):</strong> The token is generated to look exactly like a credit card number (e.g., a 16-digit string) so legacy payment systems can process it without requiring a software overhaul.</li></ul><p>Once generated, the relationship between the real card number and the token is stored in a highly secure, isolated database called a <strong>Token Vault</strong>.</p><h3>3. How Tokenization Works in Real-Time</h3><p>To understand how tokenization works during a live transaction, let’s look at a step-by-step breakdown of an online purchase:</p><h3>Step 1: Data Capture</h3><p>The customer initiates a purchase on an e-commerce website or app and enters their card details (or selects a previously saved card).</p><h3>Step 2: The Token Request</h3><p>Instead of saving the card data directly, the merchant’s payment gateway sends the sensitive card details to the <strong>Token Service Provider (TSP)</strong> requesting a token.</p><h3>Step 3: Vaulting and Creation</h3><p>The TSP validates the card details, safely locks them away in the <strong>Token Vault</strong>, and generates a unique token (e.g., changing card 4111 1111 1111 1111 into token tkn_9128a7x2b3Y4c5d6).</p><h3>Step 4: Token Delivery</h3><p>The TSP sends this unique token back to the merchant. The merchant stores this token in their database for future transactions.</p><h3>Step 5: Transaction Authorization</h3><p>When a payment needs to be cleared:</p><ul><li>The merchant sends the <strong>token</strong> through the acquiring bank to the card network.</li><li>The card network routes it to the Token Vault to “detokenize” it (matching the token back to the real card number).</li><li>The network verifies funds with the customer’s bank, approves the transaction, and sends an authorization back.</li></ul><p><em>Throughout this entire loop, the merchant and intermediate networks never see the real card data.</em></p><h3>4. Who is Using Tokenization?</h3><p>Tokenization is no longer a luxury feature; it is an industry standard utilized across multiple sectors:</p><ul><li><strong>Mobile Wallets (Apple Pay, Google Pay, Samsung Pay):</strong> When you load your physical card into your phone, the wallet provider requests a device-specific token from your card network. Your actual card number is never stored on your phone or transmitted via NFC during a tap-to-pay transaction.</li><li><strong>E-Commerce Giants (Amazon, Netflix, Shopify):</strong> These platforms use <strong>Card-on-File (COF) tokenization</strong>. When you click “Save Card for Future Use,” they store a token linked specifically to their store.</li><li><strong>Subscription and Utility Services:</strong> Streaming apps, SaaS companies, and utility providers use recurring tokenized billing to charge accounts monthly without exposing raw financial data to recurring leak risks.</li><li><strong>Ride-Hailing and In-App Ecosystems (Uber, Airbnb):</strong> Apps that rely on friction-free, one-click checkouts leverage background tokens to process transactions instantly.</li></ul><h3>5. Why It Is Useful in the Real World: The Big Benefits</h3><p>Tokenization solves massive security and operational pain points for consumers, merchants, and financial institutions alike.</p><h3>A. Drastic Reduction in Data Breaches</h3><p>Because e-commerce databases hold tokens instead of real card numbers, the financial incentive for hackers to target online retailers plummets. A stolen token cannot be used to buy items at a different store or cloned onto a physical plastic card.</p><h3>B. PCI DSS Scope Reduction for Businesses</h3><p>The Payment Card Industry Data Security Standard (PCI DSS) enforces strict, expensive compliance rules on any business that handles raw credit card data. By outsourcing card handling to a Token Service Provider, merchants drastically reduce their compliance scope, saving thousands of dollars in annual audit costs.</p><h3>C. Seamless Customer Experience (No More “Expired Card” Hassles)</h3><p>Have you ever had your physical credit card replaced because it expired or got lost, yet your Netflix subscription kept working smoothly without you updating the card details? That is the power of network tokenization. When a bank issues you a new physical card, they update the link in the <strong>Token Vault</strong>. The token stored by your subscription services remains valid, preventing failed payments and service interruptions.</p><h3>D. Fraud Mitigation</h3><p>Tokens can be restricted by domain, device, or transaction type. For example, a token generated for your Apple Watch cannot be intercepted and used to buy electronics on a desktop browser. This specific contextual lock makes fraud almost impossible to pull off.</p><h3>Conclusion</h3><p>Tokenization is the unsung hero of modern fintech. It balances two seemingly opposing forces: <strong>extreme security</strong> and <strong>frictionless convenience</strong>. By turning sensitive, high-value card numbers into useless, single-purpose tokens, it protects consumers from identity theft, shields merchants from catastrophic data breaches, and ensures that the digital economy can keep moving at lightning speed.</p><p>The next time you make a seamless, one-click purchase online, you can thank the invisible vault working in the background to keep your financial life safe.</p><ul><li><strong>Like</strong> this post if you found it helpful or learned something new ️❤️.</li><li><strong>Follow</strong> for more detailed guides and breakdowns just like this one .</li><li><strong>Comment</strong> your thoughts or questions below — I’d love to hear from you ✌️</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ea2436d39f7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/what-is-card-tokenization-a-deep-dive-into-modern-payment-security-3ea2436d39f7">Credit Card Tokenization? A Deep Dive into Modern Payment Security</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Guide to Maven: Why It’s the Backbone of Enterprise Java]]></title>
            <link>https://medium.com/javarevisited/the-ultimate-guide-to-maven-why-its-the-backbone-of-enterprise-java-6c0199df7a05?source=rss-33c0cbce4fc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c0199df7a05</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[enterprise-technology]]></category>
            <category><![CDATA[maven]]></category>
            <dc:creator><![CDATA[Manoj Kumar]]></dc:creator>
            <pubDate>Mon, 25 May 2026 14:52:47 GMT</pubDate>
            <atom:updated>2026-05-25T14:52:47.494Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*8PW9sCWyBLd0qcjRytQmTw.jpeg" /></figure><p>If you’ve ever felt the pain of manually downloading a .jar file, dropping it into a lib folder, and praying that it doesn’t conflict with three other libraries you installed last week, you’re not alone.</p><p>One wrong library version, and the whole application came crashing down with a dreaded NoClassDefFoundError.</p><p>Enter <strong>Apache Maven 🔥</strong>.</p><p>Whether you are a junior developer trying to make sense of that massive pom.xml file in your repository, or an architect designing a microservices mesh for a Fortune 500 company, understanding Maven is non-negotiable.</p><p>In this comprehensive guide, we will break down what Maven is, the chaotic world it rescued us from, the essential commands you need every day, and exactly how enterprise-level companies use it to deploy software at scale.</p><h3>1. What is Maven (and Why Do We Actually Need It)?</h3><p>At its core, <strong>Maven is a build automation and project management tool.</strong> Many developers mistakenly think Maven is just a tool for downloading dependencies. While it does that exceptionally well, Maven actually manages the entire lifecycle of an application — from creation and compilation to testing, packaging, and deployment.</p><h3>The Philosophy of Maven: Convention Over Configuration</h3><p>Before Maven, build tools like Apache Ant required you to write tedious, custom scripts explaining <em>exactly</em> where your source code was, where the output should go, and how to compile it.</p><p>Maven flipped the script by introducing <strong>Convention over Configuration</strong>. It assumes a standard project structure out of the box. If you follow its rules, you don’t have to write a single line of build configuration.</p><ul><li>src/main/java – Where your production Java code lives.</li><li>src/main/resources – Where your configuration files (like application.properties) live.</li><li>src/test/java – Where your unit tests live.</li><li>target/ – Where Maven outputs your compiled .class files and final .jar or .war packages.</li></ul><p>By enforcing this uniform structure, any Java developer on earth can open a Maven project and instantly know exactly where everything is.</p><h3>2. Life Before Maven: The Problems It Solved</h3><p>To truly appreciate Maven, we have to look at the dark ages of Java development. Let’s look at the specific problems developers faced daily and how Maven solved them.</p><h3>Problem 1: “Jar Hell” and Manual Dependency Management</h3><p>Without Maven, if your project needed to connect to a PostgreSQL database, you had to manually go to the PostgreSQL website, download the correct .jar file, and add it to your project’s classpath.</p><p>But it didn’t stop there. What if that PostgreSQL driver relied on another library (e.g., a logging framework)? You had to go find and download <em>that</em> library too. This is known as <strong>transitive dependencies</strong>.</p><p><strong>How Maven Solved It:</strong> Maven introduced a centralized configuration file called the <strong>POM (Project Object Model)</strong>, known as pom.xml. Instead of hunting down jars, you simply declare your dependencies using coordinates: a groupId, artifactId, and version.</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.postgresql&lt;/groupId&gt;<br>    &lt;artifactId&gt;postgresql&lt;/artifactId&gt;<br>    &lt;version&gt;42.7.2&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>Maven reads this, automatically downloads the correct jar from the <strong>Maven Central Repository</strong>, and — crucially — recursively fetches all of its transitive dependencies for you.</p><h3>Problem 2: “It Works on My Machine”</h3><p>Before build automation, developers compiled code using their local IDEs (like Eclipse or IntelliJ) or custom shell scripts. If bob was using Java 11 and Alice was using Java 17, or if their local classpaths were slightly different, the project might compile perfectly for Bob but break completely for Alice.</p><p><strong>How Maven Solved It:</strong> Maven provides an isolated, reproducible build environment driven by <strong>Build Lifecycles</strong>. When you run a build command, Maven executes a strict, predictable sequence of phases. Because this cycle is identical on every machine, it completely eliminates environment-specific build bugs.</p><h3>3. The Essential Maven Commands You’ll Use Daily</h3><p>To interact with Maven, you use the Maven Command Line Interface (CLI) via the mvn command. Maven commands are usually mapped to specific phases of its lifecycle. Here are the core commands every Java developer must know:</p><h3>mvn clean</h3><p>Deletes the target/ directory. This ensures that any cached compilation artifacts or old test reports are wiped away, giving you a fresh slate. If your IDE is acting glitchy, this is usually your first line of defense.</p><h3>mvn compile</h3><p>Compiles the source code of the project. It takes the raw .java files from src/main/java and converts them into .class bytecode, placing them into the target/classes folder.</p><h3>mvn test</h3><p>Runs the unit tests of the application using frameworks like JUnit or TestNG found in src/test/java. It compiles the test code first, executes the tests, and generates a report.</p><h3>mvn package</h3><p>This is where the magic happens. It compiles your code, runs your tests, and then bundles the compiled bytecode into its distributable format — usually a .jar (Java Archive) or .war (Web Archive) file—and stores it inside the target/ directory.</p><h3>mvn install</h3><p>Packages your project and installs the resulting JAR/WAR into your <strong>Local Maven Repository</strong> (typically found at ~/.m2/repository on your machine). This allows other local Java projects on your computer to use this project as a dependency.</p><h3>mvn clean install (The Golden Combo)</h3><blockquote><em>💡 </em><strong><em>Pro-Tip:</em></strong><em> In the real world, developers rarely run these commands in isolation. We almost always chain them together. Running </em><em>mvn clean install wipes out old builds, compiles the fresh code, runs all tests, and installs the latest binary locally.</em></blockquote><h3>Useful Diagnostic Commands</h3><ul><li><strong>mvn dependency:tree</strong> – This is a lifesaver. It prints out a visual tree of all your dependencies, showing you exactly which library brought in which transitive dependency. Use this to hunt down version conflicts.</li><li><strong>mvn dependency:analyze</strong> – Analyzes your project to tell you if you have declared dependencies you aren&#39;t actually using, or if you are using dependencies you haven&#39;t explicitly declared.</li></ul><h3>4. How Enterprise Companies Use Maven at Scale</h3><p>In a hobby project, Maven is a nice convenience. In a massive enterprise environment — think Phonepe, Netflix, or global banking systems — Maven is a critical piece of infrastructure. Here is how big companies leverage it:</p><h3>Multi-Module Projects (Monorepos &amp; Microservices)</h3><p>Enterprise applications are rarely just one single project; they consist of dozens of interconnected services. Maven handles this beautifully through <strong>Multi-Module Projects</strong>.</p><p>A typical enterprise structure looks like this:</p><p>Plaintext</p><pre>my-enterprise-app/<br>│<br>├── pom.xml (The Parent POM)<br>│<br>├── core-shared-library/<br>│   └── pom.xml<br>│<br>├── payment-service/<br>│   └── pom.xml<br>│<br>└── user-auth-service/<br>    └── pom.xml</pre><p>The <strong>Parent POM</strong> acts as a centralized command center. Instead of declaring dependency versions inside every single microservice, the enterprise defines them once in the Parent POM using &lt;dependencyManagement&gt;. This ensures that every microservice in the company uses the exact same, security-vetted version of Spring Boot, Log4j, or Hibernate.</p><h3>Private Artifactories (Nexus &amp; Artifactory)</h3><p>Large corporations cannot upload their proprietary, top-secret banking logic to the public Maven Central repository. Furthermore, relying entirely on the public internet to download dependencies during production builds is a massive security risk (susceptible to supply-chain attacks).</p><p>To solve this, enterprises set up internal, private repositories using tools like <strong>Sonatype Nexus</strong> or <strong>JFrog Artifactory</strong>.</p><pre>[Developer Machine] ──&gt; [Internal Private Repository (Nexus)] ──&gt; [Public Maven Central]</pre><p>When a developer or a CI/CD pipeline requests a dependency, Maven is configured to look at the internal corporate repository first. If the library is public, the internal repository caches it; if it’s a private corporate library, it safely serves it within the company firewall.</p><h3>Seamless CI/CD Pipeline Integration</h3><p>In enterprise environments, code is rarely built on a developer’s laptop for production. Instead, tools like Jenkins, GitLab CI, or GitHub Actions handle the heavy lifting.</p><p>Because Maven relies on simple command-line triggers, it integrates perfectly into automated pipelines. A standard enterprise CI pipeline looks something like this:</p><ul><li><strong>Code Check-in:</strong> A developer pushes code to Git.</li><li><strong>Lint &amp; Compile:</strong> The CI server runs mvn compile.</li><li><strong>Security Scan:</strong> Plugins look for vulnerabilities in the pom.xml.</li><li><strong>Automated Testing:</strong> The server runs mvn test. If a single test fails, the build breaks.</li><li><strong>Artifact Deployment:</strong> If all tests pass, <strong>mvn deploy</strong> automatically pushes the final artifact to the company&#39;s private repository, ready to be containerized with Docker and pushed to Kubernetes.</li></ul><h3>Wrapping Up</h3><p>Maven isn’t just a tool that downloads code; it’s a standard operating framework that brings sanity to Java development. It turned build management from a highly error-prone, manual art form into a predictable, automated science.</p><p>By enforcing structural conventions, automating complex dependency trees, providing clear CLI commands, and scaling seamlessly into multi-module enterprise architectures, Maven remains an absolute cornerstone of the software engineering world.</p><p><strong>If you found this guide helpful, please give it a few claps 👏 and share it with your Java teammates to save them from their next “Jar Hell” nightmare!</strong> What are your thoughts? Let’s spark a discussion — drop your thoughts, questions, or experiences in the comments below ❤️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c0199df7a05" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/the-ultimate-guide-to-maven-why-its-the-backbone-of-enterprise-java-6c0199df7a05">The Ultimate Guide to Maven: Why It’s the Backbone of Enterprise Java</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond the ‘New’ Keyword: Mastering Java Dependency Injection with Google Guice]]></title>
            <link>https://medium.com/javarevisited/beyond-the-new-keyword-mastering-java-dependency-injection-with-google-guice-7175cd994a6f?source=rss-33c0cbce4fc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/7175cd994a6f</guid>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[java-dependency-injection]]></category>
            <category><![CDATA[google-guice]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[solid-principles]]></category>
            <dc:creator><![CDATA[Manoj Kumar]]></dc:creator>
            <pubDate>Sun, 17 May 2026 10:03:57 GMT</pubDate>
            <atom:updated>2026-05-17T10:03:57.080Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Q6unHbgAp6PNpvLeaonhQ.jpeg" /></figure><p>If you have spent any time writing Java, you are likely intimately familiar with the new keyword. It’s the foundational building block of object-oriented programming. You need an object, so you instantiate it.</p><p>But as your application scales from a weekend hobby project to a complex enterprise system, a blind reliance on new can quietly turn your codebase into a brittle, untestable nightmare.</p><p>This is where <strong>Dependency Injection (DI)</strong> steps in. In this post, we’ll explore the chaotic reality of life without DI, how DI fixes it, how to implement it using a lightweight framework like <strong>Google Guice</strong>, and precisely when you should (and shouldn’t) use it.</p><h3>The Nightmare of Hard-Coded Dependencies (Life Without DI)</h3><p>To understand why DI is a lifesaver, let’s look at a standard, real-world scenario. Imagine you are building an order-processing system. You have an OrderService that needs to send an email notification every time a user makes a purchase.</p><p>Without DI, your code might look something like this:</p><pre>public class SendGridEmailService {<br>    public void sendEmail(String to, String message) {<br>        // Complex logic to connect to SendGrid API and send mail<br>    }<br>}<br><br>public class OrderService {<br>    private SendGridEmailService emailService;<br><br>    public OrderService() {<br>        // Hardcoded dependency creation!<br>        this.emailService = new SendGridEmailService(); <br>    }<br><br>    public void checkoutOrder(Order order) {<br>        // Process order logic...<br>        emailService.sendEmail(order.getUserEmail(), &quot;Your order is confirmed!&quot;);<br>    }<br>}</pre><p>At first glance, this looks fine. It works. But under the hood, your application has a serious architectural flaw. It is tightly coupled.</p><h3>The Problems We Face Here:</h3><ol><li><strong>Zero Flexibility:</strong> What happens if SendGrid goes down, or your company decides to switch to AWS SES or Mailchimp? You have to open the OrderService class and manually rewrite the constructor to instantiate the new service.</li><li><strong>Untestable Code:</strong> How do you unit test checkoutOrder? You can’t. Because SendGridEmailService is hardcoded inside the constructor, running your unit tests will trigger a real email over the network every single time. You cannot swap it out for a &quot;Mock&quot; or &quot;Fake&quot; email service.</li><li><strong>Violation of SOLID Principles:</strong> OrderService now has two jobs: managing the lifecycle of its dependencies <em>and</em> processing orders. This completely violates the Single Responsibility Principle.</li></ol><h3>What Dependency Injection Actually Solves</h3><p>Dependency Injection is a design pattern that enforces the <strong>Inversion of Control (IoC)</strong> principle. Instead of an object creating the things it needs to do its job, those dependencies are “injected” into it from the outside.</p><p>Think of it this way: In a traditional car factory, the car doesn’t build its own engine. An external assembly line drops a pre-built engine <em>into</em> the car.</p><p>Let’s refactor our code using an interface to decouple the classes, and inject the dependency via the constructor:</p><pre>// 1. Define an abstraction<br>public interface EmailService {<br>    void sendEmail(String to, String message);<br>}<br><br>// 2. Implement the abstraction<br>public class SendGridEmailService implements EmailService {<br>    public void sendEmail(String to, String message) { /* SendGrid API logic */ }<br>}<br><br>// 3. Inject the dependency via Constructor<br>public class OrderService {<br>    private final EmailService emailService;<br><br>    // The dependency is handed to us, we don&#39;t care how it was built!<br>    public OrderService(EmailService emailService) {<br>        this.emailService = emailService;<br>    }<br><br>    public void checkoutOrder(Order order) {<br>        emailService.sendEmail(order.getUserEmail(), &quot;Confirmed!&quot;);<br>    }<br>}</pre><h3>The Benefits:</h3><ul><li><strong>Decoupling:</strong> OrderService only cares that it receives <em>some</em> implementation of EmailService. It doesn&#39;t know or care about the underlying provider.</li><li><strong>Flawless Testing:</strong> In your unit tests, you can easily pass a dummy implementation: new OrderService(new MockEmailService()). No real emails are sent, and you can test your order logic in isolation.</li></ul><h3>Enter Google Guice: Automating the Plumbing</h3><p>Manual dependency injection (wiring up everything by hand in your main method) is great for tiny apps. But if your application has hundreds of classes, tracking down which object needs what and calling new in the correct order becomes an absolute logistical mess.</p><p><strong>Google Guice</strong> is an ultra-lightweight, fast DI framework developed by Google that handles this wiring for you using Java annotations. Unlike heavy frameworks that use complex XML configs or heavy runtime reflection magic, Guice focuses on type-safe Java code.</p><p>Here is how easily Guice solves our problem in 3 quick steps:</p><h3>Step 1: Add the @Inject Annotation</h3><p>We tell Guice where dependencies are needed using the standard jakarta.inject.Inject (or com.google.inject.Inject) annotation.</p><pre>import com.google.inject.Inject;<br><br>public class OrderService {<br>    private final EmailService emailService;<br><br>    @Inject // Guice looks for this and knows it must provide an EmailService<br>    public OrderService(EmailService emailService) {<br>        this.emailService = emailService;<br>    }<br>}</pre><h3>Step 2: Define the Blueprint (The Module)</h3><p>Guice needs to know <em>which</em> concrete class to provide when an interface is requested. We configure this inside a Module.</p><pre>import com.google.inject.AbstractModule;<br><br>public class BillingModule extends AbstractModule {<br>    @Override<br>    protected void configure() {<br>        // Link the interface to the concrete implementation<br>        bind(EmailService.class).to(SendGridEmailService.class);<br>    }<br>}</pre><h3>Step 3: Bootstrap and Play (The Injector)</h3><p>Finally, we initialize the Guice Injector at our application&#39;s entry point. Guice reads our module blueprint, maps out the entire dependency graph, and constructs our objects perfectly.</p><pre>import com.google.inject.Guice;<br>import com.google.inject.Injector;<br><br>public class Application {<br>    public static void main(String[] args) {<br>        // 1. Create the injector with our configuration module<br>        Injector injector = Guice.createInjector(new BillingModule());<br><br>        // 2. Instead of calling &quot;new&quot;, ask Guice for the object<br>        OrderService orderService = injector.getInstance(OrderService.class);<br>        <br>        // 3. Run your application<br>        orderService.checkoutOrder(new Order(&quot;user@example.com&quot;));<br>    }<br>}</pre><p>Think of Guice’s @Inject as <strong>the new </strong><strong>new</strong>. It acts as a smart registry that builds your complex dependency graphs effortlessly behind the scenes.</p><h3>When to Use DI (and When to Walk Away)</h3><p>Dependency Injection is powerful, but it isn’t a silver bullet. Applying it blindly everywhere can overcomplicate a simple system.</p><h3>Where you SHOULD use DI:</h3><ul><li><strong>Business Logic and Services:</strong> Classes that contain core application logic (e.g., UserService, PaymentProcessor, InventoryManager) that rely on external infrastructure.</li><li><strong>Data Access Objects (DAOs) / Repositories:</strong> Any layer communicating with external data sources like databases, third-party APIs, or cache clusters.</li><li><strong>Applications that require automated testing:</strong> If writing unit tests and using mock frameworks (like Mockito) is a core part of your workflow, DI is essentially non-negotiable.</li></ul><h3>Where you SHOULD NOT use DI:</h3><ul><li><strong>Data Models / Entities / POJOs:</strong> Plain Old Java Objects that just hold state (e.g., a User class with a name and email, an Order object with a list of items). Use standard constructors or builders here.</li><li><strong>Utility Classes:</strong> Pure, stateless mathematical or helper functions (e.g., StringUtils.isBlank() or MathUtils.square()). These should use static methods rather than instances managed by a DI container.</li><li><strong>Ultra-Simple Scripts:</strong> If you are writing a 50-line utility script to parse a single local text file, adding a DI framework introduces unnecessary boilerplate and mental overhead for no realistic gain.</li></ul><h3>Final Thoughts</h3><p>Dependency Injection is less about a specific tool (like Google Guice or Spring) and more about a <strong>mindset shift</strong>. It moves your code away from rigid, deeply intertwined structures and pushes it toward modular, swappable components.</p><p>By separating <em>how an object is used</em> from <em>how it is created</em>, you give your Java applications the breathing room to grow, evolve, and remain fully testable for years to come.</p><p>👏 <strong>If you found this article helpful, please give it a few claps and share it with your fellow Java developers!</strong> &gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7175cd994a6f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/beyond-the-new-keyword-mastering-java-dependency-injection-with-google-guice-7175cd994a6f">Beyond the ‘New’ Keyword: Mastering Java Dependency Injection with Google Guice</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improve Your Productivity with Scripting]]></title>
            <link>https://medium.com/javarevisited/improve-your-productivity-with-scripting-68b0d9bc82c4?source=rss-33c0cbce4fc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/68b0d9bc82c4</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[scripting]]></category>
            <category><![CDATA[bash-script]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Manoj Kumar]]></dc:creator>
            <pubDate>Mon, 16 Mar 2026 15:44:37 GMT</pubDate>
            <atom:updated>2026-03-16T15:44:37.267Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZBty2XgufGdWPhqGvYTzmw.jpeg" /></figure><p>Developers who have a lot of experience building rigid, quality software tend to automate most of their work by writing scripts. These scripts range from simple alias bash commands to repetitive cron triggers that run on a server.</p><p>In this tutorial, you’ll learn about what scripting is, its many use cases, and some advantages and disadvantages of using scripts. We’ll also go through a few example scripts so you can see them in action.</p><h3>What is a Script?</h3><p>A script is a set of instructions written in any scripting language (like Bash, Python, JavaScript, and others) that helps you automate tasks or control processes. Unlike compiled programs, scripts are typically <a href="https://www.freecodecamp.org/news/compiled-versus-interpreted-languages/">interpreted</a>, meaning they are executed directly by a runtime environment without prior compilation.</p><p>Scripts are powerful tools for automating repetitive tasks, managing workflows, and solving small (and sometimes large) problems efficiently. Whether you’re a beginner or an experienced developer, understanding how to write scripts can enhance your productivity and broaden your technical capabilities.</p><h3>Why Write Scripts?</h3><p>I’ve already touched on what you can do with scripts. So let’s look at some of their advantages (and challenges, too) so you understand why they’re so powerful — and when to use them.</p><h3>Advantages of scripts</h3><ol><li>Automation: Scripts can help you simplify repetitive tasks such as data processing or file management.</li><li>Efficiency: they can also save you time by automating tasks that you would otherwise have to do manually.</li><li>Error reduction: Scripts can help reduce human errors through consistent execution of instructions.</li><li>Flexibility: Scripts can adapt to a wide variety of tasks with minimal modification.</li><li>Integration: They can also seamlessly integrate with other systems, tools, or workflows.</li></ol><h3>Challenges with scripts</h3><ol><li>Performance: Scripts can be slower than compiled programs due to interpretation overhead.</li><li>Scalability: They’re not always suitable for large-scale or highly complex tasks.</li><li>Debugging: Debugging scripts can sometimes be challenging due to their dynamic nature.</li><li>Security risks: Poorly written scripts can expose vulnerabilities, especially if they execute system-level commands.</li></ol><h3>When to Use vs Not Use Scripts</h3><p>Scripts are ideal for:</p><ol><li>Tasks are simple, well-defined, or one-off</li><li>Prototyping or quickly automating a process</li><li>The scope is small enough to avoid complexity</li></ol><p>Scripts are not ideal for:</p><ol><li>Performance-critical tasks requiring high efficiency. Instead of a script, try using a dedicated ETL (Extract, Transform, Load) tool or a message broker, or similar alternative tools that fit your use-case.</li><li>Applications with extensive user interfaces. Instead, you can build a small application or a modular system with proper logging, testing, and documentation.</li><li>Scenarios needing long-term maintenance, where compiled programs might be more stable. Instead, use task schedulers or workflow managers like CRON, Airflow, AWS Lambda/GCP Functions.</li></ol><h3>How to Write Effective Scripts</h3><p>This is the process I use for writing helpful scripts. After we go through this, we’ll see some examples of scripts in different languages so you can get some hands-on practice.</p><ol><li>Define the problem: Before writing a script, identify the problem it will solve. Be clear about the tasks to automate and the expected outcomes.</li><li>Choose the right language:<br><strong>Python</strong> : Great for Data processing, web scraping and more complex automation tasks. <br><strong>BASH : </strong>Ideal for system-level tasks like file operations or server management.<br><strong>JavaScript :</strong> Suited for web development and browser-based automation.</li><li>Write the script: Use a text editor or an Integrated Development Environment (IDE), and make sure you follow best practices like using comments, meaningful variable names, and modular code. We’ll cover these below.</li><li>Test the script: Test the script in a controlled environment to ensure it performs as expected without causing errors.</li><li>Execute and deploy: Run the script in its intended environment. If necessary, schedule its execution using tools like Cron (for Bash) or task schedulers.</li></ol><h3>Example Scripts</h3><p>Now that you know the basics, let’s have some practice. Assume you have around 100 files with the names “book-part-1.pdf”, “book-part-2.pdf”, …, “book-part-100.pdf”. You want to replace all the hyphens (-) in the file names with underscores (_), because the website where you’re trying to upload these documents doesn’t allow you to upload files with names containing hyphens.</p><p>Here are scripts written in three different languages that all perform the same operation. The process looks like this:</p><ol><li>find all the files in a directory,</li><li>check if they contain hyphens (-) in their name, and</li><li>replace any hyphens with underscores (_).</li></ol><p>Here are the file names to start (containing hyphens):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pBFLuUrzG8-PyhsNoiGx8Q.png" /></figure><h3>Bash Script</h3><p>We’ll start with a bash script. Here it is:</p><pre>#!/bin/bash<br># Replace &quot;-&quot; with &quot;_&quot; in file names<br>DIRECTORY=&quot;/path/to/your/folder&quot;<br>for FILE in &quot;$DIRECTORY&quot;/*; do<br>    if [[ &quot;$FILE&quot; == *-* ]]; then<br>        NEW_NAME=$(echo &quot;$FILE&quot; | sed &#39;s/-/_/g&#39;)<br>        mv &quot;$FILE&quot; &quot;$NEW_NAME&quot;<br>        echo &quot;Renamed: $FILE -&gt; $NEW_NAME&quot;<br>    fi<br>done</pre><p>We define the directory (folder) at the top where our files reside. For each file in the directory, we check if the name contains a -. In such case, we create a new file name and store it in the variable NEW_NAME by copying the old file name using the echo command and replace the - with _ using the sed command. Finally we use the move command mv with the old and new file names as arguments.</p><h3>Python Script</h3><p>Next, let’s see what it would look like in Python:</p><pre>import os<br># Replace &quot;-&quot; with &quot;_&quot; in file names<br>directory = &quot;/path/to/your/folder&quot;<br>for filename in os.listdir(directory):<br>    if &quot;-&quot; in filename:<br>        old_path = os.path.join(directory, filename)<br>        new_filename = filename.replace(&quot;-&quot;, &quot;_&quot;)<br>        new_path = os.path.join(directory, new_filename)<br>        os.rename(old_path, new_path)<br>        print(f&quot;Renamed: {filename} -&gt; {new_filename}&quot;)</pre><p>The steps are pretty similar in Python. First, we define the directory and then iterate through each file in the directory. To find all files in the directory, we have to use the listdir method from the os package.</p><p>Then we check if the file name contains a - in the next line. In such a case, we find the current path (old_path) of the file by merging the directory and its file name. We can create the new file name by replacing the - with _ using the replace method.</p><p>We then generate the new file path (new_path) in the similar way we generate the old_path. Finally, we call the rename method in os package with old and new file paths as arguments.</p><h3>JavaScript Script</h3><p>And now let’s see how it would look in JavaScript:</p><pre>const fs = require(&#39;fs&#39;);<br>const path = require(&#39;path&#39;);<br>const directory = &#39;/path/to/your/folder&#39;;<br>fs.readdir(directory, (err, files) =&gt; {<br>    if (err) {<br>        console.error(&#39;Error reading directory:&#39;, err);<br>        return;<br>    }<br>    files.forEach(file =&gt; {<br>        if (file.includes(&#39;-&#39;)) {<br>            const oldPath = path.join(directory, file);<br>            const newFilename = file.replace(/-/g, &#39;_&#39;);<br>            const newPath = path.join(directory, newFilename);<br>            fs.rename(oldPath, newPath, err =&gt; {<br>                if (err) {<br>                    console.error(`Error renaming ${file}:`, err);<br>                } else {<br>                    console.log(`Renamed: ${file} -&gt; ${newFilename}`);<br>                }<br>            });<br>        }<br>    });<br>});</pre><p>The JavaScript implementation is somewhat similar to the Python implementation — but you’ll need to write more code. Generally, devs don’t prefer JavaScript for these kind of scripts. Most of them rely on Bash/Python. JavaScript is better-suited for browser-based automation scripts.</p><p>Still, let’s see what we have here. In this JavaScript code, you have to use two different packages, fs and path. We define the directory at the top, read the files in the directory using the readdir method from the fs package, and pass the directory as the argument. Along with directory, we also pass a callback function that will be executed once the files are read.</p><p>Inside the callback function, we loop through each file and check if the file name includes a hyphen (-). If it does, we find the old path using the path package with the directory and file names as arguments. We then construct the new file name by replacing all hyphens with underscores using the replace method.</p><p>Similar to the old path, we find the new path using the new file name as an argument. Then we use the rename method from the fs package to rename the file by passing both the old and new file names. If there are errors during renaming or reading the files in a directory, we log the error message. Otherwise, we log the success message.</p><h4>How to run these scripts</h4><p>Ok, here’s how you can actually use these scripts:</p><ol><li>Replace /path/to/your/folder with the actual directory containing the files.</li><li>Run the script in the corresponding environment:<br><strong>Bash:</strong> Save as a <em>.sh</em> file, then execute with bash script.sh<br>Python: Save as a <em>.py</em> file, then execute with python script.py<br><strong>JavaScript:</strong> Save as a <em>.js</em> file, then execute with node script.js</li><li>The screenshot below shows running the bash script to change the names of the files.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LwHh1AgGO2A-xxgetqMJnQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uGJC2zcHw0nbaknMD6FjWQ.png" /><figcaption>Filenames After Script execution</figcaption></figure><h3>Recurring Scripts</h3><p>Recurring scripts are designed to execute at regular intervals, like checking a system’s status weekly, cleaning up logs, or fetching data updates. These scripts typically use some form of task scheduler.</p><h3>Common Approaches</h3><ol><li>CRON jobs: Most operating systems support CRON, which can trigger scripts based on a defined schedule.</li><li>Task queues: Tools like Celery (Python), Bull (Node.js), or Sidekiq (Ruby) can handle scheduled jobs with more flexibility.</li><li>Cloud schedulers: Services like AWS Lambda with EventBridge, Google Cloud Scheduler, or Azure Logic Apps allow you to set up recurring scripts in a serverless architecture.</li></ol><p>One good example use case for recurring scripts would be sending a daily/weekly report of your system’s usage/performance. You could write a script that finds the number of users who have joined and subscribed to your product and send that report as an email every day/week.</p><h3>Best Practices for Writing Scripts</h3><p>Here are some things to keep in mind when you’re writing scripts:</p><p><strong>1. Use comments</strong>: Explain complex parts of the script with comments.</p><p>In the below example, without the comment, someone might have to spend extra time figuring out why the tax rate is a decimal and not a percentage.</p><pre># Calculate the total price with tax<br>def calculate_price_with_tax(price, tax_rate):<br>    # Tax rate is expressed as a decimal (e.g., 0.07 for 7%)<br>    return price + (price * tax_rate)</pre><p>2. <strong>Error handling</strong>: Account for possible errors and handle them gracefully.</p><p>In the below example, if the file is missing, the script won’t crash — instead, it will show a helpful error message.</p><pre>try:<br>    with open(&#39;data.csv&#39;, &#39;r&#39;) as file:<br>        data = file.readlines()<br>except FileNotFoundError:<br>    print(&quot;Error: &#39;data.csv&#39; file not found. Make sure the file exists before running the script.&quot;)<br>except Exception as e:<br>    print(f&quot;An unexpected error occurred: {e}&quot;)</pre><p>3. <strong>Modular design</strong>: Break down the script into reusable functions or modules.</p><p>In the below example, by separating functionality into smaller, reusable functions, you can debug or reuse parts of the script independently.</p><pre>def fetch_data_from_api(api_url):<br>    # Fetch data from the given API<br>    pass<br>def process_data(data):<br>    # Process the data into the desired format<br>    pass<br>def save_to_file(data, filename):<br>    # Save processed data to a file<br>    pass<br># Main script<br>if __name__ == &quot;__main__&quot;:<br>    data = fetch_data_from_api(&quot;https://example.com/api&quot;)<br>    processed_data = process_data(data)<br>    save_to_file(processed_data, &quot;output.json&quot;)</pre><p>4. <strong>Input validation</strong>: Validate user inputs to prevent unexpected errors or security risks.</p><p>Without validation, someone could input invalid or malicious data (for example, SQL injection strings in certain scenarios).</p><pre>import re<br># Validate that the input is a valid email address<br>def validate_email(email):<br>    pattern = r&#39;^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$&#39;<br>    if not re.match(pattern, email):<br>        raise ValueError(&quot;Invalid email address format&quot;)<br>    return email<br># Example usage<br>try:<br>    user_email = validate_email(input(&quot;Enter your email: &quot;))<br>    print(f&quot;Valid email: {user_email}&quot;)<br>except ValueError as e:<br>    print(e)</pre><p>5. <strong>Version control</strong>: Use Git or other version control tools to track changes.</p><p>If a change breaks the script, you can easily revert to a previous commit using git checkout. Plus, you can collaborate seamlessly with team members.</p><pre>git init<br>git add script.py<br>git commit -m &quot;Initial commit&quot;</pre><h3>Conclusion</h3><p>Writing scripts is a skill that can significantly boost your productivity and problem-solving abilities. By understanding the basics of scripting languages like Bash, Python, and JavaScript, you can automate tasks, streamline workflows, and save valuable time. Start small, build incrementally, and practice writing scripts for different use cases to master this invaluable skill.</p><p>I have an exercise for you. To run and verify this example script, you may think you have to manually create 100 files. That consumes a lot of time.</p><p>I wrote a script to generate those 100 files. I would also recommend that you try writing a script to generate 100 files with hyphens in their file names. Then try to run the example script to convert the hyphens to underscores.</p><p>This may sound difficult at the beginning, but believe me you just need to write 5 lines of bash code to generate 100 files. Not just 100 — you can even generate a million/billion/trillion files with just 5 lines of code.</p><p><strong>If you wish to learn more about Scripts, subscribe ME ❤️</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68b0d9bc82c4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/improve-your-productivity-with-scripting-68b0d9bc82c4">Improve Your Productivity with Scripting</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your Python Code is Slow (And How to Fix It)]]></title>
            <link>https://python.plainenglish.io/why-your-python-code-is-slow-and-how-to-fix-it-36f3f5860dd8?source=rss-33c0cbce4fc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/36f3f5860dd8</guid>
            <category><![CDATA[multithreading]]></category>
            <category><![CDATA[python-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[concurrency]]></category>
            <category><![CDATA[parallel-computing]]></category>
            <dc:creator><![CDATA[Manoj Kumar]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 12:55:54 GMT</pubDate>
            <atom:updated>2026-02-07T12:55:54.278Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve spent any time building backends in Python, you’ve probably hit that frustrating wall where your app feels sluggish, but your CPU usage looks like it’s barely trying. You think, <em>“Easy, I’ll just throw some threads at it,”</em> only to find out your execution time actually <strong>increased</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v6KwwDWHoRPDw2junH_-Zw.png" /></figure><p>Welcome to the world of Python concurrency. It’s a bit of a maze, and if you don’t have a map, the Global Interpreter Lock (GIL) is waiting to trip you up.</p><h3>The Mental Model: Chefs and Kitchens</h3><p>I always tell junior devs to stop thinking about “code running” and start thinking about a kitchen.</p><ul><li><strong>Concurrency</strong> is a single chef juggling three pans. He’s flipping a pancake, then stirring the soup while the pancake sits. Only one thing is <em>technically</em> happening at any millisecond, but the meal gets done faster because he’s not standing still while the water boils.</li><li><strong>Parallelism</strong> is having three chefs. Period.</li></ul><h3>1. The “Invisible Hand” (The GIL)</h3><p>We can’t talk about system design in Python without acknowledging the elephant in the room: the <strong>Global Interpreter Lock</strong>.</p><p>In most languages, 10 threads mean 10x the power. In Python, the GIL is like a single microphone in a room full of people; only one person can talk at a time. This is why multi-threading for heavy math (CPU-bound stuff) is often a waste of time in Python. You’re just adding the overhead of switching microphones without actually getting more “talking” done.</p><h3>2. When to Use AsyncIO (The Modern Way)</h3><p>If you’re building a web scraper or a FastAPI service, asyncio is your best friend.</p><p>I remember the first time I swapped a standard requests loop for httpx and asyncio. The speedup felt like magic. But here’s the kicker: <strong>AsyncIO is cooperative.</strong> If you write a piece of code that does a heavy calculation inside an async function without yielding control, you’ll freeze your entire server. It’s like the chef forgot to look away from the soup, and now the pancakes are burning.</p><p><strong>Pro-tip:</strong> Use AsyncIO when your code spends 90% of its life waiting for a database or an API to respond.</p><h3>3. Multiprocessing: For When You Need Raw Power</h3><p>When I’m building data processing pipelines or image optimizers, I skip threads entirely and go straight to multiprocessing.</p><p>Each process gets its own memory space and its own GIL. This is how you actually “see” all those cores on your expensive MacBook Pro start sweating. The downside? Processes are “heavy.” They don’t share memory easily. You have to deal with “pickling” data (serialization), which can become a bottleneck if you aren’t careful.</p><h3>My “Rule of Thumb” for System Design</h3><p>After years of breaking things, this is the cheat sheet I use when designing a new service:</p><ol><li><strong>Waiting on a DB/API?</strong> Use AsyncIO. It’s lightweight and scales to thousands of connections.</li><li><strong>Crunching numbers/Legacy I/O?</strong> Use Threading, but keep your expectations low for speed gains.</li><li><strong>Heavy Image/Data processing?</strong> Multiprocessing is the only way to go.</li><li><strong>Scaling a Web App?</strong> Don’t solve it in the code. Use Gunicorn or Uvicorn workers. Let the process manager handle the &quot;parallelism&quot; so your code can stay simple.</li></ol><h3>Final Thought</h3><p>System design isn’t about using the “fastest” tool; it’s about using the right one for the bottleneck you actually have. Python gives you plenty of ways to go fast — you just have to make sure you aren’t fighting the language to do it.</p><h3>Conclusion</h3><p>Thanks for taking the time to read! If this helped you write better, cleaner code, don’t forget to like ❤️ and follow me for more practical development insights. Until next time — <strong>happy coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36f3f5860dd8" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/why-your-python-code-is-slow-and-how-to-fix-it-36f3f5860dd8">Why Your Python Code is Slow (And How to Fix It)</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java Design Patterns Part: 1]]></title>
            <link>https://medium.com/javarevisited/java-design-patterns-part-1-200efa4dcd27?source=rss-33c0cbce4fc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/200efa4dcd27</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[creational-design-pattern]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java-design-pattern]]></category>
            <dc:creator><![CDATA[Manoj Kumar]]></dc:creator>
            <pubDate>Sat, 17 Jan 2026 14:37:38 GMT</pubDate>
            <atom:updated>2026-01-17T14:37:38.995Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*nSOQpkbkn4EPYNmjpQpQrQ.webp" /><figcaption>Image source : geeksforgeeks.org</figcaption></figure><h3>Mastering Object Creation: A Deep Dive into Java’s Creational Design Patterns</h3><p>In the world of software development, creating objects is a fundamental task. But how we create them can significantly impact the flexibility, maintainability, and scalability of our applications. This is where <strong>Creational Design Patterns</strong> come into play.</p><p>Creational patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner that is suitable for the situation. They make a system independent of how its objects are created, composed, and represented.</p><h3>Why Use Creational Patterns?</h3><ul><li><strong>Decoupling:</strong> Separate the client from the concrete implementation of objects.</li><li><strong>Flexibility:</strong> Allow new object types to be introduced without modifying client code.</li><li><strong>Control:</strong> Manage how and when objects are created, often improving resource usage.</li><li><strong>Complexity Management:</strong> Simplify the construction of complex objects.</li></ul><p>Let’s dive in!</p><h3>1. Singleton Pattern: The One and Only</h3><p>The <strong>Singleton Pattern</strong> ensures that a class has <strong>only one instance</strong> and provides a global point of access to it. It’s like having a single President for a country — there can only be one at any given time.</p><p><strong>When to Use It:</strong></p><ul><li>Logging services</li><li>Configuration managers</li><li>Database connection pools</li><li>Resource-intensive objects where only one instance is needed globally.</li></ul><p><strong>Example: Configuration Manager</strong></p><p>Let’s say you have an application-wide configuration that should be loaded once and accessed everywhere.</p><pre><br>public class ConfigurationManager {<br>    // 1. Private static instance of the class<br>    private static ConfigurationManager instance;<br>    <br>    private String appName;<br>    private int maxConnections;<br>// 2. Private constructor to prevent direct instantiation<br>    private ConfigurationManager() {<br>        // Simulate loading configuration from a file or database<br>        this.appName = &quot;My Awesome App&quot;;<br>        this.maxConnections = 10;<br>        System.out.println(&quot;ConfigurationManager initialized.&quot;);<br>    }<br>    // 3. Public static method to provide access to the instance<br>    public static ConfigurationManager getInstance() {<br>        if (instance == null) {<br>            // Lazy initialization: create instance only when first requested<br>            instance = new ConfigurationManager();<br>        }<br>        return instance;<br>    }<br>    // Getters for configuration properties<br>    public String getAppName() {<br>        return appName;<br>    }<br>    public int getMaxConnections() {<br>        return maxConnections;<br>    }<br>    // Optional: Example of potential thread-safety issue (fixed below)<br>    // For a truly thread-safe singleton, consider:<br>    // 1. Eager initialization: private static final ConfigurationManager instance = new ConfigurationManager();<br>    // 2. Synchronized getInstance method: public static synchronized ConfigurationManager getInstance() { ... }<br>    // 3. Double-checked locking<br>    // 4. Enum Singleton (most robust)<br>}</pre><p><strong>Demo:</strong></p><pre><br>public class SingletonDemo {<br>    public static void main(String[] args) {<br>        ConfigurationManager config1 = ConfigurationManager.getInstance();<br>        ConfigurationManager config2 = ConfigurationManager.getInstance();<br><br>        System.out.println(&quot;Config1 App Name: &quot; + config1.getAppName());<br>        System.out.println(&quot;Config2 Max Connections: &quot; + config2.getMaxConnections());<br>        // Verify that both references point to the same instance<br>        System.out.println(&quot;Are config1 and config2 the same instance? &quot; + (config1 == config2)); <br>        // Expected Output: true<br>    }<br>}</pre><p><strong>Explanation:</strong> Notice how ConfigurationManager initialized. is printed only once, confirming that only a single instance is created, even when getInstance() is called multiple times.</p><h3>2. Factory Method Pattern: Let the Subclasses Decide</h3><p>The <strong>Factory Method Pattern</strong> provides an interface for creating objects in a superclass, but allows subclasses to alter the type of objects that will be created. It focuses on the <strong>“What”</strong> object to create.</p><p><strong>When to Use It:</strong></p><ul><li>When a class can’t anticipate the class of objects it must create.</li><li>When a class wants its subclasses to specify the objects it creates.</li><li>When you want to decouple the client code from the concrete classes.</li></ul><p><strong>Example: Document Processing</strong></p><p>Imagine a document editor that can create different types of documents (e.g., Text, Spreadsheet).</p><pre><br>// Product Interface<br>interface Document {<br>    void open();<br>    void save();<br>}<br><br>// Concrete Products<br>class TextDocument implements Document {<br>    @Override<br>    public void open() {<br>        System.out.println(&quot;Opening Text Document.&quot;);<br>    }<br>    @Override<br>    public void save() {<br>        System.out.println(&quot;Saving Text Document.&quot;);<br>    }<br>}<br>class SpreadsheetDocument implements Document {<br>    @Override<br>    public void open() {<br>        System.out.println(&quot;Opening Spreadsheet Document.&quot;);<br>    }<br>    @Override<br>    public void save() {<br>        System.out.println(&quot;Saving Spreadsheet Document.&quot;);<br>    }<br>}<br>// Creator Abstract Class<br>abstract class DocumentCreator {<br>    // The Factory Method<br>    public abstract Document createDocument();<br>    public void createAndOpenDocument() {<br>        Document doc = createDocument(); // Call factory method<br>        doc.open();<br>        // ... other common operations ...<br>    }<br>}<br>// Concrete Creators<br>class TextDocumentCreator extends DocumentCreator {<br>    @Override<br>    public Document createDocument() {<br>        return new TextDocument();<br>    }<br>}<br>class SpreadsheetDocumentCreator extends DocumentCreator {<br>    @Override<br>    public Document createDocument() {<br>        return new SpreadsheetDocument();<br>    }<br>}</pre><p><strong>Demo:</strong></p><pre><br>public class FactoryMethodDemo {<br>    public static void main(String[] args) {<br>        // Create a Text Document via its creator<br>        DocumentCreator textCreator = new TextDocumentCreator();<br>        textCreator.createAndOpenDocument(); // Uses TextDocument<br><br>         System.out.println(&quot;-----&quot;);<br>        // Create a Spreadsheet Document via its creator<br>        DocumentCreator spreadsheetCreator = new SpreadsheetDocumentCreator();<br>        spreadsheetCreator.createAndOpenDocument(); // Uses SpreadsheetDocument<br>    }<br>}</pre><p><strong>Explanation:</strong> The DocumentCreator class doesn&#39;t know <em>which</em> concrete Document it will create; its subclasses (e.g., TextDocumentCreator) decide this by implementing the createDocument() factory method. The client (FactoryMethodDemo) interacts with the abstract creator, achieving loose coupling.</p><h3>3. Abstract Factory Pattern: Factories of Factories</h3><p>The <strong>Abstract Factory Pattern</strong> provides an interface for creating <strong>families of related or dependent objects</strong> without specifying their concrete classes. It’s a “factory of factories.”</p><p><strong>When to Use It:</strong></p><ul><li>When your system needs to be independent of how its products are created, composed, and represented.</li><li>When a system should be configured with one of multiple families of products.</li><li>When a family of related product objects is designed to be used together.</li></ul><p><strong>Example: UI Toolkit (Windows vs. Mac)</strong></p><p>Imagine creating UI components (Button, Checkbox) that look different depending on the operating system.</p><pre><br>// Product Interfaces<br>interface Button {<br>    void render();<br>}<br><br>interface Checkbox {<br>    void render();<br>}<br>// Concrete Products for Windows<br>class WindowsButton implements Button {<br>    @Override<br>    public void render() {<br>        System.out.println(&quot;Rendering a Windows Button.&quot;);<br>    }<br>}<br>class WindowsCheckbox implements Checkbox {<br>    @Override<br>    public void render() {<br>        System.out.println(&quot;Rendering a Windows Checkbox.&quot;);<br>    }<br>}<br>// Concrete Products for Mac<br>class MacButton implements Button {<br>    @Override<br>    public void render() {<br>        System.out.println(&quot;Rendering a Mac Button.&quot;);<br>    }<br>}<br>class MacCheckbox implements Checkbox {<br>    @Override<br>    public void render() {<br>        System.out.println(&quot;Rendering a Mac Checkbox.&quot;);<br>    }<br>}<br>// Abstract Factory Interface<br>interface GUIFactory {<br>    Button createButton();<br>    Checkbox createCheckbox();<br>}<br>// Concrete Factories<br>class WindowsFactory implements GUIFactory {<br>    @Override<br>    public Button createButton() {<br>        return new WindowsButton();<br>    }<br>    @Override<br>    public Checkbox createCheckbox() {<br>        return new WindowsCheckbox();<br>    }<br>}<br>class MacFactory implements GUIFactory {<br>    @Override<br>    public Button createButton() {<br>        return new MacButton();<br>    }<br>    @Override<br>    public Checkbox createCheckbox() {<br>        return new MacCheckbox();<br>    }<br>}<br>// Client Code<br>class Application {<br>    private Button button;<br>    private Checkbox checkbox;<br>    public Application(GUIFactory factory) {<br>        button = factory.createButton();<br>        checkbox = factory.createCheckbox();<br>    }<br>    public void paint() {<br>        button.render();<br>        checkbox.render();<br>    }<br>}</pre><p><strong>Demo:</strong></p><pre><br>public class AbstractFactoryDemo {<br>    public static void main(String[] args) {<br>        Application app;<br>        GUIFactory factory;<br>        <br>        // Simulate choosing OS<br>        String os = &quot;Windows&quot;; // or &quot;Mac&quot;<br>        if (os.equals(&quot;Windows&quot;)) {<br>            factory = new WindowsFactory();<br>        } else {<br>            factory = new MacFactory();<br>        }<br>        app = new Application(factory);<br>        app.paint();<br>        System.out.println(&quot;-----&quot;);<br>        os = &quot;Mac&quot;;<br>        if (os.equals(&quot;Windows&quot;)) {<br>            factory = new WindowsFactory();<br>        } else {<br>            factory = new MacFactory();<br>        }<br>        app = new Application(factory);<br>        app.paint();<br>    }<br>}</pre><p><strong>Explanation:</strong> The Application class (client) doesn&#39;t know if it&#39;s getting WindowsButton or MacButton. It only interacts with the GUIFactory interface. The specific factory (WindowsFactory or MacFactory) dictates the &quot;family&quot; of UI components created, ensuring consistency.</p><h3>4. Builder Pattern: Step-by-Step Construction</h3><p>The <strong>Builder Pattern</strong> separates the construction of a <strong>complex object</strong> from its representation. It allows you to produce different types and representations of an object using the same construction code. It focuses on the <strong>“How”</strong> to create.</p><p><strong>When to Use It:</strong></p><ul><li>When an object has many attributes, some of which are optional (avoid “telescoping constructors”).</li><li>When you need to construct complex objects with different representations.</li><li>When you want to make an object immutable after creation.</li></ul><p><strong>Example: User Profile</strong></p><p>Consider a User object with many fields, where some are mandatory and others are optional.</p><p>Java</p><pre><br>public class User {<br>    private final String firstName;  // Required<br>    private final String lastName;   // Required<br>    private final int age;           // Optional<br>    private final String email;      // Optional<br>    private final String phone;      // Optional<br>    private final String address;    // Optional<br><br>// Private constructor, only accessible by the Builder<br>    private User(UserBuilder builder) {<br>        this.firstName = builder.firstName;<br>        this.lastName = builder.lastName;<br>        this.age = builder.age;<br>        this.email = builder.email;<br>        this.phone = builder.phone;<br>        this.address = builder.address;<br>    }<br>    // Getters for all fields (no setters for immutability)<br>    public String getFirstName() { return firstName; }<br>    public String getLastName() { return lastName; }<br>    public int getAge() { return age; }<br>    public String getEmail() { return email; }<br>    public String getPhone() { return phone; }<br>    public String getAddress() { return address; }<br>    @Override<br>    public String toString() {<br>        return &quot;User [firstName=&quot; + firstName + &quot;, lastName=&quot; + lastName + &quot;, age=&quot; + age + <br>               &quot;, email=&quot; + email + &quot;, phone=&quot; + phone + &quot;, address=&quot; + address + &quot;]&quot;;<br>    }<br>    // Static nested Builder class<br>    public static class UserBuilder {<br>        // Required fields (copied from User)<br>        private final String firstName;<br>        private final String lastName;<br>        // Optional fields (with default values or null)<br>        private int age = 0;<br>        private String email = null;<br>        private String phone = null;<br>        private String address = null;<br>        // Constructor for required fields<br>        public UserBuilder(String firstName, String lastName) {<br>            this.firstName = firstName;<br>            this.lastName = lastName;<br>        }<br>        // Setter-like methods that return the builder instance (fluent API)<br>        public UserBuilder age(int age) {<br>            this.age = age;<br>            return this;<br>        }<br>        public UserBuilder email(String email) {<br>            this.email = email;<br>            return this;<br>        }<br>        public UserBuilder phone(String phone) {<br>            this.phone = phone;<br>            return this;<br>        }<br>        public UserBuilder address(String address) {<br>            this.address = address;<br>            return this;<br>        }<br>        // The build method creates and returns the final User object<br>        public User build() {<br>            // Optional: Add validation logic here before building<br>            if (age &lt; 0) {<br>                throw new IllegalArgumentException(&quot;Age cannot be negative.&quot;);<br>            }<br>            return new User(this);<br>        }<br>    }<br>}</pre><p><strong>Demo:</strong></p><pre><br>public class BuilderDemo {<br>    public static void main(String[] args) {<br>        // Build a user with all fields<br>        User user1 = new User.UserBuilder(&quot;Alice&quot;, &quot;Smith&quot;)<br>                        .age(30)<br>                        .email(&quot;alice@example.com&quot;)<br>                        .phone(&quot;123-456-7890&quot;)<br>                        .address(&quot;123 Main St&quot;)<br>                        .build();<br>        System.out.println(user1);<br><br>        System.out.println(&quot;-----&quot;);<br>        // Build a user with only required fields and age<br>        User user2 = new User.UserBuilder(&quot;Bob&quot;, &quot;Johnson&quot;)<br>                        .age(25)<br>                        .build();<br>        System.out.println(user2);<br>        System.out.println(&quot;-----&quot;);<br>        // Build a user with required fields and email<br>        User user3 = new User.UserBuilder(&quot;Charlie&quot;, &quot;Brown&quot;)<br>                        .email(&quot;charlie@example.com&quot;)<br>                        .build();<br>        System.out.println(user3);<br>    }<br>}</pre><p><strong>Explanation:</strong> The UserBuilder provides a readable, step-by-step way to construct User objects. You only set the fields you need, and the build() method creates the final, immutable User object. This avoids confusing constructors with many parameters.</p><h3>5. Prototype Pattern: Cloning Existing Objects</h3><p>The <strong>Prototype Pattern</strong> creates new objects by <strong>cloning an existing object</strong>. This is particularly useful when the cost of creating a new instance from scratch is expensive or complex, or when you want to avoid coupling your client code with concrete creational classes.</p><p><strong>When to Use It:</strong></p><ul><li>When your application needs to create many objects that are similar to existing objects.</li><li>When object creation is costly (e.g., database queries, complex calculations).</li><li>When you want to decouple the client from the object’s class.</li></ul><p><strong>Example: Shape Cloning</strong></p><p>Let’s say you have various Shape objects, and you want to create copies of them.</p><p>Java</p><pre>// Product Interface with cloning capability<br>interface Shape extends Cloneable {<br>    void draw();<br>    Shape cloneShape(); // Custom clone method<br>}</pre><p><strong>Demo:</strong></p><pre><br>public class PrototypeDemo {<br>    public static void main(String[] args) {<br>        // Create initial shapes (prototypes)<br>        Circle originalCircle = new Circle(10, &quot;Red&quot;);<br>        Rectangle originalRectangle = new Rectangle(20, 15, &quot;Blue&quot;);<br>        System.out.println(&quot;Original Shapes:&quot;);<br>        originalCircle.draw();<br>        originalRectangle.draw();<br>        System.out.println(&quot;\nCloned Shapes:&quot;);<br>        // Clone the circle and modify it<br>        Circle clonedCircle = (Circle) originalCircle.cloneShape();<br>        clonedCircle.setColor(&quot;Green&quot;);<br>        clonedCircle.setRadius(12);<br>        clonedCircle.draw(); // New radius and color<br>        // Clone the rectangle and modify it<br>        Rectangle clonedRectangle = (Rectangle) originalRectangle.cloneShape();<br>        clonedRectangle.setHeight(18);<br>        clonedRectangle.draw(); // New height<br>        System.out.println(&quot;\nOriginals after cloning and modifying clones (unchanged):&quot;);<br>        originalCircle.draw();    // Original should remain unchanged<br>        originalRectangle.draw(); // Original should remain unchanged<br>    }<br>}</pre><p><strong>Explanation:</strong> Instead of using new Circle(...) or new Rectangle(...), we create new objects by calling cloneShape() on an existing &quot;prototype.&quot; This is particularly powerful if constructing a shape is a complex process (e.g., loading textures or calculating complex geometry). The cloneShape() method creates a new object from the prototype, which can then be modified independently without affecting the original.</p><h3>Conclusion</h3><p>Creational design patterns are powerful tools in a Java developer’s arsenal. They provide structured ways to create objects, promoting flexibility, reducing coupling, and improving the overall maintainability and extensibility of your code.</p><p>By understanding and applying patterns like Singleton, Factory Method, Abstract Factory, Builder, and Prototype, you can write more robust, adaptable, and professional Java applications.</p><p>Which creational pattern do you find yourself using the most in your projects? Share your thoughts in the comments below!</p><p>Thanks for taking the time to read! If this helped you write better, cleaner code, don’t forget to like and follow me for more practical development insights. Until next time — <strong>happy coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=200efa4dcd27" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/java-design-patterns-part-1-200efa4dcd27">Java Design Patterns Part: 1</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java Garbage Collection: Choosing the Correct Collector for Modern Applications]]></title>
            <link>https://medium.com/javarevisited/java-garbage-collection-choosing-the-correct-collector-for-modern-applications-c4942071d851?source=rss-33c0cbce4fc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4942071d851</guid>
            <category><![CDATA[java-garbage-collection]]></category>
            <category><![CDATA[garbage-collection]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[java-development]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Manoj Kumar]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 14:09:42 GMT</pubDate>
            <atom:updated>2026-01-17T14:37:39.277Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3IcOLRhPbvmf-Dwy6zjLRg.png" /></figure><h3>Garbage Collection in Java: Choosing the Right Collector for Your Workload</h3><p>Automatic memory management is one of the crown jewels of the Java ecosystem. In a recent presentation, <strong>Stefan Johansson</strong> provided an in-depth exploration of the Java Garbage Collection (GC) landscape, offering a roadmap for developers to navigate the complexities of memory reclamation.</p><p>As Java applications move from massive monolithic servers to lean cloud-native microservices, understanding which collector to use is more critical than ever.</p><h3>Why We Need Automatic Memory Management</h3><p>At its core, Garbage Collection allows developers to focus on business logic rather than the tedious and error-prone task of manual memory management. A high-quality GC ensures two things: <strong>fast allocations</strong> and <strong>efficient reclamation</strong> of unused memory.</p><p>While memory allocation is handled similarly across most Java collectors, the strategies for <em>reclamation</em> differ significantly. These differences define the characteristics of each collector and determine which one is right for your specific use case.</p><h3>The Three Pillars of GC Performance</h3><p>When choosing a collector, you are essentially balancing a “Trilemma” of three competing priorities:</p><ol><li><strong>Throughput:</strong> The percentage of total time spent executing your application code versus the time spent on GC. High throughput is vital for batch processing.</li><li><strong>Latency:</strong> The time the application is unresponsive due to GC pauses (the “Stop-the-World” events). This is critical for interactive services.</li><li><strong>Footprint:</strong> The additional native memory and CPU resources required by the GC itself to maintain its data structures.</li></ol><h3>Exploring the OpenJDK Collectors</h3><p>The OpenJDK offers a variety of collectors tailored for different environments:</p><h3>1. Serial Collector</h3><p>The simplest implementation, using a single thread for GC. It has very low native memory overhead, making it an excellent choice for small containers or sidecar processes where resources are strictly limited.</p><h3>2. Parallel Collector</h3><p>Designed for maximum throughput. It uses multiple threads to perform GC work. While it is highly efficient at processing data, it can lead to long “worst-case” latencies, making it better suited for background tasks rather than user-facing APIs.</p><h3>3. G1 (Garbage-First) Collector</h3><p>The <strong>default collector since JDK 9</strong>. G1 is a balanced choice, offering a mix of high throughput and predictable latency. It divides the heap into regions and prioritizes those with the most “garbage” first. Over recent JDK releases, G1 has seen massive improvements in native memory reduction and smarter ergonomics.</p><h3>4. ZGC (Z Garbage Collector)</h3><p>Introduced as a game-changer for low latency. ZGC performs almost all its work concurrently with the application threads, aiming for <strong>sub-millisecond pauses</strong>. It is incredibly scalable, supporting heaps ranging from 8MB to a massive 16TB. With the introduction of <strong>Generational ZGC</strong> in JDK 21, it now offers significantly improved throughput alongside its legendary low latency.</p><h3>5. Shenandoah</h3><p>Similar to ZGC, Shenandoah focuses on ultra-low latency by performing evacuation work concurrently. It provides another robust option for applications where pause times are the primary concern.</p><h3>Strategies for Tuning and Verification</h3><p>Choosing the collector is only the first step. To get the most out of the JVM, consider these best practices:</p><ul><li><strong>Re-evaluate Old Flags:</strong> If you are migrating from an older Java version, don’t just copy-paste your -X flags. Many old tuning parameters are now obsolete or handled automatically by modern JVM ergonomics.</li><li><strong>Heap Sizing is Key:</strong> For G1, the goal is to avoid “Full GCs.” For ZGC, the goal is to avoid “Allocation Stalls.” Both require a properly sized heap to give the collector room to work.</li><li><strong>Low-Level Optimization:</strong> For high-performance needs, look into <strong>Transparent Huge Pages</strong> and <strong>NUMA support</strong>, which can significantly improve how the JVM interacts with the underlying hardware.</li></ul><h3>Monitoring Tools</h3><p>To verify your tuning, Johansson recommends:</p><ul><li><strong>JVM Unified Logging:</strong> Use -Xlog:gc for a clear view of GC behavior.</li><li><strong>Java Flight Recorder (JFR):</strong> For deep, low-overhead insights.</li><li><strong>Native Memory Tracking (NMT):</strong> To monitor the “Footprint” pillar of your application.</li></ul><h3>Real-World Comparisons: G1 vs. ZGC</h3><p>Benchmark studies like <strong>SPECjbb 2015</strong> reveal the practical differences between these collectors. While <strong>ZGC</strong> shows significantly lower application response times at higher percentiles (99th and 99.9th), <strong>G1</strong> often maintains a lower overall resource footprint.</p><p>In a <strong>Cassandra</strong> case study, the impact of Generational ZGC was clear: non-generational collectors can struggle with high allocation rates, leading to stalls. Moving to Generational ZGC allows the system to handle higher loads without the spike in worst-case response times.</p><h3>Final Takeaways</h3><p>The path to optimal Java performance is rarely one-size-fits-all.</p><ol><li><strong>Identify your priority:</strong> Is it throughput, latency, or footprint?</li><li><strong>Experiment:</strong> Try more than one GC algorithm under realistic load.</li><li><strong>Stay Current:</strong> Always aim to upgrade to the most recent Java release to benefit from the continuous improvements in the GC engines.</li></ol><h3>Conclusion</h3><p>Thanks for taking the time to read! If this helped you write better, cleaner code, don’t forget to like and follow me for more practical development insights. Until next time — <strong>happy coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4942071d851" width="1" height="1" alt=""><hr><p><a href="https://medium.com/javarevisited/java-garbage-collection-choosing-the-correct-collector-for-modern-applications-c4942071d851">Java Garbage Collection: Choosing the Correct Collector for Modern Applications</a> was originally published in <a href="https://medium.com/javarevisited">Javarevisited</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I thought I’d capture in words a feeling a lot of people in the industry are experiencing, but…]]></title>
            <link>https://medium.com/@gmanojkumar03/i-thought-id-capture-in-words-a-feeling-a-lot-of-people-in-the-industry-are-experiencing-but-b2a0868075dd?source=rss-33c0cbce4fc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2a0868075dd</guid>
            <dc:creator><![CDATA[Manoj Kumar]]></dc:creator>
            <pubDate>Sat, 15 Nov 2025 16:04:05 GMT</pubDate>
            <atom:updated>2025-11-15T16:06:51.065Z</atom:updated>
            <content:encoded><![CDATA[<h3>Event Streaming is Topping Out</h3><h3>Event Streaming is Topping Out</h3><p>I thought I’d capture in words a feeling a lot of people in the industry are experiencing, but nobody is publicly talking about.<br>The stream is oversubscribed. In a real sense — there are too many companies chasing the same relatively-small market of pub-sub/event streaming as well as the microscopic market of stream processing.<br>My prediction is simple — we will see a lot of consolidation. I believe we’re in the beginning of that consolidation. Here are the reasons why:</p><h3>1. The Leader is Not Well 🤒</h3><p>Confluent is undisputedly the leader in event streaming and stream processing. Confluent is not performing well.</p><p>The stock price is the best concise indicator. It IPO’d at $36, peaked at $91 and has been largely trading between $20–30 for the last 3+ years.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qj4rO2Ux9P4QrNzc.png" /></figure><p>That is awful performance plain and simple.</p><p>Even if we ignore the $91 peak and call it bubbly times, as of writing it’s still -36% off from its IPO price. As someone who tracks the stock, I can’t express how stuck it feels between $20–30.</p><p>Why is the stock like that?</p><p>Confluent’s growth is topping out. Their cloud product, the golden child which grew fast, is decelerating rapidly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g4EVX9DCSNSXQdGQ.png" /></figure><p>Confluent <strong>Cloud</strong> YoY revenue growth, alongside quarterly revenue and quarterly nominal increases. You can see they’re quite visibly struggling to add more than $8–10M a quarter.</p><p>What’s worse is that this 24% growth rate is just for their cloud product. Another substantial part of the business comes from on-premise sales (Confluent Platform). That part, $125.4M for Q3/25, grew by just 14%.</p><p>The total is a 19.4% revenue growth rate.</p><p>2025 isn’t over yet and Confluent’s growth rate is already going into the teens. If the next quarters trend the same way, we may see single-digit growth by end of next year.</p><p>It’s no small feat to reach this revenue, but the market values you relative to its other opportunities. And the others are doing much better:</p><ul><li>Confluent has $1.1B of ARR and is growing at 19.4%</li><li>Snowflake has $4.1B TTM and is growing at <strong>29.2%</strong></li><li>Databricks is at ~$4B and growing 50% (allegedly)</li><li>(an extreme, somewhat unrelated example) Azure has $75B of ARR and is growing at <strong>39%</strong></li></ul><p>As you can see, the total addressable market for the products Confluent sells seems to be significantly smaller than what Snowflake/Databricks are selling.</p><p>These financials are the single best sign that streaming is topping out. You can’t fake them with a narrative.</p><p>The rest of the things I will present are more qualitative, but still interesting.</p><h3>Confluent == Kafka</h3><p>Confluent’s performance matters a whole lot with relation to Kafka because they are the creators of Kafka and the leaders in Kafka. Basically they ARE Kafka:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AYTp66X_tv72RG8b.png" /></figure><p>An analysis of 85%+ of open-source Apache Kafka contributions, from 2010–2025.</p><p>They don’t post a breakdown of product revenue, but recently shared Flink’s numbers. It has barely registered around $14M ARR. Out of $1B total, this is hardly going to be the savior of the company’s declining growth. Outside of Kafka and Flink, I don’t see other products that have the potential to make substantial money for the company.</p><p>The majority of their revenue, therefore, is <strong>allegedly coming from Kafka</strong>. When we look at it from that point of view, we start to see very reasonable explanations for the declining growth:</p><h3>2. Competition is Hotter than Ever 🔥</h3><p>Kafka is becoming a commodity. Everybody and their abuela has a Kafka service now.</p><ul><li>AWS MSK has been out for 6 years now. It’s rumored to make more than Confluent’s entire business ($1B-$1.5B of ARR)<a href="https://substack.com/home/post/p-177644517#footnote-1-177644517">1</a></li><li>Google Cloud Kafka (announced <a href="https://cloud.google.com/blog/topics/google-cloud-next/google-cloud-next-2024-wrap-up">Jul 2024</a>)</li><li>Oracle Kafka (announced <a href="https://docs.oracle.com/en-us/iaas/releasenotes/services/kafka/index.htm?utm_source=chatgpt.com">Aug 2025</a>)</li><li>Azure Event Hubs (has a <a href="https://azure.microsoft.com/en-us/blog/announcing-the-general-availability-of-azure-event-hubs-for-apache-kafka/?utm_source=chatgpt.com">Kafka API</a>)</li><li>Alibaba Cloud (Aliyun) Kafka</li><li>OVHCloud Kafka</li><li>Heroku Kafka</li><li>Canonical (the guys behind Ubuntu) Kafka (released <a href="https://canonical.com/blog/charmed-kafka-general-availability">Feb 2024</a>)</li></ul><p>And startups:</p><ul><li>Aiven</li><li>Redpanda</li><li>StreamNative (Pulsar, but Kafka API)</li><li>AutoMQ</li><li>Bufstream</li><li>Instaclustr Kafka</li></ul><p>It’s only the behemoths Snowflake and Databricks that still haven’t entered the space. But they most likely will. <a href="https://x.com/BdKozlovski/status/1884976011013664875?lang=en">Snowflake almost bought Redpanda in early 2025</a>.</p><p>These behemoths are in a good position, because they can wait to see how the market pans out and shop around for a deal. It’s a matter of time until they buy some of the above.</p><p>By the way, what I presented was the Kafka market. There are plenty of alternative competitors<a href="https://substack.com/home/post/p-177644517#footnote-2-177644517">2</a> too:</p><ul><li>Google Pub Sub</li><li>Azure Event Hubs</li><li><a href="https://blog.cloudflare.com/cloudflare-data-platform/">Cloudflare Pipelines</a></li><li><a href="https://dev.to/mtk3d/beyond-the-hype-why-we-chose-redis-streams-over-kafka-for-our-microservices-dmc">Redis Streams</a></li><li>s2.dev (small startup)</li><li>NATS</li></ul><h3>3. Kafka Prices Are Going Lower than Ever 📉</h3><p>Kafka prices are seeing <strong>major deflation</strong>.</p><p>Kafka is available at every neighbourhood corner store now — that ubiquity alone drove prices down some <strong>~6.5x</strong>.<a href="https://substack.com/home/post/p-177644517#footnote-3-177644517">3</a></p><p>Unfortunately for the industry, the real price war started in 2023 when a new architecture showed you can instantly deflate Kafka prices by <strong>10x+</strong>.</p><p>WarpStream pioneered the diskless Kafka architecture where instead of storing data on local broker disks and replicating between them, this job is outsourced to S3. It comes at a larger latency (slower), but can completely eliminate networking costs in Kafka.<a href="https://substack.com/home/post/p-177644517#footnote-4-177644517">4</a></p><p>This was an incredibly major development because a well-optimized Kafka deployment has <a href="https://2minutestreaming.com/tools/apache-kafka-calculator/">80% of its costs coming from cross-AZ networking</a>. In other words, $176k out of a $215k annual bill can go to networking.</p><p>Further, it’s precisely latency-<strong>in</strong>sensitive workloads that drive this high volume network bandwidth. In other words, the workloads that don’t care about latency are the ones that drive the highest networking costs. They are therefore <strong>ripe</strong> for a cost reduction through this architecture.</p><p>This architecture was gated behind proprietary products for 2023/2024, but in 2025 Aiven began <a href="https://github.com/aiven/inkless">releasing</a> it to <a href="https://aiven.io/blog/diskless-apache-kafka-kip-1150">open source Apache Kafka</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*STCq_oqVv_xE0wfN.png" /></figure><p>Not only that, but Aiven was also the first to unlock both fast topics and slow topics <strong>in the same distribution</strong>. Previously, you had to commit to one or the other, which slowed adoption as users inevitably have mixed workloads.</p><p>Once Diskless gets accepted and merged into the open-source project (ETA ~2027<a href="https://substack.com/home/post/p-177644517#footnote-5-177644517">5</a> would be my guess), savvy operators will be able to reduce their Kafka networking costs by literally <strong>97%</strong> (!)<strong>.</strong></p><blockquote><em>👉 see the calculations in </em><a href="https://topicpartition.io/blog/kip-1150-diskless-topics-in-apache-kafka"><em>Diskless Kafka is a big deal</em></a></blockquote><h3>4. Stream Processing Is NOT Making Money 🦗</h3><p>OK, so Kafka is most certainly not going to be a revenue growth driver going forward. Can companies make up the difference from stream processing?</p><p>No. Definitively.</p><p>Confluent, for their whole lifetime, failed to significantly monetize stream processing.</p><ul><li><strong>~2016</strong>: they released Kafka Streams. They tried to commercialize it by marketing event-driven architectures (EDA)</li><li><strong>~2020</strong>: they tried simplify stream processing by adding a SQL interface on top with ksqlDB</li><li><strong>~2023</strong>: they abandoned ksql, bought a Flink startup and went all in on Flink</li><li><strong>~2024</strong>: they <a href="https://www.confluent.io/blog/ai-meal-planner/">market the hell out of Flink</a> for AI Agents (similar story to microservices)</li><li><strong>Q3 2025</strong>: out of a ~$1.1B annual recurring revenue, Flink makes just ~$14M ARR<a href="https://substack.com/home/post/p-177644517#footnote-6-177644517">6</a> (<strong>1.25%</strong>)</li></ul><p>While this is disastrous for Confluent, it’s even more brutal for the other stream processing startups in the space.</p><p>If the world’s best stream processing experts inside a company with massive distribution<a href="https://substack.com/home/post/p-177644517#footnote-7-177644517">7</a> and capital can’t figure out how to monetize stream processing properly — I don’t know who can.</p><p>Take <strong><em>Responsive.dev</em></strong>, a company founded by and consisting of top-tier ex-Confluent talent<a href="https://substack.com/home/post/p-177644517#footnote-8-177644517">8</a>. It was a boutique Kafka Streams startup, focused on making streaming apps more reliable and scalable. It recently completely pivoted away from streaming and into observability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iZs6bCrURc3oeXgJ.png" /></figure><p>Response.dev’s homepage</p><h3>5. All The Real-Time Companies Are Small 🐁</h3><p>Outside of Confluent, who’s left in the general real-time space?</p><ul><li>🎯 Timeplus</li><li>🎯 RisingWave</li><li>🎯 Materialize</li><li>🎯 Deltastream</li><li>🎯 Ververica</li><li>🎯 Factor House</li><li>🎯 Conduktor</li><li>🎯 AutoMQ</li><li>🎯 StreamNative</li><li>🏃‍♂️ Redpanda (pivoted to AI Agents <a href="https://x.com/BdKozlovski/status/1983535392868425935">Oct 2025</a>)</li><li>💰 Arroyo (<a href="https://www.arroyo.dev/blog/arroyo-is-joining-cloudflare">acquired Apr 2025</a>)</li><li>💰 Decodable (<a href="https://www.globenewswire.com/news-release/2025/09/04/3144606/0/en/Redis-to-Acquire-Real-Time-Data-Platform-Decodable-Expands-Redis-for-AI-to-Deliver-Context-and-Memory-for-AI-Agents-and-Agentic-Systems.html">acquired Sep 2025</a>)</li></ul><p>Most of these companies are <strong><em>miniscule</em></strong>.</p><p>Redpanda is the biggest and most established of the bunch. They are well-known, have won the hearts of many developers and are selling into a proven billion-dollar market (Kafka).</p><p>After 6 years of operations, Redpanda is rumored to have barely crossed $20M revenue in 2025.<a href="https://substack.com/home/post/p-177644517#footnote-9-177644517">9</a></p><p>If Redpanda can’t meaningfully catch up to Confluent’s Kafka revenue, and Confluent’s stream processing revenue is any indicator of the size of the real-time processing market — what hope is there for the others?</p><p>The way I see it, these companies have four choices:</p><ol><li>pivot into a larger market and keep growing</li><li>get acquired</li><li>go bankrupt</li></ol><p>Pick one.</p><p>The one standout that struck it big was WarpStream.</p><p>They started their company in 2023 and got acquired in 2024 <a href="https://x.com/BdKozlovski/status/1852725315203653841">for $220M</a>. Confluent’s panic paired with Warpstream’s skill, luck and positioning resulted in an exit the whole streaming world envies.</p><p>It is very unlikely this gets replicated again.<a href="https://substack.com/home/post/p-177644517#footnote-10-177644517">10</a></p><h3>6. The Industry Is Waking Up 🥱</h3><p>Slowly but surely, people are waking up to the fact that streaming has topped out. They’re either losing interest or pushing for simpler alternatives. You can hear it if you listen closely:</p><h3>Listen to the Conferences 👂</h3><p>Current, the conference formerly known as Kafka Summit, seems to be losing steam. Here are a few pointers:</p><ol><li><a href="https://www.youtube.com/watch?v=3nUThZlZ0jQ">Redpanda was banned from it</a>.</li><li>The London conference (May, 2025) showed signs of shrinking.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4X7uOzS_ghTaN6ur.png" /></figure><p><a href="https://x.com/BdKozlovski/status/1924805512777875839">I spoke to people who thought it was shrinking in size</a></p><ol><li>Confluent <a href="https://x.com/AdiPolak/status/1974173562916442116">was</a> <a href="https://www.linkedin.com/posts/tlberglund_current-nola-2025-is-open-for-business-oct-activity-7386488618762215424-Bsuk">seen</a> <a href="https://www.linkedin.com/feed/update/urn:li:ugcPost:7381539343594848256?commentUrn=urn%3Ali%3Acomment%3A%28ugcPost%3A7381539343594848256%2C7381569764030099456%29&amp;dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287381569764030099456%2Curn%3Ali%3AugcPost%3A7381539343594848256%29">giving</a> out <strong>free</strong> tickets on social media <strong><em>26 days before</em></strong> the flagship New Orleans conference (Oct 2025). A ticket that people paid $500–1000 for started being given out for free a full month before the conference. What does that tell you?</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ha7hqJ6_xtnZdnXR.png" /></figure><ol><li>New Orleans<a href="https://substack.com/home/post/p-177644517#footnote-11-177644517">11</a> conference attendee <a href="https://www.reddit.com/r/apachekafka/comments/1owawyu/watching_confluent_prepare_for_sale_in_real_time/">shared a post on Reddit</a> about the vapourware-like keynotes, Flink propaganda and budget-like feeling of this latest conference</li></ol><h3>Listen to the Pundits 👂</h3><p>Here are the thoughts of two people<a href="https://substack.com/home/post/p-177644517#footnote-12-177644517">12</a> with multi-decade experience in stream processing and data engineering — <a href="https://www.linkedin.com/in/riccomini/details/experience/">Chris Ricommini</a> and <a href="https://www.linkedin.com/in/ryannedolan/">Ryanne Dolan</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qj0fHrLCtZIW53BV.png" /></figure><p><a href="https://open.substack.com/users/5669707-yaroslav-tkachenko?utm_source=mentions">Yaroslav Tkachenko</a></p><p>shared <a href="https://www.streamingdata.tech/p/current-london-2025">his thoughts</a> from the May 2025, Current London conference:</p><blockquote>Finally, I feel like the data streaming industry is still in a tough spot. The growth is slow, and the sales cycles are long.</blockquote><blockquote>One person I spoke with said that <strong>“80% of the companies in the Expo hall will be dead in two years”.</strong></blockquote><blockquote>I don’t want to believe them, but it might be true.</blockquote><p><em>(note it wasn’t me he spoke to, lol)</em></p><p>In a post titled <a href="https://materializedview.io/p/kafka-end-of-beginning">“Kafka: The End of the Beginning”</a>, Chris Ricommini also echoed his general thoughts on the market following that quote from Yaroslav:</p><blockquote>I was speaking with someone just yesterday that said something similar: it’s the same people, same companies, and same technology. <strong>There are no new ideas and no new users</strong>.</blockquote><blockquote>This person said <strong>they would not attend future Current conferences</strong>; it wasn’t worth it; they didn’t learn anything new.</blockquote><blockquote>Yaroslav’s post also says that Redpanda was banned from the conference. I don’t know the details, nor do I really care. But if true, it’s hard not to read this as <strong>an indication of scarcity and fear</strong>, not one of abundance.</blockquote><blockquote><em>[…]</em></blockquote><blockquote><strong>I’ve been thinking about this stagnation for a while</strong>. I don’t believe we’ve solved everything. It’s still very difficult to write and deploy stream processing jobs, for example; <strong>it honestly feels like </strong><a href="https://materializedview.io/p/from-samza-to-flink-a-decade-of-stream"><strong>it’s gotten worse, not better</strong></a>. I’d like to believe that these challenges are not fundamental — that there are better ways.</blockquote><blockquote><em>[..]</em></blockquote><blockquote>Meanwhile, the stream processing side of the house seems somehow both worse and better. I am no fan of Flink, but it has won the stream processing race. <strong>Unspoken amongst vendors, the true winner is really just regular old Kafka consumers and producers.</strong></blockquote><h3>Listen to the People👂</h3><p>For lack of a better word, there is a “<a href="https://lobste.rs/s/wshruu/small_data#c_elf7in">Simplification</a>” movement forming post the ZIRP hangover of the industry. Few examples:</p><ul><li><a href="https://aiven.io/blog/apache-kafkas-80-percent-problem">Kafka’s 80% Problem</a> — Aiven recently admitted most Kafka workloads are small (&lt; 10MB/s or even &lt; 1MB/s) and that Kafka has overhead costs that are too high for such modest workloads</li><li><a href="https://www.tinybird.co/blog/flink-is-95-problem">Flinks’s 95% Problem</a> — Tinybird points out Flink is over-engineered complexity for the majority of use cases it claims to solve</li></ul><p>Look no further than the reception I get from my own posts.</p><ul><li>My recent post where I claimed <a href="https://news.ycombinator.com/item?id=45747018">Postgres can be used to cover a majority of Kafka and queue use cases</a> went viral and generated &gt;60k blog views.</li><li><a href="https://x.com/BdKozlovski/status/1981722864844992790">My tweet citing</a> both 80%/95% articles went viral too</li></ul><p>This is all heavily pointing to the fact that there seems to be large agreement forming around the fact that the industry is overcomplicated with relation to what the majority of users need.</p><h3>Why Are We At The Event Horizon?</h3><p>It’s human nature to want to point the finger at somebody. I wouldn’t attribute this malperformance to bad management of any single company.</p><p>I don’t think the state we’re in today is due to a lack of talent or bad strategy.</p><p>I think there simply isn’t a market big enough for everybody. Regardless of how bright and resourceful you are, it’s an uphill battle to sell something people do not want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LnJ3uR19UxUsXvBe.png" /></figure><h3>What’s Next?</h3><p>Widespread consolidation. It’s time to <a href="https://www.investopedia.com/terms/b/bundling.asp">bundle</a> up.</p><p>As that person in the conference allegedly said — <strong><em>“80% of the companies in the Expo hall will be dead in two years”.</em></strong></p><p>I think more acquisitions will happen in an effort to bundle these products with other general data infra. For example, Confluent <a href="https://www.reuters.com/business/data-streaming-software-maker-confluent-explores-sale-sources-say-2025-10-08/">was reportedly in talks of being acquired recently</a>. I believe this will happen with high likelihood.</p><p>The Decodable and Arroyo acquisitions I don’t believe were done from a position of strength either. I assume they were necessary — they realized independent growth wasn’t a winning strategy and somebody saw they can bundle them with their offering nicely.</p><p>For the companies that haven’t gone for sale (yet), a pivot is likely in the works.</p><p>A great recent example is Redpanda <a href="https://x.com/BdKozlovski/status/1983535392868425935">pivoting to AI Agents</a>.</p><h3>What About Kafka? 🥺</h3><p>Apache Kafka isn’t going anywhere, but the companies that manage it are.</p><p>I don’t see any real competition that can replace Kafka. I just see a lot of overextended VC-funded companies that can’t justify their growth to investors anymore.</p><p>Open source Kafka will continue to exist, and with some luck, maybe continue to thrive. There is a real risk that a wide gap in the market may be left when Confluent gets acquired and the fallout from that. I don’t see many players in a position to fill such a theoretical gap.</p><p><em>Maybe it’s time for a leaner, more sustainable startup around Kafka? DM me if interested.</em></p><h3>Why Am I Telling You This? 🥸</h3><p>As “The Kafka Guy”, I am the last person who should be sharing such negative views about the industry.</p><p>But being the Kafka guy doesn’t mean I have to shill things I don’t believe in. I’m just using my platform to share what I believe is the truth.<a href="https://substack.com/home/post/p-177644517#footnote-13-177644517">13</a></p><p>Before some vendors try to discredit me — I’m not trying to be doomerist for clicks. I really, truly believe this.</p><p>I think what’s said here is pretty obvious for anybody who isn’t deep down in the echo chamber drinking the kool-aid and suffering from sunken-cost bias. If you don’t agree — set a reminder and revisit this piece in two years.</p><p>I also hold no ego in these predictions. In fact, I’ll be happier if I’m wrong. I make money off the same industry that’s in decline.</p><p>In the end, I’m all for the industry and don’t want to see it go away.</p><p>The less we bullshit each other and the sooner we face reality, the faster we can get over this bump.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2a0868075dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>