<?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 Harshithnp  on Medium]]></title>
        <description><![CDATA[Stories by Harshithnp  on Medium]]></description>
        <link>https://medium.com/@harshithnp.96?source=rss-7c47c9bcf130------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*eTuiCsCqqp9Ci4AV</url>
            <title>Stories by Harshithnp  on Medium</title>
            <link>https://medium.com/@harshithnp.96?source=rss-7c47c9bcf130------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 22:15:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harshithnp.96/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[Why MapReduce Crawls and Spark Flies: The Real Story Behind the Speedup]]></title>
            <link>https://medium.com/@harshithnp.96/why-mapreduce-crawls-and-spark-flies-the-real-story-behind-the-speedup-83b4d7d5e926?source=rss-7c47c9bcf130------2</link>
            <guid isPermaLink="false">https://medium.com/p/83b4d7d5e926</guid>
            <dc:creator><![CDATA[Harshithnp ]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 16:51:54 GMT</pubDate>
            <atom:updated>2026-02-18T16:51:54.553Z</atom:updated>
            <content:encoded><![CDATA[<p>Before Apache Spark, MapReduce was the default hammer for big data nails. It worked, it scaled, and it powered the early Hadoop era — but it was also painfully slow for many real-world workloads. To understand why Spark is such a big upgrade, you have to start with MapReduce’s core performance bottleneck, then zoom into how Spark redesigned the whole execution model.</p><h3>1. Why MapReduce Is Slow: Disk Is the Bottleneck</h3><h4>MapReduce’s biggest performance problem is <strong>it writes almost everything to disk.</strong></h4><ul><li>After the Map step finishes, its intermediate results are written to HDFS.</li><li>The Shuffle/Sort step reads that data back from disk, rearranges it, and writes new intermediate files.</li><li>The Reduce step reads those intermediate files again, computes aggregations, and writes the final output back to disk.</li></ul><p>See the full MapReduce data flow below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XhL1hjqMwoNEtIio.jpg" /><figcaption>Hadoop MapReduce parallel data flow diagram with input split map shuffle reduce output stages</figcaption></figure><p>Every stage in the pipeline is separated by a full round trip to disk, even when the data and computation could fit comfortably in memory. The larger your data and the more steps you chain, the more this disk I/O dominates runtime.​</p><p>There is a second, subtler limitation: MapReduce forces everything into a <strong>rigid two-step model — Map and Reduce.</strong> If your logic involves filters, joins, multiple aggregations, or intermediate projections, you don’t express that in one flexible flow. You break it into multiple MapReduce jobs, each with its own full disk read–write cycle and its own scheduling overhead.​</p><h3>2. The Word-Count Example: How MapReduce Works (and Wastes Time)</h3><p>The classic word-count example makes these problems easy to see.</p><p><strong>Map step: create key–value pairs</strong></p><p>Imagine a text file with a few lines of text. The Map step:</p><ul><li>Reads each line.</li><li>Splits the line into words.</li><li>Emits (word, 1) key–value pairs such as (&quot;hello&quot;, 1) or (&quot;spark&quot;, 1).</li></ul><p>So far, so good. But once this mapping is done, <strong>all these key–value pairs are written back to disk</strong> as intermediate output.</p><h3>Shuffle/Sort + Reduce: disk, disk, disk</h3><p>In the next phase, here’s exactly what happens:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0msa5lpbyNBVbVMJ.jpg" /><figcaption>MapReduce Job Execution Flow diagram with Input Reader, Mapper, Combiner, Partitioner, Shuffling, Sorting, Reducer</figcaption></figure><ul><li>The Shuffle/Sort step reads those key–value pairs <em>from disk</em>, groups identical keys together, and writes grouped intermediate results back to disk.</li><li>The Reduce step reads that grouped data from disk yet again, sums the counts for each word, and writes the final counts to disk.</li></ul><p>Even for this tiny example, MapReduce:</p><ul><li>Writes the Map output to disk.</li><li>Reads it, shuffles and sorts, writes again.</li><li>Reads it again for Reduce, then writes final output.</li></ul><p>That’s three full passes involving disk I/O for a problem that could be handled end‑to‑end in memory on each worker. Multiply this by terabytes of data, and you see why MapReduce feels glacial compared to modern engines.</p><h3>3. MapReduce Limitations: Disk Writes and a Rigid Model</h3><p>The MapReduce’s weaknesses in two main points.</p><ol><li><strong>Repeated disk I/O between stages</strong><br>Every intermediate result is flushed to HDFS and read back later. This doesn’t just add latency; it also stresses the I/O subsystem and can create long tails in job completion times.</li><li><strong>Rigid two-step programming model (Map + Reduce)</strong><br>Complex pipelines — filters, joins, multiple aggregations — must be broken into multiple MapReduce jobs, each with its own Map, Shuffle, and Reduce. That means more jobs to orchestrate, more intermediate data, and more opportunities for performance problems.</li></ol><p>This combination made MapReduce reliable but not agile. As data engineering workloads evolved toward richer pipelines and iterative analytics, the industry needed something more flexible and memory‑aware.​</p><h3>4. How Spark Fixed MapReduce: In-Memory Execution</h3><p>Spark’s first big innovation was straightforward but transformative: <strong>keep intermediate data in memory as much as possible.</strong></p><p>Instead of writing intermediate results to disk after each step, Spark allows data to:</p><ul><li>Stay in RAM across transformations.</li><li>Be cached across stages and reused without hitting disk.</li></ul><p>In the same word-count scenario, Spark can transform and aggregate in memory across the cluster, only writing final results out to disk. This drastically reduces disk I/O and network overhead, which is why many workloads see <strong>10x–100x speedups compared to equivalent MapReduce jobs.</strong>​</p><p>The key idea is that memory, not disk, becomes the default place for intermediate computation. Disk is used when needed — for persistence, fault tolerance, or when data doesn’t fit — but not as a compulsory boundary between every operation.​</p><h3>5. Spark’s DAG Model: From Map/Reduce to a Rich Execution Graph</h3><p>Spark’s second big innovation is its <strong>DAG (Directed Acyclic Graph) execution model.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*WSdyx7x7gfQUDxLx.jpg" /><figcaption>DAG visualization in spark</figcaption></figure><p>Instead of forcing every pipeline into “Map, then Reduce,” Spark:</p><ul><li>Lets you define a rich sequence of <strong>transformations</strong> (like map, filter, select, withColumn, groupBy, join).​</li><li>Only triggers execution when you call an <strong>action</strong> (like count, show, collect, or write).</li><li>Builds an internal <strong>DAG</strong> out of these steps, representing how data flows from source to results.</li></ul><p>Here’s what that DAG looks like in practice:</p><p>The DAG is then broken down into:</p><ul><li><strong>Jobs</strong> — one per action.​</li><li><strong>Stages</strong> — segments of work separated by shuffles (wide transformations).</li><li><strong>Tasks</strong> — the smallest units of work, each operating on a single partition on an executor.</li></ul><p>The full jobs/stages/tasks hierarchy in Spark looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iJh9_7xijsc5shYX.jpg" /><figcaption>Application → Jobs → Stages → Tasks → Partitions</figcaption></figure><p>This model gives Spark several advantages over MapReduce:</p><ul><li>It can <strong>see the whole pipeline at once</strong>, not just one Map–Reduce pair at a time.​</li><li>It can apply optimizations across the entire graph (e.g., pushing filters closer to data sources, collapsing operations).</li><li>It supports many more operators than just Map and Reduce, making complex analytics feel natural instead of forced.​</li></ul><h3>6. The Big Picture: From Painful Disk Trips to Optimized Graphs in Memory</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*Qqkj-OZuk2DfEwlGCHXAkA.png" /><figcaption>Putting it all together</figcaption></figure><p><strong>MapReduce</strong></p><ul><li>Writes intermediate data to disk after each phase.</li><li>Forces logic into repeated Map–Shuffle–Reduce chains.</li><li>Suffers from slow disk I/O and rigid composition.​</li></ul><p><strong>Spark</strong></p><ul><li>Keeps intermediate data in memory whenever possible.​</li><li>Represents your computation as a <strong>DAG of transformations and actions</strong>, then splits it into jobs, stages, and tasks.</li><li>Optimizes the whole graph, reducing redundant work and minimizing expensive shuffles and disk writes.​</li></ul><p>Once you see this contrast, Spark’s speed isn’t mysterious anymore — it’s the natural result of a different design philosophy: <strong>treat memory as the default, treat disk as a fallback, and understand the entire computation as a graph instead of a single Map/Reduce pair.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83b4d7d5e926" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Delta Lake Revolution: Why Your Data Lake Needs an Upgrade]]></title>
            <link>https://medium.com/@harshithnp.96/the-delta-lake-revolution-why-your-data-lake-needs-an-upgrade-e7690e1d5f2a?source=rss-7c47c9bcf130------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7690e1d5f2a</guid>
            <category><![CDATA[delta-lake]]></category>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[databricks]]></category>
            <dc:creator><![CDATA[Harshithnp ]]></dc:creator>
            <pubDate>Thu, 02 Oct 2025 12:16:04 GMT</pubDate>
            <atom:updated>2025-10-02T12:16:04.507Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Transforming unreliable data swamps into reliable, ACID-compliant lakehouses</em></p><p>The modern data landscape is experiencing a revolution. As organisations grapple with exponentially growing data volumes from IoT devices, social media, transactional systems, and real-time applications, traditional data management approaches are showing their limitations. Enter Delta Lake — an open-source storage framework that’s fundamentally changing how we think about data lakes and setting the foundation for the next generation of data architectures.</p><h3>The Problem with Traditional Data Lakes</h3><p>Data lakes promised to solve the scalability challenges of data warehouses by providing a centralised repository for vast amounts of raw data in their native format. Unlike traditional databases, data lakes could handle structured, semi-structured, and unstructured data at internet scale. However, this flexibility came with a significant cost: reliability.</p><p>Traditional data lakes follow the BASE model (Basically Available, Soft-state, Eventually consistent), which means they lack the ACID (Atomicity, Consistency, Isolation, Durability) guarantees that databases provide. This fundamental limitation creates several critical challenges:</p><h3>The Data Swamp Problem</h3><p>Without proper data management features, many data lakes devolve into “data swamps” — repositories filled with inconsistent, corrupted, and unreliable data. Processing failures leave behind orphaned files, partial writes create inconsistent states, and concurrent operations can lead to data corruption.</p><h3>Performance and Reliability Issues</h3><ul><li>Inconsistent query results due to partial file writes during failures.</li><li>Slow query performance from a lack of optimisation features.</li><li>Complex data pipeline maintenance to handle failure scenarios.</li><li>No schema enforcement, leading to data quality issues.</li></ul><h3>What is Delta Lake?</h3><p>Delta Lake is an open-source storage layer that brings ACID transactions, scalable metadata handling, and unified streaming and batch data processing to data lakes. Originally developed at Databricks and later donated to the Linux Foundation, Delta Lake transforms traditional data lakes into reliable, high-performance lakehouse architectures.</p><p>At its core, Delta Lake stores data in Apache Parquet format while maintaining a transaction log that serves as the single source of truth for all table operations. This elegant design provides database-like reliability while preserving the scalability and cost-effectiveness of data lakes.</p><h3>The Delta Lake Architecture</h3><h3>Transaction Log: The Heart of Delta Lake</h3><p>The transaction log (also called the Delta log) is what makes Delta Lake special. It’s an ordered record of every transaction performed on a Delta table, stored as JSON files in a _delta_log directory. Each transaction creates a new numbered JSON file (000000000000.json, 000000000001.json, etc.), ensuring:</p><ul><li>Atomicity: Operations either fully complete or fully fail</li><li>Consistency: Schema enforcement and constraint validation</li><li>Isolation: Concurrent operations don’t interfere with each other</li><li>Durability: Committed transactions are permanently recorded</li></ul><h3>Data Files and Metadata</h3><p>Delta Lake tables consist of:</p><ul><li>Data files: Stored in efficient Parquet format</li><li>Transaction log: JSON files recording all changes</li><li>Checkpoints: Periodic snapshots for faster recovery</li><li>Schema information: Enforced structure and evolution capabilities</li></ul><p>This architecture enables powerful features like time travel, where you can query historical versions of your data, and efficient incremental processing for streaming applications.</p><h3>Key Benefits of Delta Lake</h3><h3>1. ACID Transactions</h3><p>Unlike traditional data lakes, Delta Lake provides full ACID transaction support. If a cluster dies while writing 100 files, Delta Lake ensures no partial data is committed to the table — eliminating the corruption issues that plague traditional data lakes.</p><h3>2. Schema Enforcement and Evolution</h3><p>Delta Lake enforces schemas on write operations, preventing bad data from corrupting your tables. It also supports schema evolution, allowing you to add columns or change data types without breaking existing queries.</p><h3>3. Time Travel and Versioning</h3><p>Every change to a Delta table creates a new version. You can:</p><ul><li>Query historical data for auditing and compliance</li><li>Roll back to previous versions if issues arise</li><li>Compare data across different time points</li><li>Reproduce machine learning experiments with exact data snapshots</li></ul><h3>4. Unified Batch and Streaming</h3><p>Delta Lake was designed to work seamlessly with Apache Spark’s unified batch and streaming APIs. You can use the same business logic for both scenarios, with only latency differences.</p><h3>5. Performance Optimization</h3><p>Delta Lake includes several performance features:</p><ul><li>Data skipping: Uses file-level statistics to skip irrelevant files</li><li>Z-ordering: Co-locates related data for faster queries</li><li>Compaction: Optimizes small files into larger ones</li><li>Bloom filters: Efficient membership testing for faster lookups</li></ul><h3>6. DML Operations</h3><p>Delta Lake supports full DML (Data Manipulation Language) operations including INSERT, UPDATE, DELETE, and MERGE — capabilities traditionally reserved for databases.</p><h3>Real-World Impact</h3><p>The benefits of Delta Lake aren’t just theoretical. Companies are seeing dramatic improvements:</p><p>Comcast reduced their compute utilisation from 640 VMs to 64 VMs (10x reduction) and simplified maintenance from 84 jobs to just 3 jobs when processing smart remote control data using Delta Lake.</p><p>Apple uses Delta Lake for real-time threat detection, processing over 300 billion events daily and writing hundreds of terabytes of data with complete reliability.</p><h3>Common Use Cases</h3><p>Delta Lake excels in several scenarios:</p><h3>Modern Data Engineering</h3><ul><li>ETL/ELT pipelines with reliable data processing</li><li>Real-time analytics combining streaming and batch data</li><li>Data lake modernization adding ACID guarantees to existing lakes</li></ul><h3>Machine Learning and AI</h3><ul><li>Feature stores with consistent, versioned data</li><li>Model training with time travel for reproducibility</li><li>MLOps pipelines with reliable data lineage</li></ul><h3>Business Intelligence</h3><ul><li>Real-time dashboards with consistent data views</li><li>Regulatory compliance with audit trails and time travel</li><li>Data governance with schema enforcement and metadata management</li></ul><h3>The Lakehouse Architecture</h3><p>Delta Lake enables the lakehouse architecture — a paradigm that combines the best aspects of data lakes and data warehouses:</p><ul><li>Scalability of data lakes for massive datasets</li><li>Performance of data warehouses for analytics</li><li>ACID transactions for data reliability</li><li>Open standards for vendor independence</li><li>Unified platform for all data workloads</li></ul><p>This architecture eliminates the need for separate systems, reducing complexity, costs, and data movement while improving time-to-insight.</p><h3>Getting Started</h3><p>Delta Lake supports multiple languages and frameworks:</p><ul><li>Apache Spark (Scala, Python, SQL, Java, R)</li><li>Apache Flink via community connectors</li><li>Trino/Presto for federated queries</li><li>Python via delta-rs native bindings</li><li>Rust for high-performance applications</li></ul><p>The simplest way to start is to convert our existing Parquet data lake:</p><pre># Read existing Parquet data<br>df = spark.read.format(&quot;parquet&quot;).load(&quot;/path/to/parquet&quot;)<br><br># Write as Delta table<br>df.write.format(&quot;delta&quot;).save(&quot;/path/to/delta-table&quot;)</pre><h3>The Future of Data Architecture</h3><p>Delta Lake represents more than just a storage format — it’s a paradigm shift toward reliable, unified data architectures. As organizations increasingly rely on real-time analytics, machine learning, and AI, the reliability and performance guarantees that Delta Lake provides become essential.</p><p>The project continues to evolve with new features like:</p><ul><li>Delta Sharing for secure data collaboration</li><li>Delta UniForm for multi-format compatibility</li><li>Liquid Clustering for improved performance</li><li>Delta Kernel for easier integrations</li></ul><h3>Conclusion</h3><p>The days of choosing between the scalability of data lakes and the reliability of data warehouses are over. Delta Lake offers a compelling path forward — one that provides ACID transactions, performance optimization, and unified batch-streaming processing while maintaining the cost-effectiveness and scalability of cloud object storage.</p><p>Whether you’re modernizing existing data lakes, building new analytical platforms, or implementing machine learning pipelines, Delta Lake provides the reliability and performance guarantees that modern data architectures demand. The question isn’t whether you should adopt Delta Lake — it’s how quickly you can start transforming your data swamp into a reliable lakehouse.</p><p><em>Ready to upgrade your data lake? Explore Delta Lake’s open-source implementation and join the thousands of organizations already benefiting from reliable, high-performance data architectures</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7690e1d5f2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>