<?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 Ishita Virmani on Medium]]></title>
        <description><![CDATA[Stories by Ishita Virmani on Medium]]></description>
        <link>https://medium.com/@iamimperfect?source=rss-aa9492d2a963------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*KHGxyn7Ww8Pnmxm8.jpg</url>
            <title>Stories by Ishita Virmani on Medium</title>
            <link>https://medium.com/@iamimperfect?source=rss-aa9492d2a963------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 05:40:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iamimperfect/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[Still using Spark for Ad-hoc Queries?]]></title>
            <link>https://medium.com/naukri-engineering/still-using-spark-for-ad-hoc-queries-fffedb38c39b?source=rss-aa9492d2a963------2</link>
            <guid isPermaLink="false">https://medium.com/p/fffedb38c39b</guid>
            <category><![CDATA[prestosql]]></category>
            <category><![CDATA[trinos]]></category>
            <category><![CDATA[spark-vs-trino]]></category>
            <category><![CDATA[ad-hoc-analysis]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Ishita Virmani]]></dc:creator>
            <pubDate>Wed, 20 Aug 2025 06:03:39 GMT</pubDate>
            <atom:updated>2025-08-20T06:03:39.765Z</atom:updated>
            <content:encoded><![CDATA[<p>I have been using Spark for more than a decade now, since its initial release created a buzz in the distributed processing world. It has a lot to offer in transforming/ processing BIG data. But today, we will focus on a section of data analytics where Spark may not be a great fit — <strong>On-Demand Analysis</strong>. These are on-the-fly questions you run against your data to quickly find answers that aren’t covered by existing reports.</p><p>The following are some of Spark’s features that don’t offer a lot of value within ad-hoc querying:</p><ul><li>Spark ensures <strong>fault-tolerance</strong>, adding an overhead to computation. This isn’t needed for short-lived ad-hoc queries, since you can simply re-run the query.</li><li><strong>Staged execution model</strong> — Spark breaks a query into stages, each representing a logical unit of parallel computation. A stage can only start once all its dependent stages have fully completed. This “wait-for-all” approach results in sub-optimal resource utilization and longer query times.</li><li>Data exchange between stages in Spark is a 2-step process: <strong>write-to-local-disk</strong>, and data transfer over the network.</li><li><strong>Startup time is longer </strong>— Unless you are using a long-lived Spark session, each Spark query/ job negotiates for resources with the cluster manager, followed by starting JVM processes on the allocated resources. This can take seconds to tens of seconds.</li></ul><p>Let&#39;s look at another open-source technology that was built with a primary focus on “<strong>Faster interactive querying</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4luEED9d4nfuVko02yIECQ.png" /></figure><h3>Trino</h3><p>Trino (formerly known as <strong>PrestoSQL</strong>) has gained significant traction within the data community over the past couple of years since it became <strong>open-sourced</strong>. Its history is tied to the <strong>Presto </strong>project developed<strong> at Facebook.</strong> It is, in fact, the backbone of <strong>AWS Athena</strong>, which, if you must know, charges based on the data scan size.</p><p>It provides a fast lane to data insights. But how?</p><p>Let&#39;s look at some of its significant features that make it faster than Spark for Ad-hoc querying.</p><ul><li><strong>Performance over resilience</strong> — Trino sacrifices fault-tolerance for reduced computation time.</li><li><strong>Trino’s MPP (Massively Parallel Processing) engine utilizes a pipeline execution model — s</strong>tages process data concurrently rather than waiting for the previous stage to fully complete (with blocking only in cases of final aggregations). As soon as a task produces output, it streams it to the downstream stage for immediate processing, maximizing resource utilization. “Why should any node sit idle when there is a lot to be done, right?”.</li><li><strong>100% in-memory processing</strong> — Data exchange between stages directly happens over the network, skipping the write-to-disk step. Data remains in memory until delivered to the subsequent node for further processing.</li><li>Trino workers are <strong>long-running JVM processes</strong>. As soon as a query comes in, the coordinator <strong>immediately assigns tasks</strong> to existing worker threads — no container requests or JVM startups</li><li>Trino is a lightweight framework, built specifically <strong>for SQL queries</strong>.</li><li>Trino’s architecture is specifically <strong>optimized</strong> for Parquet File formats (<strong>columnar-processing</strong>) and <strong>pushing down filters</strong> closer to the data source.</li></ul><h3>Spark vs Trino in Real-World Tests</h3><p>To benchmark performance, I executed a set of real-world sample queries — originally running on Spark — on a modest 3-node Trino cluster (4 cores, 26 GB RAM per node, JVM heap -Xmx 26GB). The Spark jobs, in comparison, were allocated a total of 8 cores and 16 GB RAM within the cluster.</p><p>The results were striking:</p><ul><li><strong>On average,</strong> Trino ran queries <strong>4× faster</strong> at ~<strong>1.23</strong> parallelism. For example, a query that took <strong>50 minutes</strong> on Spark completed in just <strong>13 minutes</strong> on Trino.</li><li><strong>At peak performance:</strong> When the Trino cluster was fully available (parallelism ~<strong>1.89</strong>), queries ran <strong>5× faster</strong> — a Spark query taking <strong>47 minutes</strong> finished in <strong>7 minutes 50 seconds</strong> on Trino.</li></ul><p>Note: a key difference here is in the execution model — Spark spins up dedicated JVM processes for each job, while Trino runs queries within the same JVM processes across the cluster. This means Trino’s per-query resource usage can only be observed in terms of query parallelism.</p><h3>Conclusion</h3><p>Does that mean the Spark era is over?</p><p>While Trino is quicker for ad-hoc querying, there is a limit to the amount of data that can be processed in memory. Spark is a better choice for longer batch processing jobs/ complex data manipulations, and building machine learning pipelines.</p><blockquote><strong><em>In today’s data world, we need both — Spark as a Transformation engine, and Trino as a query engine.</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fffedb38c39b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/naukri-engineering/still-using-spark-for-ad-hoc-queries-fffedb38c39b">Still using Spark for Ad-hoc Queries?</a> was originally published in <a href="https://medium.com/naukri-engineering">Naukri Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build highly scalable Data Persistence Pipeline with AWS S3 Sink Connector]]></title>
            <link>https://medium.com/naukri-engineering/how-to-build-highly-scalable-data-persistence-pipeline-with-aws-s3-sink-connector-1d88c4f02930?source=rss-aa9492d2a963------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d88c4f02930</guid>
            <category><![CDATA[kafka-to-s3]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-persistence]]></category>
            <dc:creator><![CDATA[Ishita Virmani]]></dc:creator>
            <pubDate>Wed, 28 Feb 2024 07:37:49 GMT</pubDate>
            <atom:updated>2024-02-28T07:37:49.681Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>Naukri.com has millions of active job-seekers per day, generating billions of events across platforms. As part of the Data Engineering team handling data of multiple such sites under Info Edge umbrella, one of many challenges is to make this data available on persistent storage as quickly as possible to cater to near-realtime use cases.</p><p>In our case, we use AWS S3 as the persistent storage, and the data is sitting within ~2500 Kafka topics, waiting to be persisted.</p><p><strong>Traditional Approach</strong></p><p>Our initial strategy entailed executing a Spark job, wherein a Kafka consumer sequentially subscribed to each of these topics, followed by data polling and writing to the S3. To achieve parallelism, we grouped Kafka topics into logical clusters, allowing us to run a single Spark job for each group.</p><p>Quite straightforward, isn’t it? But the simplicity comes at a cost — a single job used to run for more than 4 hours to persist ~350 Kafka topics with an average of 3M records/ topic. Moreover, there was significant overhead of managing multiple such long-running jobs.</p><p><strong>Efficient &amp; Effective Approach</strong></p><p>Out came the <strong>Kafka S3 sink connector </strong>to our rescue!</p><p>The most important feature that makes AWS S3 Sink connector “The Catch” is its ability to efficiently upload objects to S3 through AWS multipart uploads. It continuously uploads the smaller chunks of objects as parts to S3. The completion of multipart upload, as well as committing Kafka offset back happens only once the number of records has reached <em>flush.size </em>configuration value. This ensures improved throughput as well as resilience.</p><p>Is that it?</p><p>The Kafka S3 Connector is just one of the components within our Persistence Pipeline. In the next section, we’ll look at the entire process of persistence.</p><p><strong>Optimized Persistence Pipeline</strong></p><p>Here are some of the reasons contributing to the need for an entire persistence pipeline, which we call “Optimized Persistence Pipeline” —</p><ol><li>Files written by the sink connector cannot be directly read via Spark or any other distributed computing framework, as these are too small to give us optimal read time.</li><li>Moreover, we have many ETL jobs scheduled to run daily, for which we need to identify if the respective event’s data for yesterday is available.</li><li>We also have a couple of derived columns that need to be included along with.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*_4kAwsUCh7nCfWuIE-J3bg.png" /></figure><p>We perform the following set of tasks —</p><p>Once all partitions data of Kafka topic have been written onto the S3 interim store for yesterday, the listener tags the same in meta.</p><ol><li>Basis the records in meta, spark job performs compaction/ transformations, and writes to the final S3 store, subsequently tagging the event within meta to be Available. This final S3 store is used to read all the data.</li></ol><p><strong>Conclusion</strong></p><p>With the usage of optimized persistence pipeline, most of the data is persisted by 1 a.m., allowing all our ETL jobs to run during the night itself. Moreover, since the data is available on the interim S3 store almost instantly, we could empower near-real-time use cases (for smaller datasets) as well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d88c4f02930" width="1" height="1" alt=""><hr><p><a href="https://medium.com/naukri-engineering/how-to-build-highly-scalable-data-persistence-pipeline-with-aws-s3-sink-connector-1d88c4f02930">How to build highly scalable Data Persistence Pipeline with AWS S3 Sink Connector</a> was originally published in <a href="https://medium.com/naukri-engineering">Naukri Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>