<?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"><channel><title><![CDATA[Data with Aishwarya]]></title><description><![CDATA[Data with Aishwarya]]></description><link>https://aishwaryapatankar.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/64db587c37e72e98843a24cb/529034d1-02f7-4646-a871-d02ee9a82617.png</url><title>Data with Aishwarya</title><link>https://aishwaryapatankar.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sat, 19 Sep 2026 00:56:36 GMT</lastBuildDate><atom:link href="https://aishwaryapatankar.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Why Payment Systems Break — And How Kafka & Spark Prevent It]]></title><description><![CDATA[Every day, banks process millions of payments. Most people think the hard part is moving money. It’s not.
The hard part is making sure nothing breaks when you're processing 500,000 payments simultaneo]]></description><link>https://aishwaryapatankar.hashnode.dev/why-payment-systems-break-and-how-kafka-spark-prevent-it</link><guid isPermaLink="true">https://aishwaryapatankar.hashnode.dev/why-payment-systems-break-and-how-kafka-spark-prevent-it</guid><category><![CDATA[payments]]></category><category><![CDATA[kafka]]></category><category><![CDATA[spark]]></category><category><![CDATA[data-engineering]]></category><category><![CDATA[System Design]]></category><dc:creator><![CDATA[Aishwarya Patankar]]></dc:creator><pubDate>Mon, 11 May 2026 14:57:10 GMT</pubDate><content:encoded><![CDATA[<p><strong>Every day, banks process millions of payments. Most people think the hard part is moving money. It’s not.</strong></p>
<p>The hard part is making sure nothing breaks when you're processing 500,000 payments simultaneously, in 12 different formats, across distributed systems that <em>will</em> crash.</p>
<p>In [<a href="https://aishwaryapatankar.hashnode.dev/behind-every-payment-the-data-pipelines-you-don-t-see">Part1</a>], we explored the invisible data pipelines behind every payment. Now let’s go deeper — into the 5 real problems that kill payment pipelines at scale, and the engineering that prevents each one.</p>
<hr />
<h2><strong>Problem 1: "The Flood" — Traffic Spikes That Kill Systems</strong></h2>
<p><strong>The scenario:</strong> It's month-end. Every corporate client submits payroll simultaneously. Your system goes from 100 payments/sec to 50,000/sec in 2 minutes.</p>
<p><strong>What happens without a buffer?</strong></p>
<p>You either:</p>
<ul>
<li><p>Over-provision infrastructure that sits idle most of the month, or</p>
</li>
<li><p>Overwhelm downstream systems and start dropping or timing out payments.</p>
</li>
</ul>
<p>Neither is acceptable in a financial system.</p>
<p><strong>How Kafka solves this:</strong></p>
<p>Kafka acts as a durable buffer between producers and consumers. Producers write messages as quickly as they arrive, while consumers process them at their own sustainable pace.</p>
<p>The diagram below illustrates this decoupling in action:</p>
<img src="https://cdn.hashnode.com/uploads/covers/64db587c37e72e98843a24cb/618bd0d7-dadd-4369-968a-cafd1f9bb481.png" alt="Traffic Spikes and Kafka Buffer" style="display:block;margin:0 auto" />

<p>This separation is critical. Upstream systems no longer need to know whether downstream systems are temporarily slow, restarting, or under heavy load.</p>
<p>Kafka persists messages to disk and replicates them across brokers, so traffic spikes become a storage problem - not an availability problem.</p>
<p><strong>Key takeaway:</strong> In payments, losing a message means losing someone's money. A durable buffer isn't optional — it's the foundation.</p>
<hr />
<h2><strong>Problem 2: "The Crash" — A Server Dies Mid-Processing</strong></h2>
<p><strong>The scenario:</strong> Your system is processing a file with 10,000 salary payments. It finishes 6,000. Then the server crashes.</p>
<p>Now what?</p>
<ul>
<li><p><strong>Restart from zero?</strong> → 6,000 people get paid TWICE. Catastrophic.</p>
</li>
<li><p><strong>Skip the file?</strong> → 4,000 people DON'T get paid. Also catastrophic.</p>
</li>
<li><p><strong>Figure out which remain?</strong> → Manual, error-prone, doesn't scale.</p>
</li>
</ul>
<p><strong>How Kafka offsets solve this:</strong></p>
<p>The committed offset acts like a checkpoint. Once a payment is processed successfully, the consumer records its position. If the server crashes, processing resumes from the next unread message - automatically.</p>
<p>The diagram below shows how offset tracking enables crash recovery:</p>
<img src="https://cdn.hashnode.com/uploads/covers/64db587c37e72e98843a24cb/ab2e7b77-5b0a-4d03-9f16-94d8d7aad1cd.png" alt="Kafka Offsets and Crash Recovery" style="display:block;margin:0 auto" />

