<?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 Bharath Reddy GATTU on Medium]]></title>
        <description><![CDATA[Stories by Bharath Reddy GATTU on Medium]]></description>
        <link>https://medium.com/@bharathnextbit?source=rss-d84b96873119------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*nRDcuky9MvRSeNoD.jpg</url>
            <title>Stories by Bharath Reddy GATTU on Medium</title>
            <link>https://medium.com/@bharathnextbit?source=rss-d84b96873119------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 00:54:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bharathnextbit/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[Ray vs Apache Spark on Databricks: 5 Unique Differences That Matter]]></title>
            <link>https://medium.com/@bharathnextbit/ray-vs-apache-spark-on-databricks-5-unique-differences-that-matter-37e5770e0806?source=rss-d84b96873119------2</link>
            <guid isPermaLink="false">https://medium.com/p/37e5770e0806</guid>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[ray-vs-saprk]]></category>
            <category><![CDATA[rays]]></category>
            <dc:creator><![CDATA[Bharath Reddy GATTU]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 03:54:16 GMT</pubDate>
            <atom:updated>2026-11-23T03:54:16.877Z</atom:updated>
            <content:encoded><![CDATA[<p>As organizations push beyond traditional ETL and analytics into AI, machine learning, and large-scale Python workloads, the conversation is shifting from <strong>Apache Spark</strong> to <strong>Ray</strong>. While both are distributed computing frameworks, they were designed for fundamentally different purposes. Understanding these differences is critical for architects and data engineers working in the Databricks ecosystem.</p><h3>1. Spark is Data-Centric; Ray is Application-Centric</h3><h3>Apache Spark</h3><p>Spark was built primarily for <strong>distributed data processing</strong>. Its core abstraction is the DataFrame and the execution engine is optimized for transforming large datasets efficiently.</p><p>Typical Spark workloads:</p><ul><li>ETL pipelines</li><li>Data warehousing</li><li>Batch analytics</li><li>Streaming analytics</li><li>SQL transformations</li></ul><h3>Ray</h3><p>Ray was designed for <strong>distributed applications</strong>, not just data processing. It enables developers to scale Python functions, actors, and AI workloads across clusters.</p><p>Typical Ray workloads:</p><ul><li>Distributed model training</li><li>Hyperparameter tuning</li><li>Reinforcement learning</li><li>LLM inference</li><li>Multi-agent systems</li></ul><p><strong>Unique Difference:</strong><br> Spark asks: <em>“How do I process this dataset?”</em><br> Ray asks: <em>“How do I scale this application?”</em></p><h3>2. Spark Uses DAG-Based Batch Execution; Ray Uses Dynamic Task Scheduling</h3><h3>Spark</h3><p>Spark constructs a Directed Acyclic Graph (DAG) before execution.</p><p>Advantages:</p><ul><li>Strong optimization</li><li>Query planning</li><li>Adaptive execution</li><li>Efficient shuffles</li></ul><p>Limitation:</p><ul><li>Less flexible for highly dynamic workflows.</li></ul><h3>Ray</h3><p>Ray schedules tasks dynamically in real time.</p><p>Advantages:</p><ul><li>Recursive tasks</li><li>Actor-based programming</li><li>Dynamic workloads</li><li>Complex AI orchestration</li></ul><p>Example: A multi-agent AI system where one model calls another model and dynamically creates new tasks is much easier in Ray.</p><p><strong>Unique Difference:</strong><br> Spark excels when work can be planned ahead.<br> Ray excels when work changes while running.</p><h3>3. Spark Optimizes Data Movement; Ray Optimizes Python Execution</h3><h3>Spark</h3><p>Spark’s Catalyst Optimizer and Tungsten Engine focus on:</p><ul><li>Data partitioning</li><li>Shuffle optimization</li><li>Predicate pushdown</li><li>Query optimization</li></ul><p>This makes Spark incredibly efficient for processing petabytes of structured data.</p><h3>Ray</h3><p>Ray focuses on:</p><ul><li>Native Python execution</li><li>Distributed object store</li><li>Function parallelization</li><li>Actor lifecycle management</li></ul><p>Organizations often struggle with Python scalability in Spark due to serialization overhead.</p><p>Ray was designed specifically to make Python a first-class citizen.</p><p><strong>Unique Difference:</strong><br> Spark optimizes data pipelines.<br> Ray optimizes Python workloads.</p><h3>4. Spark Dominates Data Engineering; Ray Dominates AI Workloads</h3><h3>Spark Strengths on Databricks</h3><ul><li>Delta Lake processing</li><li>Batch ETL</li><li>Medallion architecture</li><li>Data warehousing</li><li>Structured Streaming</li></ul><h3>Ray Strengths on Databricks</h3><ul><li>LLM training</li><li>Model serving</li><li>Distributed inference</li><li>Reinforcement learning</li><li>Hyperparameter optimization</li></ul><p>For example:</p><p>WorkloadBetter ChoiceSales aggregationSparkDelta Lake transformationsSparkFeature engineeringSparkTraining hundreds of ML modelsRayLLM fine-tuningRayAI AgentsRay</p><p><strong>Unique Difference:</strong><br> Spark powers the data platform.<br> Ray powers the AI platform.</p><h3>5. Spark’s Unit of Scale is Data; Ray’s Unit of Scale is Compute</h3><h3>Spark</h3><p>Scaling is driven by:</p><ul><li>Partitions</li><li>Executors</li><li>Data volume</li></ul><p>The framework naturally scales as datasets grow.</p><h3>Ray</h3><p>Scaling is driven by:</p><ul><li>Tasks</li><li>Actors</li><li>GPUs</li><li>CPUs</li></ul><p>Ray is particularly powerful when GPU scheduling becomes important.</p><p>Example:</p><ul><li>Training a 70B parameter LLM</li><li>Running distributed PyTorch jobs</li><li>Deploying inference across hundreds of GPUs</li></ul><p>These scenarios align naturally with Ray’s architecture.</p><p><strong>Unique Difference:</strong><br> Spark scales datasets.<br> Ray scales compute-intensive applications.</p><h3>The Databricks Perspective</h3><p>The most successful Databricks customers increasingly use <strong>both technologies together</strong>:</p><h3>Spark Handles</h3><p>Delta Lake<br>ETL Pipelines<br>Data Quality<br>Data Engineering<br>SQL Analytics</p><h3>Ray Handles</h3><p>LLM Training<br> Distributed Python<br> AI Agents<br> Hyperparameter Search<br> Real-Time AI Serving</p><p>A common architecture looks like this:</p><p>Plain Text</p><p>Bronze/Silver/Gold Data ↓</p><p>Spark ↓</p><p>Feature Engineering ↓</p><p>Delta Lake ↓</p><p>Ray ↓</p><p>Training / Fine-Tuning / Inference ↓</p><p>AI Applications</p><h3>Executive Summary</h3><p>The single biggest misconception is that <strong>Ray is a Spark replacement</strong>.</p><p>It is not.</p><p>The reality is:</p><ol><li><strong>Spark is the best choice for large-scale data processing.</strong></li><li><strong>Ray is the best choice for distributed AI and Python applications.</strong></li><li><strong>Databricks is increasingly enabling both to coexist.</strong></li><li><strong>Spark owns the data layer; Ray owns the AI execution layer.</strong></li><li><strong>The future architecture of enterprise AI is Spark + Ray, not Spark vs Ray.</strong></li></ol><p>For data engineering, Spark remains the king. For GenAI, LLMs, AI agents, and distributed Python workloads, Ray provides capabilities that Spark was never originally designed to handle.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37e5770e0806" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>