<?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 Subbu Baravani on Medium]]></title>
        <description><![CDATA[Stories by Subbu Baravani on Medium]]></description>
        <link>https://medium.com/@snbaravani?source=rss-f202873fd28e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Subbu Baravani on Medium</title>
            <link>https://medium.com/@snbaravani?source=rss-f202873fd28e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:17:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@snbaravani/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[Virtual Threads : Measuring the Spring Boot Performance Leap]]></title>
            <link>https://medium.com/@snbaravani/virtual-threads-measuring-the-spring-boot-performance-leap-d5c6e304b177?source=rss-f202873fd28e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5c6e304b177</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[java-virtual-threads]]></category>
            <category><![CDATA[java-performance-tuning]]></category>
            <category><![CDATA[virtual-threads]]></category>
            <category><![CDATA[java-performance]]></category>
            <dc:creator><![CDATA[Subbu Baravani]]></dc:creator>
            <pubDate>Sun, 20 Sep 2026 14:50:42 GMT</pubDate>
            <atom:updated>2026-09-25T00:42:41.202Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XSuexmbvewdy0sG2" /></figure><p><strong>The Problem statement…</strong></p><p>Java developers know the pain: expensive database queries blocking threads, limiting concurrency, consuming precious resources. Virtual threads promise to solve this by allowing us to handle thousands of concurrent I/O operations with minimal overhead.</p><p><em>I wanted to measure virtual threads’ impact on a simple scenario: an API querying a database under thousands of concurrent requests.</em></p><p>I ran a controlled load test on a Spring Boot application with heavy database query — few hundred milliseconds — pushing it with hundreds to thousands of concurrent requests. Here’s what enabling virtual threads actually delivered.</p><p>If you want to know what virtual threads are, their advantages please check this nice and clean article :<a href="https://medium.com/@aravindcsebe/virtual-threads-in-java-21-a-deep-dive-into-lightweight-concurrency-c1743e7dbe04"> Virtual Thread Deep Dive</a></p><h4>The Setup…</h4><p>It wasn’t complicated…</p><p>A simple application built using Spring Boot, Java 23 , Hibernate and MYSQL database with a few tables. This application has a few CRUD APIs and corresponding hibernate repositories.</p><p>These lines decide the trade-off , no other code changes….</p><pre>spring.threads.virtual.enabled=true <br>spring.datasource.hikari.maximum-pool-size=200<br>server.tomcat.threads.max=20</pre><p>To ensure our measurements reflected virtual thread performance — not database limitations — I increased the connection pool to 200. I also constrained the server’s thread to 20 configuration intentionally; this keeps our test focused and the results more interpretable.</p><p>Git Repo is here: <a href="https://github.com/snbaravani/springboot-virtualthread-performance-analyser">Code</a></p><h4>Performance Gains Visualized</h4><p>I ran a simple GET API that fetches a few records from a database table. I added a delay of 200 ms in the code. Here is what happened when i tried with the default platform threads and the virtual threads.</p><p><strong><em>#Platform Threads</em></strong> with <strong>2000</strong> virtual users for <strong>120</strong> seconds:</p><p><strong>TPS</strong>: 102.25 | <strong>Avg Resp time:</strong> 17.4 secs | <strong>P90</strong>: 22.3 secs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tlnCtRChye3SKNKvLdxSyg.png" /></figure><h4><strong>After enabling Virtual Threads:</strong></h4><p><strong>TPS</strong>: 639 | <strong>Avg Resp time:</strong> 3 secs | <strong>P90</strong>: 3.3 secs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vI9whTgA0ec6OTdH8my16g.png" /></figure><p>Enabling the virtual threads increased the performance of the API significantly.</p><h4><strong>So, does it solve all the thread bottlenecks?</strong></h4><p>No, however, virtual threads make a significant difference in the following use scenarios.</p><ul><li><strong>HTTP Requests:</strong> Waiting for external Web APIs or microservices using clients like HttpClient.</li><li><strong>Database Queries:</strong> Waiting for SQL databases like PostgreSQL to run queries.</li><li><strong>Message Brokers:</strong> Blocking while sending or receiving messages with Kafka or RabbitMQ.</li><li><strong>Web Server Requests:</strong> Handling incoming HTTP requests in servers like Tomcat or Jetty.</li></ul><h4>When to Avoid Virtual Threads ?</h4><ul><li><strong>CPU-Bound Tasks:</strong> Heavy computations keep the processor busy instead of waiting for data, making extra virtual threads a waste of scheduling effort.</li><li><strong>Synchronized Blocks:</strong> Blocking inside a synchronized block &quot;pins&quot; the virtual thread to its underlying carrier thread, which can freeze the entire application.</li><li><strong>Heavy ThreadLocal Usage:</strong> Creating millions of virtual threads while using ThreadLocal variables can quickly bloat and exhaust your Java heap memory.</li></ul><p>Also, remember virtual threads are available from Java 21 only :-)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5c6e304b177" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Agentic AI Workflows for Credit Card Support Tasks]]></title>
            <link>https://medium.com/@snbaravani/agentic-ai-workflows-for-credit-card-support-tasks-796351cfbf0f?source=rss-f202873fd28e------2</link>
            <guid isPermaLink="false">https://medium.com/p/796351cfbf0f</guid>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[spring-ai]]></category>
            <category><![CDATA[harness-engineering]]></category>
            <category><![CDATA[qdrant]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Subbu Baravani]]></dc:creator>
            <pubDate>Wed, 16 Sep 2026 02:38:46 GMT</pubDate>
            <atom:updated>2026-09-16T08:24:13.245Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Building Agentic AI Workflows for Credit Card Support Tasks</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*T9rtosBz2W-MxaJk" /></figure><p><strong>Problem Statement:</strong> During my time working behind the scenes in the credit card domain<strong>,</strong> I noticed a recurring theme: both customers and support teams spend a lot of time doing things the hard way.</p><p>Some of the problems I encountered :</p><ul><li><strong>The Credit Card Hunt:</strong> When customers try to find the best card for their specific goals that is offered by the company— like the lowest interest rate, maximizing Qantas or Velocity points, or getting the most interest-free days — they usually have to manually open card issuer’s website and dig through the fine print or call up the customer care.</li><li><strong>The Closure Bottleneck:</strong> On the operational side, I have seen us use expensive RPA (Robotic Process Automation) software just to read customer care emails and process card closures. It works, but it is a heavy, costly tool for a straightforward task.</li></ul><p>These aren’t incredibly complex problems to solve using Agentic AI, but I had to start somewhere !</p><p><strong>Use Cases Addressed</strong></p><ul><li><strong>Smart Card Advisor:</strong> Compares cards and suggests the best option based on interest rates, fees, or rewards (Qantas/Velocity).</li><li><strong>Email-Driven Automation:</strong> Safely executes back-office card closure when triggered by internal support emails.</li><li><strong>Account Assistant:</strong> Powering a chat agent that handles customer queries regarding balances and account summaries.</li></ul><p><em>Please feel free to checkout the </em><strong><em>demo video</em></strong><em> uploaded below first to understand how the whole solution works</em>.</p><h3>How It’s Built</h3><p>Leveraging my Java expertise, I selected Spring AI to develop this agentic framework. The primary advantage of this framework is its clean abstraction of underlying implementations, which streamlines integration. The complete tech stack for this solution includes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JyTE8UPRQjbdSKIDuPyobg.jpeg" /></figure><p>The system consists of two components: an <strong>Orchestrator</strong> containing two agents, and an <strong>MCP server</strong> that the agents leverage to achieve its goals.</p><p>Just to mention, a production-grade solution would follow this pattern: (1) multiple agents handling specific tasks, (2) an orchestrator coordinating their workflows, and (3) MCP tools providing internal/external system access</p><p>Agentic Concepts used: Prompt stuffing using templates, Agent skills, Advisors, few shot examples, RAG, MCP and Orchestration.</p><p>I really loved the <a href="https://github.com/tt-a1i/archify">Archify</a> skill to generate the an<strong> </strong>interactive architecture flow diagram. Please check that out <a href="https://github.com/snbaravani/card-agent/blob/main/src/main/resources/docs/cards-agent-architecture.html">here</a> and it’s image version is below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4tQIgQLwF97suNi4zVGng.png" /></figure><h4><strong>The Orchestrator (card-agent)</strong></h4><p>This application has two separate agents: helping customers pick a credit card product or answer customer queries related to outstanding amount or transactions and processing card-closure requests that come in by email. Git Repo: <a href="https://github.com/snbaravani/card-agent/tree/main">The Orchestrator</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eGO-o6iRHvURIB3lA7DS9Q.jpeg" /></figure><p>It decides to use either the vector embedding or the MCP server based on the user queries. Both agents use this MCP server which has access to the customer data and has the ‘MCP tools’ to access them.</p><p>Please read the system prompts <a href="https://github.com/snbaravani/card-agent/tree/main/src/main/resources/prompts">here</a> to understand how this orchestrator really works.</p><p><strong>Agent #2 polls</strong> the Customer Support inbox frequently, looking exclusively for card closure requests email sent by the internal support team. The workflow will only execute if the email explicitly requests a card closure and includes the specific customer’s email address.</p><h4>The MCP Server (card-db-ccp)</h4><p>I built a Spring Boot and Hibernate microservice that runs as an MCP server. It gives our AI support agent the exact tools it needs to <br>look up customers, card programs, balance summaries, and even process closures. Making it MCP-compatible was surprisingly easy. Honestly, <br>thanks to the agent skills available <a href="https://github.com/sivaprasadreddy/sivalabs-agent-skills">here</a> and with tight requirements, I managed to knock out 70% of the app in about 10 minutes using Claude Code. Check out the prompt/requirements I fed to Claude here: <a href="https://github.com/snbaravani/cards-db-ccp/blob/main/src/main/resources/requirement-ccp.txt">Requirement given to Claude to generate most of the code.</a></p><p>Git Repo for this MCP server is here : <a href="https://github.com/snbaravani/cards-db-ccp/tree/main">Cards MCP Server</a></p><h4>Steps to Run this solution</h4><ul><li>Install Java 25, docker, Qdrant db, Mailpit and d MySQL DB</li><li>Clone the Orchestrator and the MCP server from here: <a href="https://github.com/snbaravani/cards-db-ccp">https://github.com/snbaravani/cards-db-ccp</a> <a href="https://github.com/snbaravani/card-agent">https://github.com/snbaravani/card-agent</a></li><li>Start Docker, Qdrant and MySql DB</li><li>Start the MCP server</li><li>Start the Orchestrator service</li><li>Make sure schema and tables are auto created in MySQL and Mailpit is running at <a href="http://localhost:8025/">http://localhost:8025/</a></li><li>Run the Postman with requests below, you can import these curls:<br>curl --location &#39;http://127.0.0/api/cards?message=best card for velocity points&#39;<br>curl --location &#39;http://127.0.0/api/cards?message=the best card for low interest rates&#39;<br>curl --location &#39;http://127.0.0api/cards?message=all the cards that the company offers and give me a summary of each&#39;<br>curl --location &#39;http://127.0.0/api/cards?message=my account summary please&amp;email=jane.smith@example.com&#39; --header &#39;email: jane.smith@example.com&#39;<br>curl --location --request POST &#39;http://127.0.0.1:8080/email?from=card-closure-support%40mybank.com&amp;subject=Card Closure&amp;body=Please close the card of the customer jane.smith@example.com&#39;</li></ul><h4>The Demo</h4><p>Here is a quick demo of how the end-to-end agentic workflow works. This includes different use cases, negative flows etc.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FPXHd32vkEL0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPXHd32vkEL0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FPXHd32vkEL0%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6cd51f9ab2a35164637a6e6e9d233840/href">https://medium.com/media/6cd51f9ab2a35164637a6e6e9d233840/href</a></iframe><h4>Final Thoughts</h4><ul><li>Leveraging Agentic AI allows organisations to solve complex use cases far more efficiently than traditional workflows. However, applying <strong>agentic solutions universally</strong> can become an anti-pattern. For problems where inputs and outputs are known in advance and no dynamic adaptation is required, a traditional approach remains the better choice</li><li><strong>Spring AI simplifies Agentic workflows</strong> by reducing implementation effort, and seamlessly supports multi-agent systems using the standard Agent-to-Agent (A2A) protocol.</li><li><strong>Switching from the default </strong>gpt-5.5-mini<strong> </strong>model to gpt-4o drastically improved performance, cutting response times and making replies roughly <strong>60% faster</strong>. However, we need to try different models to zero in on the right one for the use case.</li><li><strong>ChatGPT model was chosen over Anthropic</strong> because hooking up Qdrant as a vector database for an Anthropic-powered RAG pipeline requires some workarounds rather than direct out-of-the-box support.</li><li><strong>Evals (LLM unit testing) and solution monitoring</strong> are not yet implemented; these will be added to the project repository in an upcoming update.</li><li><strong>Local, cost-free execution is fully supported</strong> by running an open-source model directly on your laptop as an alternative to paying for premium LLM cloud APIs.</li><li><strong>The solution is straightforward to run</strong>, requiring only a standard local stack of Java 25, a Qdrant database, Docker, and a MySQL database.</li><li>I have used publicly available products from Westpac for <a href="https://www.westpac.com.au/credit-cards">credit card products</a> that was fed to Qdrant for RAG.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=796351cfbf0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Curious Developer to Claude Certified Architect]]></title>
            <link>https://medium.com/@snbaravani/from-curious-developer-to-claude-certified-arhitect-9d5a725f7ff3?source=rss-f202873fd28e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d5a725f7ff3</guid>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[claude-certified]]></category>
            <category><![CDATA[ccaf]]></category>
            <category><![CDATA[claude-certification]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Subbu Baravani]]></dc:creator>
            <pubDate>Thu, 10 Sep 2026 02:03:31 GMT</pubDate>
            <atom:updated>2026-09-18T01:27:20.139Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>From Curious Developer to Claude Certified Architect</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IbFSFI5oXwSEahtDurWd8Q.jpeg" /></figure><h4><strong>The ‘Why’ ?</strong></h4><p>After a year of using Claude Code and MS Copilot for code generation, legacy code analysis and documentation, I found myself at an inflection point. I was struggling with the fundamental questions: <em>When should I choose agentic AI over traditional solutions? How do MCP, agents, prompts, RAG, and context windows actually fit together?</em> The patterns and anti-patterns of agentic system design remained fuzzy in my mind. I needed more than scattered blog posts and project experience — I needed a structured foundation. That’s when I discovered the Claude Certified Architect Foundations (CCA-F) exam, which promised to demystify exactly these gaps in my understanding.</p><h4>Is this for you?</h4><p>If you’re brand new to Claude, consider gaining some hands-on experience before diving in — this certification rewards practical knowledge. You don’t need expert-level programming skills, but some coding background (including QA automation or scripting) helps you fully grasp agentic patterns. This surely for Devs, Solution Architects, QAs and Tech Consultants. More details, please visit <a href="https://anthropic-partners.skilljar.com/claude-certified-architect-foundations-certification/486716">CCA-F</a></p><p>If you are not a programmer or not from tech background I recommed you to check out this one <a href="https://anthropic-partners.skilljar.com/page/partner-certifications">Cluade Certified Associate — Foundations</a></p><h4><strong>What if your Org in not a Claude partner?</strong></h4><p><em>One roadblock</em>: Claude certification is currently restricted to Claude Partner Network members. Since my company didn’t qualify, I used <strong>YAID</strong> company (Your AI Department) as a bridge — after registering with them, their email enabled me to sign up for the exam. If you’re in a similar situation, YAID’s platform provides a straightforward workaround. I’d recommend checking out their website <a href="https://youraidept.com/network">https://youraidept.com/network</a> the YAID team was remarkably responsive and helpful whenever I had questions throughout the process. Happy to provide referral, if you need one. Btw, their registration fee covers exam costs as well.</p><h4><strong>The Prep</strong></h4><p>I adopted a two-pronged approach: take a structured course aligned with the exam topics, then build a real-world capstone project using Java and Spring AI to apply those concepts hands-on. The project deliberately covered prompt engineering, RAG patterns, MCP integration, agent skills and agent orchestration — turning abstract exam topics into concrete implementations. Theory and practice reinforced each other throughout.</p><p>This is the project I developed using Spring AI, please read it here: <a href="https://medium.com/@snbaravani/agentic-ai-workflows-for-credit-card-support-tasks-796351cfbf0f">Building Agentic Applications using Spring AI</a></p><h4>Prep Material and Resources</h4><p>Rather than study everything available, I did my homework first. After reviewing multiple blogs and YouTube videos, I chose to focus on these.</p><ul><li><a href="https://www.udemy.com/share/10fcRi3@MDE6a7xAmdCq-AN0PA3V95fa1QfenwE8-CSiDywcxXpOQ5uCM6Bf7RfJXc4blT9S/"><strong>CCA-F 2026 Examp prep </strong></a>on Udemy was very useful. Expect a lot of content — it’s thorough but dense. Playing videos at 1.25x speed is a helpful way to move through the material more efficiently. It also comes with Flashcards and notes.</li><li><a href="https://claudecertificationguide.com/learn"><strong>Claude Certification Guide</strong></a>: The best part? It zeroes in on exactly what the exam tests. No fluff, just the core concepts you actually need — super practical.</li><li><a href="https://www.youtube.com/watch?v=b42eoAd0v40"><strong>Quick Overview Video</strong></a>: I found it especially valuable in the final days before the exam — a quick review of all six domains a day or two before test day kept everything fresh in my mind.</li><li><strong>Hands-on excercises</strong> : Hands-on practice is non-negotiable. Don’t just watch videos — actually use Claude/Claude SDK. Build slash commands, create skill files, and write real agentic workflows in your preferred language (Python, Java, or whatever you’re comfortable with).</li><li><strong>Mock Tests:</strong> Multiple mock sources matter. Beyond the Udemy course’s two practice tests, I found Frank Kane’s <a href="https://www.udemy.com/course/anthropic-claude-certified-architect-3-full-practice-exams/?couponCode=PMNVD2025">exam collection</a> and Claude Certification Guide’s <a href="https://claudecertificationguide.com/mock-exam/start">mock exams</a> (both <strong>mini</strong> and full-length versions) extremely helpful for comprehensive preparation.</li></ul><p>My four-week study plan looked like this: weeks 1–3 balanced coursework (Udemy + <a href="https://anthropic.skilljar.com/">SkillJar</a>) with building an agentic workflow project, then week 4 was dedicated entirely to mock exams and domain recap.</p><h4>Tips time: Things I Did Right (And a Few I Didn’t)</h4><ul><li>Hand-on excercises, there is no substitue.</li><li>Mock tests: Do at least 2 full length mock tests ( 2 hours, 60 questions ). It is draining ! Mini mocks were very helpful. You need to score at least 43 out of 60 questions correct to pass — that’s roughly a 72% passing threshold.</li><li>I found the real exam tougher than the mocks. So you are not prepared enough if you are getting less than 80% in mocks :-)</li><li>CI/CD related and code review related questions were confusing. I got half of them wrong. I should have spent more time here !</li><li>Do read the <a href="https://anthropic-partners.skilljar.com/claude-certified-architect-foundations-certification/486716">exam guide</a> multiple times, funny but true :-)</li><li>Interestingly, the Foundation exam is reportedly more challenging than the Professional-level certification — something to keep in mind when planning your study strategy</li></ul><p>Good luck agent creators and happy Clauding !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d5a725f7ff3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Card Management Systems: An Architectural Bird’s-Eye View]]></title>
            <link>https://medium.com/@snbaravani/card-management-systems-an-architectural-birds-eye-view-ad0453c17097?source=rss-f202873fd28e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad0453c17097</guid>
            <category><![CDATA[credit-cards]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[mastercard]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <dc:creator><![CDATA[Subbu Baravani]]></dc:creator>
            <pubDate>Sat, 22 Aug 2026 13:17:17 GMT</pubDate>
            <atom:updated>2026-09-10T05:11:35.379Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<p><strong>Card Management Systems: An Architectural Bird’s-Eye View</strong></p><p>If you’re new to credit cards and want to understand the fundamentals first, start with my previous article here <a href="https://medium.com/@snbaravani/the-credit-card-landscape-an-issuers-perspective-b899e3695fac">The Credit Card Landscape</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pjy9Q1-4io5YBARC4_NLWQ.png" /></figure><p>This article explores CMS architecture and how it manages the credit card lifecycle. Some of my references here come from the Mastercard CMS I worked with, though Visa implementations follow similar patterns. The architectural decisions discussed reflect broadly applicable principles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XuDiKVzo4rAI7cSUsV1Qew.png" /></figure><p>Front-facing applications communicate with the CMS through APIs, including self-service portals for customers and merchants. For security, actual card details are not transmitted — tokens are used instead.</p><p>Core CMS systems are typically SaaS products, often built from scratch — examples include Select-PS and Episode 6. However, most products provide only core card and account management features; integration layers and front-facing applications, CRMs, Credit/Fraud check system must be built separately. Most CMS systems lack origination, credit, and fraud-check platforms, which are handled by specialized products. All these systems work together with the core CMS to support the complete card lifecycle.</p><h4>CMS core functionalities</h4><p>A card program defines interest rates, interest-free periods, application fees, monthly fees, and other attributes. Each physical card has a program configured in the CMS, which provides a configuration interface. A CMS can support multiple card programs — essential for building white-label products for multiple retailers. A typical CMS architecture consists of a front-end layer, API layer, and database, with some systems including an analytics layer on top.</p><p>Core CMS features include card transactions, BIN management, interest rate calculations, account management, end-of-day reporting jobs, renewals, replacements, and status controls like card blocks and activation. Most CMS systems don’t include CRM functionality; customer records are typically maintained externally (e.g., Salesforce). Some legacy systems maintain customer data in their own database, often in a separate schema.</p><p>CMS systems directly integrate with Mastercard/Visa for transaction authorizations, 3DS, and MDES features (I’ll explain these terms later).</p><p><strong>Integration Layer around CMS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p-zQ7B-hJSij0ThIGt7ZEA.png" /></figure><p>These microservices serve as the integration layer connecting front-facing applications, the CMS, and specialized systems (fraud check, credit check, card origination, collections etc).</p><p>AWS WAF serves as the first layer of defense, providing DDoS protection, bot control, and rate limiting before the external ALB.</p><p>Observability tools like New Relic and Elastic are popular choices. I prefer New Relic for its feature-rich quality and ease of use, though it’s more expensive. I’ve also used <a href="https://www.causely.ai/">Causely</a>, which offers impressive built-in APM metrics, alerting, and AI-enabled capabilities.</p><h4>Data Flow</h4><p><strong>External Systems (Mobile, Portals, Origination)</strong></p><ul><li>The External ALB acts as the public entry point and terminates TLS.</li><li>Traffic is passed to the Internal NLB, which operates at Layer 4 and forwards it unmodified.</li><li>The Internal ALB terminates TLS again and applies its routing rules.</li><li>Requests are directed to Target Groups, which forward traffic to Kubernetes pods.</li></ul><p><strong>Internal ( Internal services of Card Core)</strong></p><ul><li>Reserved for internal (VPC/VPN-only) communication — for example, service X reaches to supporting service Y is reached through the Internal ALB.</li><li>TLS terminates at the Internal ALB, with onward communication to the pods over port 8080.</li><li>Routing decisions are handled by ALB rules.</li></ul><p><strong>Service-to-Service</strong></p><ul><li>Relies on native Kubernetes networking.</li><li>No load balancers in the path.</li><li>Kubernetes Services handle service discovery and load balancing.</li><li>Communication runs over port 8080, retaining the same security posture as the current production environment.</li></ul><p><strong>Certificates &amp; TLS</strong></p><ul><li><strong>External ALB</strong> — A small number of TLS certificates with pinned public keys are externally issued and self-managed. The remainder are handled by AWS Certificate Manager (ACM) with auto-renewal enabled.</li><li><strong>Internal ALB</strong> — TLS certificates are handled by AWS Certificate Manager (ACM) with auto-renewal enabled.</li><li>TLS terminates at the External ALB and is re-established for the connection to the Internal ALB.</li></ul><h4>FAQs</h4><p>When I started in the card industry, navigating the technical jargon was quite challenging!</p><p><strong>What is MDES ?</strong></p><p><a href="https://developer.mastercard.com/product/mdes">MDES</a> (Mastercard Digital Enablement Service) is a Mastercard service that enables customers to add their payment cards to digital wallets and mobile payment applications securely. Instead of sharing actual card details with merchants or third-party services, MDES generates and manages digital tokens that represent the card. These tokens are used for transactions, eliminating the need to expose sensitive card information.</p><p><strong>What is Card Stand-in ?</strong></p><p>A card stand-in is a temporary substitute card identifier or proxy used in payment systems when the actual card cannot be immediately accessed or verified. It allows transactions to proceed without real-time communication with the card issuer’s core system (CMS), enabling offline or asynchronous processing. Key disadvantages include increased fraud risk due to lack of full verification, potential mismatches if the card is blocked while the stand-in remains active, and added operational complexity in tracking and reconciliation</p><p><strong>What is 3DS ?</strong></p><p>3DS (Three-Domain Secure) is a security protocol that authenticates cardholders during online transactions, involving three domains: the merchant, the card issuer, and the acquiring bank. It adds an extra layer of verification by requiring customers to confirm their identity (via password, OTP, biometric, or other methods) before completing online payments. 3DS is widely used in e-commerce transactions, online shopping, subscription services, and digital payments to reduce fraud and chargebacks. It’s particularly common for card-not-present (CNP) transactions where the physical card isn’t present, such as online shopping, mobile payments, and recurring payments. The protocol helps protect both merchants and cardholders by verifying that the person making the purchase is the legitimate cardholder.</p><p><strong>BIN (Bank Identification Number)</strong></p><p>A BIN is the first 6 digits of a credit card that identifies the issuing financial institution or bank. BINs are standardized and managed by major card networks (Visa, Mastercard, American Express) to ensure consistent routing and processing of transactions. Each BIN is associated with specific information including the card type (credit, debit, prepaid), card brand, issuing country, and the bank’s details. BINs are crucial for merchants and payment processors to quickly validate cards, detect fraud, and route transactions to the correct issuing bank during authorization. The remaining digits after the BIN include the account number and a checksum digit, collectively forming the full card number used to identify individual cardholders.</p><p><strong>What is ACH (Additional Card Holder)</strong></p><p>ACH (Additional Card Holder) in the credit card world refers to a secondary cardholder authorized to use a credit card account linked to a primary account holder. The primary cardholder remains responsible for the account and all charges, while the ACH can make purchases using their own physical or digital card tied to the same account. ACHs are commonly used in family situations, corporate settings, or joint accounts where multiple people need access to shared credit</p><p><strong>Direct Debit vs Instant Payment</strong></p><p><strong>Direct Debit</strong> is a recurring payment method where a merchant is authorized to automatically pull funds from a customer’s account on a scheduled basis. It’s commonly used for monthly bills, subscriptions, and recurring charges. Direct Debit operates on a batch-processing model, typically settling within 1–3 business days, and is cost-effective for both merchants and customers.</p><p><strong>Instant Payment</strong> (or real-time payment) is an immediate fund transfer where money moves from the customer’s account to the merchant’s account in real-time or near-real-time. It’s typically used for urgent or one-time payments and provides immediate confirmation. Instant Payments are more expensive than Direct Debit due to the real-time processing required. Ex: BlinkPay, AusPay etc</p><p><strong>AML (Anti-Money Laundering)</strong></p><p>AML refers to a set of legal and regulatory compliance measures designed to prevent money laundering and the financing of illegal activities through credit card transactions and financial systems. Credit card issuers and processors are required to implement AML programs to detect, prevent, and report suspicious financial activities.</p><p><strong>PCI/DSS (Payment Card Industry Data Security Standard)</strong></p><p>PCI/DSS is a comprehensive security framework established by major credit card networks (Visa, Mastercard, American Express) to protect sensitive payment card data and cardholder information. It applies to all organizations that store, process, or transmit credit card data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad0453c17097" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Credit Card Landscape: An Issuer’s Perspective]]></title>
            <link>https://medium.com/@snbaravani/the-credit-card-landscape-an-issuers-perspective-b899e3695fac?source=rss-f202873fd28e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b899e3695fac</guid>
            <category><![CDATA[payment-gateway]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[credit-cards]]></category>
            <category><![CDATA[mastercard]]></category>
            <category><![CDATA[payments]]></category>
            <dc:creator><![CDATA[Subbu Baravani]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 11:24:29 GMT</pubDate>
            <atom:updated>2026-09-10T05:12:55.387Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The Credit Card Landscape: An Issuer’s Perspective</strong></p><p>As an engineering lead at a fintech company, I work directly with the systems that power credit card programs. We’ve built our own Card Management System (CMS) and operate a unique model: issuing flagship cards, providing white-labeled solutions for major retailers, and partnering with a licensed bank.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Z2Dr-TPtwF1V4thtENPAA.png" /></figure><p>This series reflects real-world experience navigating the card ecosystem — the architectural decisions, problems we’ve solved, and patterns that matter most. It’s meant to show how these systems actually work in production, not just in theory.</p><p>If you’re building in payments or trying to understand card operations beyond textbooks, this should help clarify how the pieces fit together.</p><p><strong><em>Note</em></strong><em>: I will focus on generic principles while protecting sensitive information and compliance standards. No PII/PCI or company&#39;s data</em></p><h3>What We’ll Cover</h3><h4>Core concepts, Actors and Functional Areas</h4><ul><li><strong>Four-party card model: </strong>We’ll map out the complete<strong> ecosystem of actors</strong> who make credit card programs possible — from issuers and acquirers to payment networks, banks, and the technology platforms that enable real-time transactions. Understanding these relationships is fundamental to grasping how cards function in the modern financial system.</li><li><strong>Transaction Flow : </strong>What actually happens when a customer taps or swipes their credit card at a store? Behind that two-second approval, data travels through a chain of parties — the merchant, the acquirer, the card network, and the issuer — each playing a distinct role. Understanding this flow is essential to understanding how card platforms are designed. In this post, we’ll trace a single transaction from the moment the card meets the terminal to the point the customer sees “Approved.” We’ll follow the data end to end, including the return journey back to the merchant.<strong>.</strong></li><li><strong>CMS</strong>: The Card Management System (<strong>CMS</strong>) of an Issuer is the operational backbone of card programs, handling account management, setting up a card program, transaction processing, fraud detection, and customer communications. It’s filled with specialized terminology and interlocking processes that can seem opaque to those new to the space.</li><li><strong>Different teams involved</strong>: Issuing and maintaining a credit card takes far more than a single team. Card management, origination, fraud detection, analytics, legal etc and each demand specialized expertise and operate as distinct functions. Together they form the operational backbone that keeps a card program running.</li><li><strong>Major functional areas<em>: </em></strong>We’ll map the <em>major functional areas</em> within a CMS without diving deep into implementation details or exhaustive feature lists. Instead, we’ll explain each area in clear language — building a mental model of how these systems fit together without requiring a banking background. This guided tour introduces you to key concepts and their place within the broader architecture, setting the stage for deeper exploration.</li></ul><h4>Technical Architecture &amp; Design</h4><p>Beyond the surface-level transactions, we’ll explore the technical decisions, architectural patterns, and design considerations that underpin a scalable, APIs, reliable CMS. This includes system integration approaches, and the infrastructure required to maintain 24/7 operational excellence.</p><p>I will cover this in a different post soon….</p><h3>The Four-Party Card Model: Foundation of Modern Payment Systems</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXmUMHUmPBS0dhkXnQ-1ug.png" /></figure><p>The four-party card model forms the backbone of open-loop payment systems operated by networks like Visa and Mastercard. This model connects four essential participants — the cardholder, merchant, issuer, and acquirer — through a central card network infrastructure to authorize, clear, and settle transactions reliably and securely.</p><h3>The Four Key Parties</h3><p><strong>Cardholder</strong>: The consumer who owns and uses a credit or debit card to purchase goods and services.</p><p><strong>Merchant</strong>: The business that accepts card payments and provides goods or services in return. The merchant benefits from instant authorization and guaranteed settlement through the four-party model. Example: JB-HiFi, Woolies etc.</p><p><strong>Issuer (Issuing Bank)</strong>: The cardholder’s financial institution. The issuer issues the card, extends credit or holds funds in the customer’s account, and makes real-time authorization decisions during transactions. The issuer bears the credit risk and is responsible for maintaining the cardholder relationship. Issuer can be a bank itself or an organization which is partnered with a bank. Example: <strong>CBA, Humm Group </strong>(Not a bank)</p><p><strong>Acquirer (Acquiring Bank)</strong>: The merchant’s financial institution. The acquirer manages the merchant’s account, processes transaction data on their behalf, and coordinates the clearing and settlement process. The acquirer bridges the merchant and the broader payment network. Example : <strong>NAB, CBA The Card Network</strong>: Though not always counted as a “party,” the card network (<strong>Visa, Mastercard</strong>, etc.) functions as the critical communication and operational backbone. It routes authorization requests, manages clearing rules, handles dispute resolution, and ensures interoperability between thousands of issuers and acquirers worldwide.</p><h3>How a Transaction Flows</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0Q_KkjzVhF4V1nW5" /></figure><h4>Phase 1: Authorization</h4><p>When a cardholder swipes or taps their card at a merchant:</p><ol><li>The merchant’s point-of-sale device captures the transaction details (amount, merchant ID, card number).</li><li>The merchant sends this data to their <strong>acquirer</strong>, who validates the request format.</li><li>The acquirer routes the authorization request through the <strong>card network</strong> to the appropriate <strong>issuer</strong>.</li><li>The issuer checks the cardholder’s account — verifying available funds or credit limit, fraud screening, and risk assessment — and responds with an approval or decline. CMS takes care of these responsibilities working with other systems like Fraud checks, Credit validators for Card origination etc.</li><li>The response travels back through the network to the acquirer and on to the merchant, typically completing in 1–3 seconds.</li><li>The merchant receives a confirmation code and can complete the transaction.</li></ol><h4>Phase 2: Clearing</h4><p>At the end of each business day, the clearing process begins:</p><ol><li>The merchant (or their acquirer) bundles all approved transactions from that day.</li><li>These batches are sent to the <strong>acquirer</strong>, who aggregates data from all their merchants.</li><li>The acquirer submits the clearing batch through the <strong>card network</strong> to each relevant issuer.</li><li>Each issuer validates the submitted transactions against the authorizations they issued and confirms receipt.</li></ol><p>This phase ensures that both sides (issuer and acquirer) agree on the transactions that occurred and their amounts.</p><h4>Phase 3: Settlement</h4><p>Settlement is where actual funds move:</p><ol><li>For each cleared transaction, the <strong>issuer</strong> transfers funds to the <strong>card network</strong> (minus interchange fees and network charges).</li><li>The <strong>card network</strong> consolidates payments from all issuers and distributes them to the relevant acquirers.</li><li>The <strong>acquirer</strong> nets the payments it received against the merchant fees and deposits the remainder into the <strong>merchant’s account</strong> within 1–3 business days.</li></ol><p>The cardholder’s account is also debited during settlement (or credited if the transaction was a refund)</p><h3><strong>Credit Card Life Cycle: Department Responsibilities</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7za3J7s8aF-ynrz2" /></figure><p>On the surface, issuing and managing credit cards appears straightforward: apply for a card, use it to pay, and the system handles the rest. The mechanics seem simple, almost invisible.</p><p>But behind that simplicity lies an intricate orchestration of specialized teams, each owning a critical piece of the puzzle. Issuing a single card requires coordination across origination systems, regulatory checks, and fraud prevention. Keeping that card active demands a sophisticated stack: the core card management system processing transactions, real-time fraud detection scanning for anomalies, data pipelines feeding insights to analysts, mobile teams delivering seamless customer experiences, production teams ensuring 24/7 reliability, and support teams standing ready for when things go wrong.</p><h3>Major Functional Areas and Features of a CMS</h3><p>Credit card lifecycle management in most CMS systems involves numerous features to handle card processing, security, and compliance. While the core functionality is relatively standard across platforms, the complete feature set can vary significantly based on supported card types and business requirements. This list below focuses on the essential features commonly implemented rather than attempting an exhaustive list.</p><p>One important caveat: capabilities such as credit checks, fraud detection, and audit &amp; compliance may live outside the core CMS, integrated as separate systems or third-party services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/0*R6t2t_lMYUghWsc2" /></figure><p><strong><em>With the main actors, features, and flows behind us, let’s turn to how a typical CMS is actually architected in the next post……..!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b899e3695fac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real time party of data streaming, analytics and visualisation in the Lake House]]></title>
            <link>https://medium.com/@snbaravani/real-time-party-of-data-streaming-analytics-and-visualisation-in-the-lake-house-951d4fa96afb?source=rss-f202873fd28e------2</link>
            <guid isPermaLink="false">https://medium.com/p/951d4fa96afb</guid>
            <category><![CDATA[data-lakehouse]]></category>
            <category><![CDATA[debezium]]></category>
            <category><![CDATA[realtime-data-streaming]]></category>
            <category><![CDATA[delta-lake]]></category>
            <category><![CDATA[databricks]]></category>
            <dc:creator><![CDATA[Subbu Baravani]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 12:01:24 GMT</pubDate>
            <atom:updated>2026-09-10T05:13:44.821Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Real time party of data streaming, analytics and visualisation in the Lake House</strong></p><p>Consider a scenario where your IoT enabled application sending information to your database and you need to run analytics on the data and also visualise it in real or near real time. If the data was small and all of it was in the database, we could directly connect to the database for analytics or visualisation. However, if the data grows exponentially (read in gigs), an OLTP database wouldn’t scale well for analytics.</p><p>So how do we analyse and visualise the data in real or near real time without impacting the database’s performance specially when the records in the database are in millions or even billions and growing?</p><p><strong>Solution</strong></p><p>There are many ways to go about it as always. Let us look at this implementation where the database (Postgres, MySQL, MongoDB or Cassandra etc) contains millions of records and these records will be streamed into Apache Kafka in real time using CDC technology and stream them into a data lake using Databrick’s open sourced Delta Lake framework. Once they land in the data lake, data can be analysed, visualised using AWS’s Quicksight through Athena. This data can be further cleansed or aggregated in real time. The implementation is based on <strong>Lake house architecture </strong>and this will be an example of <strong>low code ELT</strong> and <strong>Event-Driven Architecture </strong>as well.</p><p><strong>What is LakeHouse Architecture?</strong></p><p>A data lakehouse is a new, open data management architecture that combines the flexibility, cost-efficiency, and scale of <a href="https://www.databricks.com/discover/data-lakes/introduction">data lakes</a> with the data management and ACID transactions of data warehouses, enabling business intelligence (BI) and machine learning (ML) on all data.</p><p>There are many implementations of this architecture available in the market. Some of the well known implementations are provided by Snoflake, Databricks, AWS, GCP etc.</p><p><strong>Why Databrick’s Lakehouse Architecture?</strong><br>Databrick’s Lakehouse is underpinned by widely adopted <em>open source projects</em> Apache Spark™, Delta Lake and MLflow, and is globally supported by the Databricks Partner Network. ​​And Delta Sharing provides an open solution to securely share live data from your lakehouse to any computing platform without replication and complicated ETL. Check this <a href="http://:https://www.databricks.com/product/data-lakehouse?scid=7018Y000001Fi10QAC&amp;utm_medium=paid+search&amp;utm_source=google&amp;utm_campaign=17163280025&amp;utm_adgroup=131532077450&amp;utm_content=product+page&amp;utm_offer=data-lakehouse&amp;utm_ad=665996165670&amp;utm_term=data%20lakehouse%20databricks&amp;gad=1&amp;gclid=CjwKCAjwloynBhBbEiwAGY25dB1L8oyE1AebNTm7pbUpBNGrycBrySx6ROBOQvPeTYUL-jmNB-1bghoCZVEQAvD_BwE">page</a> for more details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b4RDedsNUrbIiysT.png" /><figcaption>Databrick’s Lakehouse Architecture</figcaption></figure><p>Here the compute is separated from the storage. Data can be stored in the cloud or on-premise. This is very useful where there are restrictions on storing the data in the cloud especially in insurance and banking domain. Another advantage of this is the scalability though the underlying engine i.e Apache Spark which can handle humungous amount of data and transformations.</p><p>We will stream ~2 millions records in Postgres to a data lake and visualise it with the lake house architecture .</p><p><strong>Data</strong></p><p>I have used Kaggle’s <a href="https://www.kaggle.com/datasets/wol4aravio/ny-taxi-trip-duration-enriched-by-mathematica">NewYork city taxi trips</a> for the data. This dataset consists of both features from initial dataset and generated via Wolfram Mathematica computational system. Thus, all features can be split into following groups:</p><ul><li>Initial features (extracted from initial data),</li><li>Calendar features (contains of season, day name and day period),</li><li>Weather features (information about temperature, snow, and rain),</li><li>Travel features (geo distance with estimated driving distance and time, day etc).</li></ul><p><strong>System Design</strong></p><p>Initial data comes and lands in Postgres, streamed immediately to Apache Kafka, consumed by Apache Spark streaming and stored in S3 using Delta Lake framework and analysed and visualised through AWS’s QuickSight</p><figure><img alt="Real Time Data Streaming in Lakehouse Architecture" src="https://cdn-images-1.medium.com/max/1024/1*S7Eapeh0DyjjQgPUepD2bw.jpeg" /></figure><p><strong>Note</strong>: <em>Even the visualisation can me made real time or near real time by using Databricks workspace/run time env and </em><a href="https://www.databricks.com/product/delta-live-tableshttps://www.databricks.com/product/delta-live-tables"><em>Delta Live</em></a><em> tables to which a tool like Tablaue can connect to. </em><a href="https://delta.io/sharing/"><em>Delta Sharing</em></a><em> makes this possible and this avoids duplication of data in the visualisation tool. We implemented for a client of the org where I worked.</em></p><p><strong>The Setup</strong></p><p>Postgres, Debezium connector and Apache Kafka all dockerised and running locally on the laptop. I have used AWS S3 to implement storage part of the lakhouse through Delta Lake. AWS glue crawler and Athena help QuickSight to visualise the data.</p><p>I am using <a href="https://www.confluent.io/">Confluent’s Kafka suite</a>. Data will be stored in the <a href="https://avro.apache.org/">Avro</a> format in the topic “postgres.public.ny_taxi_trips_data” which is automatically created by the Debezium’s connector. Schema management and schema evolution will be handled by the schema registry.</p><p><strong>Postgres to Kafka live flow through Debezium</strong><br> All the data including the new, updates and deletes are immediately moved to Kafka through <a href="https://debezium.io/documentation/reference/stable/architecture.html">Debezium</a> Kafka connector. Debezium is a set of distributed services that capture row-level changes in your databases so that your applications can see and respond to those changes. Debezium is a platform that provides a low latency data streaming platform for change data capture (CDC) and is built on top of Apache Kafka.</p><pre><br>  &quot;name&quot;: &quot;app-debz-connector&quot;,<br>  &quot;config&quot;: {<br>    &quot;connector.class&quot;: &quot;io.debezium.connector.postgresql.PostgresConnector&quot;,<br>    &quot;plugin.name&quot;: &quot;pgoutput&quot;,<br>    &quot;database.hostname&quot;: &quot;postgres&quot;,<br>    &quot;database.port&quot;: &quot;5432&quot;,<br>    &quot;database.user&quot;: &quot;postgres&quot;,<br>    &quot;database.password&quot;: &quot;postgres&quot;,<br>    &quot;database.dbname&quot;: &quot;nytaxi&quot;,<br>    &quot;database.server.name&quot;: &quot;postgres&quot;,<br>    &quot;topic.prefix&quot;:&quot;lakehouse&quot;,<br>    &quot;table.include.list&quot;: &quot;public.ny_taxi_trips_data&quot;<br>     <br><br>  }<br>}<br>            The Debezium connector Json payload</pre><p><strong>The spark streaming job</strong> consumes the data from the kafka topic and stores it in parquet format on AWS’s S3 bucket. The data is partitioned by weekdays as the idea is to find the trips pattern along the week. Glue crawler runs periodically and helps QuickSight to visualise the data. QuickSight’s visuals are created manually.</p><pre>#Spark streaming job consuming from Kafka<br><br>options = {<br>    &quot;kafka.bootstrap.servers&quot;: &quot; PLAINTEXT://kafka:9092&quot;,<br>    &quot;application.id&quot;: &quot;lakehouse-app&quot;,<br>    &quot;subscribe&quot;: &quot;postgres.public.ny_taxi_trips_data&quot;,<br>    &quot;startingOffsets&quot;: &quot;earliest&quot;<br><br>}<br>..........<br>fromAvroOptions = {&quot;mode&quot;: &quot;FAILFAST&quot;}<br>schema_registry_conf = {&#39;url&#39;: &quot;http://localhost:8081&quot;}<br>schema_registry_client = SchemaRegistryClient(schema_registry_conf)<br>value_schema = schema_registry_client.get_latest_version(<br>    &#39;postgres.public.ny_taxi_trips_data&#39; + &quot;-value&quot;).schema.schema_str<br>tripsDfStream = spark.readStream.format(&quot;kafka&quot;).options(**options).load().withColumn(&#39;fixedValue&#39;, func.expr(&quot;substring(value, 6, length(value)-5)&quot;)).select(from_avro(&#39;fixedValue&#39;, value_schema,       fromAvroOptions).alias(&#39;parsedValue&#39;))<br> ..........<br>parsedDF.repartition(100).writeStream.format(&quot;delta&quot;).outputMode(&quot;append&quot;) .partitionBy(&quot;weekday&quot;).option(&quot;overwriteSchema&quot;, &quot;true&quot;) \<br>   .start(&quot;s3a://nytripslakehouse/nytripslakehousebronze/&quot;).awaitTermination()</pre><p><strong>Visualisation using QuickSight</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*asElI6HDteo_fmlh8tvEeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ru9I1TgItyXquzkaiP1Mw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vf98tWjzBGD-BSSueXBUvw.png" /></figure><p><strong>Running the application</strong></p><ol><li>Install Docker, Python3 and Pyspark etc . You would figure out the missing packages if any while running the spark job</li><li>Clone the repo from here <a href="https://github.com/snbaravani/LakeHouseArchitecture.git">https://github.com/snbaravani/LakeHouseArchitecture.git</a></li><li>Change the volume path in the postgres section in the docker-compose.yaml. Run the docker compose <em>docker-compose up</em> and <em>doker ps</em> should show you the following containers.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sbEUs2BUXIh-BKTADb2eqw.png" /></figure><p>4. Copy the data in the <a href="https://www.kaggle.com/datasets/wol4aravio/ny-taxi-trip-duration-enriched-by-mathematica">csv</a> file to postgres after copying the csv to docker</p><pre>docker cp /Users/../../NY_Taxi_Rich.csv docker_code_postgres_1:scripts<br><br>COPY ny_taxi_trips_data<br>FROM &#39;/scripts/NY_Taxi_Rich.csv&#39;<br>DELIMITER &#39;,&#39; <br>CSV HEADER;</pre><p>You should see ~ 2 million records in the the table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*xGXPt9CXX41DswL57TrQYA.png" /></figure><p>5. Run the debezium connector with the json payload at 127.0.0.1:8083/connectors/ and and it will immediately move all the records in the postgres table to kafka topic “postgres.public.ny_taxi_trips_data” (auto created). Any update or insertion to the table will be streamed into the topic from now on. Run the Kafkacat command to see the data in the topic</p><pre>kafkacat -C -b localhost:9092 \<br>    -t postgres.public.ny_taxi_trips_data \<br>    -r http://localhost:8081 \<br>   -o -1 -s value=avro  <br>    -e -q \<br>    | grep -v &quot;Reading configuration from file&quot; | wc -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dfac5p-eXQyjkCfsWwDazw.png" /></figure><p>7. Create an s3 bucket and give access to Athena, Glue and QuickSight. <a href="https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html">Configure AWS</a> credentials on your machine.</p><p>8. Run the spark job <em>ny-taxi_trips_consumer.py</em> after changing the bucket URN in the code and within few seconds parquet files will be generated in the s3 bucket partitioned by weekdays</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ielbfJb6nGimKupP0o-05A.png" /></figure><p>9. Create a Glue crawler and point it to the bucket created above and run the crawler. More details <a href="https://aws.amazon.com/blogs/mt/use-amazon-athena-and-amazon-quicksight-to-build-custom-reports-of-aws-well-architected-reviews/">here</a></p><p>10. You will see the data (~2 million) in the Athena table <em>nytripslakehouse.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ct-0BeORd7cJ89R7DBeX-A.png" /></figure><p>11. QuickSight visuals need to be created manually and that that is out of scope for this article :-)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=951d4fa96afb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>