<p>No duplicates. No losses. No manual work. In financial systems, this is the difference between regulatory compliance and front-page news.</p>
<p><strong>Key takeaway:</strong> Offsets are a persistent bookmark that survives crashes. This single mechanism underpins the reliability guarantees that payment systems depend on.</p>
<hr />
<h2><strong>Problem 3: "The Format Chaos" — 10 Clients, 10 Formats, 1 System</strong></h2>
<p><strong>The scenario:</strong> Client A sends ISO 20022 XML. Client B sends flat files. Client C sends JSON. Client D sends EDI. All must become one internal standard for downstream processing. New formats arrive every quarter.</p>
<p><strong>Without decoupled architecture:</strong> One monolithic translator handles everything. One format's bug crashes ALL formats. Deploying a fix is terrifying.</p>
<p><strong>With Kafka + Spark:</strong></p>
<p>The diagram below shows how this architecture isolates format specific logic:</p>
<img src="https://cdn.hashnode.com/uploads/covers/64db587c37e72e98843a24cb/c3a4da01-3611-4c73-9cfa-936ec439fc36.png" alt="Format Standardization" style="display:block;margin:0 auto" />

<p>Each translator is an independent spark job. New format? Add a new job. Zero impact on existing flows. One parser crashes? Others continue processing uninterrupted. This is how you scale both a system and a team.</p>
<p><strong>Key takeaway:</strong> Kafka topics create natural boundaries between concerns. Spark provides the parallel compute to transform each format efficiently. Together, they turn format chaos into a modular, extensible pipeline.</p>
<hr />
<h2><strong>Problem 4: "The 4-Hour Batch" — Business Wants Results in 10 Minutes</strong></h2>
<p><strong>The scenario:</strong> A large corporation submits a single payroll file with 500,000 employee payments. Sequential processing takes 4 hours. Business requirement: 10 minutes.</p>
<p><strong>How Spark solves this:</strong></p>
<p>Spark divides one large file into partitions and processes them in parallel across many workers. The diagram below illustrates this distribution:</p>
<img src="https://cdn.hashnode.com/uploads/covers/64db587c37e72e98843a24cb/4f1aaa7c-0308-4e57-9d4d-d5235f0e336c.png" alt="Spark Parallel Processing" style="display:block;margin:0 auto" />

<p>This converts hours of sequential processing into minutes. Need it faster? Add more workers. The scaling is near-linear.</p>
<p>This is why Spark exists in payment systems. Its not about fancy ML or analytics - it's brute-force parallel processing of massive files.</p>
<p><strong>Key takeaway:</strong> The business doesn’t care about your architecture. They care that 500,000 employees see their salary on time. Spark makes that possible.</p>
<hr />
<h2><strong>Problem 5: "The Ripple Failure" — One Bad Payment Kills the Batch</strong></h2>
<p><strong>The scenario:</strong> Payment #347 out of 50,000 has an invalid currency code. What happens to the other 49,999 valid payments?</p>
<p><strong>Bad design:</strong> Entire batch fails. 49,999 people wait while ops investigates one bad record.</p>
<p><strong>Good design — Dead Letter pattern:</strong></p>
<p>The pipeline separates successful and failed records at the point of validation. The diagram below shows how this isolation works:</p>
<img src="https://cdn.hashnode.com/uploads/covers/64db587c37e72e98843a24cb/38db86ab-a822-45c1-99df-30c9fbb486c9.jpg" alt="Dead Letter Pattern" style="display:block;margin:0 auto" />

<p>Valid payments flow through unblocked. Failed payments are isolated, logged, alerted on and routed for retry or manual review. The 99.9% doesn't suffer for the 0.1%.</p>
<p><strong>Key takeaway:</strong> In payment systems, robust error handling is a core part of the product. The difference between a junior and senior data engineer is how they handle the edge cases — because that 0.01% is someone's rent money.</p>
<hr />
<h2><strong>Putting It All Together</strong></h2>
<p>Kafka and Spark solve different but complementary problems in payment systems:</p>
<ul>
<li><p>Kafka provides durable storage, traffic buffering and crash recovery through offsets. It protects the system from spikes and failures.</p>
</li>
<li><p>Spark performs large-scale transformations and validations in parallel, turning diverse payment formats into a standardized structure that downstream systems can process efficiently.</p>
</li>
<li><p>Together, they form a resilient pipeline that can absorb bursts, recover from crashes, process massive files quickly and isolate bad records without disrupting valid payments.</p>
</li>
</ul>
<hr />
<h2><strong>Closing Thought</strong></h2>
<p>As a data engineer early in my career, writing this blog forced me to think beyond code - about <strong>why</strong> these tools exist and what happens when they fail.</p>
<p>Understanding these five problems changed how I look at every pipeline I build Not just "does it work?" but "what happens when it doesn't?"</p>
<p>If you're early in your data engineering journey too, I'd encourage you to ask the same questions about your own systems. That shift in thinking - from code-first to failure-first - is what separates building pipelines from building <strong>trust</strong>.</p>
<blockquote>
<p>Next in this series: How acknowledgements, reconciliation and regulatory frameworks complete the payment lifecycle.</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[Behind Every Payment: The Data Pipelines You Don’t See]]></title><description><![CDATA[The Problem: Payments Look Simple, But Aren’t
When you send money via UPI or receive your salary, it feels instant and effortless.
But behind that single action, multiple systems exchange structured d]]></description><link>https://aishwaryapatankar.hashnode.dev/behind-every-payment-the-data-pipelines-you-don-t-see</link><guid isPermaLink="true">https://aishwaryapatankar.hashnode.dev/behind-every-payment-the-data-pipelines-you-don-t-see</guid><category><![CDATA[data-engineering]]></category><category><![CDATA[kafka]]></category><category><![CDATA[#apache-spark]]></category><category><![CDATA[fintech]]></category><category><![CDATA[System Design]]></category><dc:creator><![CDATA[Aishwarya Patankar]]></dc:creator><pubDate>Thu, 30 Apr 2026 18:40:12 GMT</pubDate><content:encoded><![CDATA[<h2>The Problem: Payments Look Simple, But Aren’t</h2>
<p>When you send money via UPI or receive your salary, it feels instant and effortless.</p>
<p>But behind that single action, multiple systems exchange structured data, validate it, transform it, and ensure nothing breaks.</p>
<p>One missing field or duplicate record isn’t just a bug — it can lead to financial discrepancies, failed transactions, or reconciliation issues.</p>
<p>So what actually happens behind the scenes?</p>
<hr />
<p>Every payment you make — salary credit, UPI transfer, or card swipe — is not just a transaction.</p>
<p>It’s a structured data pipeline moving across multiple systems.</p>
<p>Even if you never see an XML or JSON file, every rupee flowing between systems passes through formats, validations, and acknowledgements.</p>
<p>As data engineers, we ensure these pipelines remain reliable, auditable, and scalable.</p>
<p>Let’s break this down from a data engineering perspective.</p>
<hr />
<h2>What Is a Payment (From a Data Engineer’s View)</h2>
<p>From a data engineering perspective, a payment is a structured record moving from one system to another.</p>
<p>Typical fields include:</p>
<ul>
<li><p><strong>Amount and currency</strong></p>
</li>
<li><p><strong>Timestamp</strong> (initiation or settlement)</p>
</li>
<li><p><strong>Source and destination IDs</strong> (payer, payee, account, merchant, or card)</p>
</li>
<li><p><strong>Status, channel, and metadata</strong> (references, indicators, purpose codes)</p>
</li>
</ul>
<p>The same payment appears in multiple formats as it moves through systems:</p>
<ul>
<li><p>CSV batch file from HR (payroll)</p>
</li>
<li><p>ISO 20022 XML message for corporate and international transfers</p>
</li>
<li><p>JSON or Avro event inside internal Kafka pipelines</p>
</li>
<li><p>ISO 8583–style record when a card network handles authorization</p>
</li>
</ul>
<p>At each step, the structure evolves based on system requirements.</p>
<hr />
<h2>Where Do These File Formats “Live“?</h2>
<p>Different parts of the payment ecosystem use different formats.</p>
<h3>Salary / Payroll Flows</h3>
<ul>
<li><p>Often start as CSV or custom batch files generated by HR systems.</p>
</li>
<li><p>Simple and flat — good for large-volume batch uploads.</p>
</li>
<li><p>Land in a secure folder or storage bucket (S3, HDFS, or on‑prem) before being validated.</p>
</li>
</ul>
<h3>Bulk and Cross-Border Transfers</h3>
<ul>
<li><p>Typically use ISO 20022 XML standards such as pain.001 or pain.008.</p>
</li>
<li><p>XML supports detailed structures required for fees, FX rates, and regulatory fields.</p>
</li>
<li><p>Heavier to parse, but great for analytics and global interoperability.</p>
</li>
</ul>
<h3>Card Payments and POS / Wallets</h3>
<ul>
<li><p>Historically depended on ISO 8583, a compact, position‑based format.</p>
</li>
<li><p>Many newer systems adopt JSON or ISO 20022 instead, making integration easier with APIs.</p>
</li>
</ul>
<h3>Internal Kafka / Event Pipelines</h3>
<ul>
<li><p>Inside the enterprise, payment‑related events are serialized as JSON or Avro on Kafka topics.</p>
</li>
<li><p>This layer powers real‑time features such as fraud detection, routing, and notifications.</p>
</li>
</ul>
<hr />
<h2>Payment Flow Evolution</h2>
<p>A single transaction can transform across systems:</p>
<img src="https://cdn.hashnode.com/uploads/covers/64db587c37e72e98843a24cb/edaa2281-84dc-4927-b39b-3462887a7332.png" alt="" style="display:block;margin:0 auto" />

<p>Each stage adapts the structure based on system requirements and downstream needs.</p>
<hr />
<h2>Common Payment Data Formats</h2>
<table>
<thead>
<tr>
<th>Format</th>
<th>Used For</th>
<th>Why It Matters</th>
</tr>
</thead>
<tbody><tr>
<td>ISO 20022 XML</td>
<td>Cross-border, corporate</td>
<td>Rich, hierarchical structure and strong global standard</td>
</tr>
<tr>
<td>ISO 8583</td>
<td>Card networks</td>
<td>Fast, field-based, position-encoded schema</td>
</tr>
<tr>
<td>CSV</td>
<td>Payroll, batch flows</td>
<td>Simple, scalable</td>
</tr>
<tr>
<td>JSON / Avro</td>
<td>Streaming pipelines</td>
<td>Flexible, real-time ready</td>
</tr>
<tr>
<td>EDIFACT</td>
<td>Legacy systems</td>
<td>Still exists in older integrations</td>
</tr>
</tbody></table>
<h3>Rule of Thumb</h3>
<ul>
<li><p>Use <strong>XML</strong> for structure and standardization</p>
</li>
<li><p>Use <strong>CSV</strong> for simplicity and scale</p>
</li>
<li><p>Use <strong>JSON/Avro</strong> for real-time pipelines</p>
</li>
</ul>
<hr />
<h2>Where Data Engineers Fit</h2>
<p>We don’t define payment rules — we ensure they run reliably.</p>
<h3>1. Landing &amp; Ingestion</h3>
<ul>
<li><p>Organize incoming files</p>
</li>
<li><p>Track metadata (batch_id, source, timestamps)</p>
</li>
<li><p>Monitor file arrivals and failures</p>
</li>
</ul>
<h3>2. Validation &amp; Quality Checks</h3>
<ul>
<li><p>Schema validation</p>
</li>
<li><p>Required fields check</p>
</li>
<li><p>Duplicate detection</p>
</li>
<li><p>Basic sanity checks</p>
</li>
</ul>
<h3>3. Enrichment &amp; Transformation</h3>
<ul>
<li><p>Flatten XML/JSON</p>
</li>
<li><p>Standardize fields and formats</p>
</li>
<li><p>Add metadata and business context</p>
</li>
</ul>
<h3>4. Event Publishing</h3>
<ul>
<li><p>Publish to Kafka topics</p>
</li>
<li><p>Manage schema, partitions, and retention</p>
</li>
<li><p>Handle failures via DLQs</p>
</li>
</ul>
<h3>5. Analytics &amp; Reconciliation</h3>
<ul>
<li><p>Store curated data</p>
</li>
<li><p>Enable lineage and audit</p>
</li>
<li><p>Support compliance and reporting</p>
</li>
</ul>
<hr />
<h2>Example: Salary Payments as a Batch Pipeline</h2>
<h3>1. File Generation</h3>
<p>Payroll system generates a CSV with:</p>
<ul>
<li><p>amount, currency</p>
</li>
<li><p>timestamp</p>
</li>
<li><p>source (company account)</p>
</li>
<li><p>destination (employee account)</p>
</li>
</ul>
<h3>2. Landing &amp; Validation</h3>
<ul>
<li><p>File lands in a storage layer (e.g., S3, HDFS, or on-prem systems)</p>
</li>
<li><p>Spark job validates schema and batch_id</p>
</li>
<li><p>Invalid records are rejected</p>
</li>
</ul>
<h3>3. Enrichment</h3>
<ul>
<li><p>Add metadata (batch_id, ingestion time)</p>
</li>
<li><p>Map business context</p>
</li>
<li><p>Normalize formats (timestamps, currency precision)</p>
</li>
</ul>
<h3>4. Event Publishing</h3>
<ul>
<li><p>Publish to Kafka (<code>payments.enriched</code>)</p>
</li>
<li><p>Consumed by downstream services to trigger payment execution, send notifications, and update analytics systems</p>
</li>
</ul>
<h3>5. Execution &amp; Reconciliation</h3>
<ul>
<li><p>Payment engine processes transactions</p>
</li>
<li><p>Reconciliation files confirm final transaction status (success/failure/reversal)</p>
</li>
</ul>
<h3>Pipeline Requirements</h3>
<ul>
<li><p><strong>Idempotent</strong> → no duplicate payments</p>
</li>
<li><p><strong>Auditable</strong> → traceable end-to-end</p>
</li>
<li><p><strong>Resilient</strong> → recover from failures</p>
</li>
</ul>
<hr />
<h2>Why This Matters</h2>
<p>In payment systems, bad data is not just a bug — it’s financial risk.</p>
<p>Data engineers ensure that:</p>
<ul>
<li><p>pipelines never double-pay or silently drop transactions</p>
</li>
<li><p>every record is fully traceable through metadata and lineage</p>
</li>
<li><p>systems remain reliable and fault-tolerant under scale</p>
</li>
<li><p>data is available in near real-time for compliance and fraud detection</p>
</li>
</ul>
<hr />
<h2>Closing Thoughts</h2>
<p>Payments may look complex — ISO standards, SWIFT messages, multiple formats. But underneath, they are structured records moving across systems.</p>
<p>Understanding how data evolves from a simple CSV to a streaming event helps you build systems that keep money moving safely.</p>
<p>In Part 2, we’ll explore how Spark and Kafka power real-time payment pipelines.</p>
]]></content:encoded></item></channel></rss>