<?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 Sai Harsha Vellanki on Medium]]></title>
        <description><![CDATA[Stories by Sai Harsha Vellanki on Medium]]></description>
        <link>https://medium.com/@saiharshavellanki?source=rss-c03f971cec37------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yD2C-E0nUSS5uly_tOWrBw.jpeg</url>
            <title>Stories by Sai Harsha Vellanki on Medium</title>
            <link>https://medium.com/@saiharshavellanki?source=rss-c03f971cec37------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 04:49:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saiharshavellanki/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[Taming Out-of-Order Data: How Watermarking Powers Real-Time Stream Processing]]></title>
            <link>https://medium.com/@saiharshavellanki/taming-out-of-order-data-how-watermarking-powers-real-time-stream-processing-1cab753de71d?source=rss-c03f971cec37------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cab753de71d</guid>
            <category><![CDATA[deduplication]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[watermarking]]></category>
            <category><![CDATA[stream-processing]]></category>
            <dc:creator><![CDATA[Sai Harsha Vellanki]]></dc:creator>
            <pubDate>Sun, 01 Dec 2024 18:48:45 GMT</pubDate>
            <atom:updated>2024-12-01T18:48:45.770Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><p>Imagine a ride-hailing app that processes millions of events every second — like trip requests, driver status updates, and payments. These events often don’t arrive in perfect order. For instance, a driver’s status update might be delayed due to poor network connectivity, arriving seconds after a trip request it should have preceded.</p><p>In this scenario, the system must decide when it has enough data to calculate metrics like the average trip completion time or to trigger real-time notifications without waiting indefinitely for delayed events. Waiting too long can cause performance bottlenecks, while processing data prematurely can lead to inaccurate results.</p><p>This is where <strong>watermarking</strong> becomes invaluable. By defining a point in time where the system assumes all earlier events have arrived, watermarking allows the app to process data efficiently, handling out-of-order events gracefully while ensuring real-time responsiveness.</p><p>In this blog post, we’ll dive into the concept of watermarking and explore how it helps solve challenges like these, especially in operations like deduplication for streaming data.</p><h3>What is a Watermark?</h3><p>In stream processing, a <strong>watermark</strong> is a time-based marker that indicates how far a system has progressed in processing events relative to real-time. It represents a timestamp, ensuring that all events preceding it are processed. This means, no older events are expected to arrive.</p><p>Simply put, watermarks help manage the inherent uncertainty of event streams by dictating which events are “safe” to process and which can be ignored as late arrivals.</p><h3>How do Watermarks work?</h3><p>In streaming systems, data is often <strong>disordered</strong>, meaning events can arrive out of sequence. This disorder can arise from factors like network delays, queueing delays, or upstream systems forwarding data with inherent lags. As a result, <strong>events might not arrive in chronological order in real-time streams.</strong></p><p>We represent this level of disorderness with a variable d . This means that if we have an event E with a timestamp t, the maximum window we can look into the past is t-d for any event that might come in the wrong order after E .</p><p>By analyzing a dataset and as per our use cases, we estimate this <strong>disorder threshold (</strong><strong>d)</strong> in advance for a dataset. Once d is determined, we can safely discard the events which have not occurred in the t-dinterval. This value T-d, for the maximum timestamp T observed till now is known as the <strong>current</strong> <strong>watermark</strong> for that dataset.</p><p>Watermarks help determine when operations like deduplication and other transformations can proceed safely without worrying about late-arriving data.</p><p>Let’s look at a common use case below — removing duplicates from a stream of data in real time, and how watermarking can help us there.</p><h3>Real-Time Deduplication</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/0*1Fooct6NHeIVphT6" /><figcaption>Image Source: <a href="https://www.linkedin.com/pulse/data-deduplication-mustafa-qizilbash/">Link</a></figcaption></figure><p>Imagine you’re processing a stream of events flowing into a <a href="https://dattell.com/data-architecture-blog/what-is-a-kafka-topic/#:~:text=Kafka%20topics%20are%20the%20categories,consumers%20read%20data%20from%20topics.">Kafka topic</a>. Each event can be thought of as a tuple having a primary key, a timestamp and a bunch of other required values corresponding to it. Your goal is to remove duplicates in real time. However, duplicate events may not arrive sequentially because of disorder (d seconds).</p><p>For the sake of simplicity, let us assume that all events corresponding to the same primary key are sent to the same Kafka topic partition. This is usually a pre-requisite to building most solutions in real time processing.</p><p><strong>Simple Solution — In Memory Hashing</strong></p><p>As the most simple solution, we can maintain a hash-set to store all event tuples. This is ensured to keep only unique tuples. However, as the stream of events keeps on growing, we need to maintain an indefinitely large in-memory hash-set, which is unsustainable as the data volume grows.</p><p><strong>Watermarking to the rescue!</strong></p><p>Using a watermark, you can periodically prune old events from memory that are guaranteed not to arrive again. This drastically reduces the state size while ensuring accurate deduplication.</p><h4><strong>Algorithm</strong></h4><p>The deduplication begins by initializing an empty hash-set to store the observed events and setting the initial watermark as 0, indicating no events with timestamps &lt; 0 will arrive.</p><p>For each batch of events, we do the following:</p><ul><li>We first <strong>deduplicate</strong> events in the batch using the hash-set and send unique events downstream.</li><li>Then, we add the current batch events to the hash-set.</li><li>Then, we update the<strong> watermark </strong>as the (latest timestamp - disorder).</li><li>After this addition, we prune the hash-set by removing the events with timestamps older than the latest watermark.</li></ul><p>This process is carried continuously for each batch without causing memory problems as the hash-set is pruned in every iteration.</p><h3>Example Walkthrough</h3><p>Imagine the following events flow through the system for a specific Kafka partition:</p><ul><li><strong>Events with timestamps</strong>: (e1, 3), (e2, 1), (e1, 2), (e1, 3), (e2, 2), (e3, 4) (e1, 3), (e3, 5)</li><li><strong>Batch Size</strong>: 2 events per iteration</li><li><strong>Disorder (</strong><strong>d)</strong>: 2 seconds</li></ul><p>We begin with an empty hash-set and 0 as the initial watermark</p><h4>Iteration 0:</h4><ul><li><strong>Watermark</strong>: 0</li><li><strong>Current hash-set:</strong> {}</li><li><strong>Input batch</strong>: (e1, 3), (e2, 1)</li><li><strong>Expected result without duplicates</strong>: &lt;(e1, 3), (e2, 1)&gt;</li><li><strong>Addition of events to the hash-set</strong>: {(e1, 3), (e2, 1)}</li><li><strong>Watermark update</strong>: (3 - 2) = 1 (since maximum timestamp = 3)</li><li>There is no pruning of hash-set since there are no events older than the current watermark = 1</li></ul><h4>Iteration 1:</h4><ul><li><strong>Watermark</strong>: 1</li><li><strong>Hash-set: </strong>{(e1, 3), (e2, 1)}</li><li><strong>Input batch</strong>: (e1, 2), (e1, 3)</li><li><strong>Expected result</strong>: &lt;(e1, 2)&gt; (Duplicate (e1, 3) discarded)</li><li><strong>Addition of events to hash-set: </strong>{(e1, 3), (e2, 1), (e1, 2)}</li><li><strong>Watermark update</strong>: (3 - 2) = 1 (since maximum timestamp = 3)</li><li>There is no pruning of hash-set since there are no events older than the current watermark = 1</li></ul><h4>Iteration 2:</h4><ul><li><strong>Watermark</strong>: 1</li><li><strong>Hash-set: </strong>{(e1, 3), (e2, 1), (e1, 2)}</li><li><strong>Input batch</strong>: (e2, 2), (e3, 4)</li><li><strong>Expected result</strong>: &lt;(e2, 2), (e3, 4)&gt; (No duplicates observed)</li><li><strong>Addition of events to hash-set: </strong>{(e1, 3), (e2, 1), (e1, 2),(e2, 2), (e3, 4)}</li><li><strong>Watermark update</strong>: (4 - 2) = 2 (since maximum timestamp = 4)</li><li>We remove (e2, 1) from the hash-set since its timestamp is less than current watermark = 2</li></ul><h4>Iteration 3:</h4><ul><li><strong>Watermark</strong>: 2</li><li><strong>Hash-set</strong>: {(e1, 3), (e1, 2), (e2, 2), (e3, 4)}</li><li><strong>Input batch</strong>: (e1, 3), (e3, 5)</li><li><strong>Expected result</strong>: &lt;(e3, 5)&gt; (Duplicate (e1, 3) discarded)</li><li><strong>Addition of events to hash-set: </strong>{(e1, 3), (e1, 2), (e2, 2), (e3, 4), (e3, 5)}</li><li><strong>Watermark update</strong>: (5 - 2) = 3 (since maximum timestamp = 5)</li><li>We remove (e1, 2), (e2, 2) events from hash-set since their timestamp is less than current watermark = 3</li></ul><p>This can keep happening for any number of iterations</p><h4>Events Older Than the Maximum Disorder: Late Arrivals</h4><p>What happens if an event with a timestamp earlier than the current watermark arrives? Although uncommon, such events are classified as <strong>late arrivals</strong>. To maintain system efficiency, these events are typically skipped. However, metrics can be collected to monitor and analyze their frequency, helping to identify potential issues in the upstream data pipeline.</p><h3>Conclusion</h3><p>Watermarking is a powerful tool for handling out-of-order data in stream processing. It enables efficient operations like deduplication by setting clear boundaries for processing events while reducing memory overhead. As real-time systems grow, mastering watermarking is essential for building scalable and reliable pipelines.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cab753de71d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Blazing-Fast Kafka Ingestion Pipeline in Rust with Protobuf]]></title>
            <link>https://medium.com/@saiharshavellanki/building-a-blazing-fast-kafka-ingestion-pipeline-in-rust-with-protobuf-1cdc2f768c5f?source=rss-c03f971cec37------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cdc2f768c5f</guid>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[confluent-schema-registry]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[data-ingestion]]></category>
            <category><![CDATA[protobuf]]></category>
            <dc:creator><![CDATA[Sai Harsha Vellanki]]></dc:creator>
            <pubDate>Sun, 13 Oct 2024 16:54:20 GMT</pubDate>
            <atom:updated>2024-10-13T16:54:20.931Z</atom:updated>
            <content:encoded><![CDATA[<h3>Prerequisites</h3><ul><li><a href="https://kafka.apache.org/"><strong>Kafka</strong></a>: A distributed event streaming platform used for building real-time data pipelines and applications. It enables high-throughput data exchange between producers (applications or services that send data) and consumers (applications or services that process data).</li><li><a href="https://protobuf.dev/overview/"><strong>Protobuf (Protocol Buffers)</strong></a>: A language-neutral and platform-neutral binary serialization format, commonly used for sending structured data over networks. Protobuf ensures efficient data encoding and decoding, making it suitable for high-performance systems.</li><li><strong>Schema Registry</strong>: A service for managing and storing schemas used by Kafka producers and consumers. The schema registry ensures that the structure of the data being sent (or produced) and received (or consumed) is well-defined and consistent. It helps avoid schema mismatches, as both the producer and consumer rely on the same schema stored in the registry. Common examples are <a href="https://docs.confluent.io/platform/current/schema-registry/index.html"><strong>Confluent Schema Registry</strong></a><strong> </strong>and<strong> </strong><a href="https://docs.aws.amazon.com/glue/latest/dg/schema-registry.html"><strong>AWS Glue Schema Registry</strong></a>.</li><li><a href="https://developer.confluent.io/courses/schema-registry/schema-subjects/"><strong>Subject Name Strategy</strong></a>: A technique used within schema registries to determine how schemas are identified for each Kafka topic. This strategy ensures that the right schema is associated with the right topic, allowing seamless encoding and decoding of data.</li></ul><p>In this post, we’ll dive into how we built a highly efficient streaming ingestion pipeline in Rust using Kafka and Protobuf-encoded data for <a href="https://fennel.ai/">Fennel AI</a>. We’ve built a system capable of ingesting 10,000 records in less than 500 milliseconds, all while decoding the data into a predefined schema. This level of performance is critical for real-time systems, where data needs to be processed quickly and accurately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o9veyzMTlXOW3G8dG21sNg.jpeg" /></figure><h3>How Kafka and Protobuf Work Together</h3><p>Before we dive into the details of our implementation, let’s clarify what it means to work with a Kafka source using Protobuf encoding. Essentially, Protobuf is used to serialize (or encode) structured data into bytes, which can then be sent to Kafka topics. Kafka topics act as channels where different applications can produce (write) and consume (read) streams of data.</p><p>In our case, we encode Rust data structures into Protobuf and store the schema (i.e., the blueprint of the data structure) in <strong>Confluent</strong> <strong>Schema Registry</strong>. The schema ensures that both the producer and consumer of the data are in agreement on the data format.</p><h3>How Encoding Works</h3><p>When encoding data in Rust, we start by converting a Rust struct into its Protobuf equivalent. This encoded data is then serialized into bytes, and the <a href="https://github.com/gklijs/schema_registry_converter/blob/v4.1.0/src/async_impl/proto_raw.rs#L51"><strong>ProtoEncoder</strong></a> further encodes it based on the schema stored in the registry.</p><p>Here’s a simplified overview of the encoding process:</p><ul><li>First, the Rust struct is transformed into Protobuf format.</li><li>Then, the <strong>ProtoEncoder</strong> adds a special 5-byte prefix to the serialized data: 1 byte set to 0, followed by a 4-byte schema ID. This schema ID is critical because it tells the consumer how to decode the data. We used <a href="https://github.com/gklijs/schema_registry_converter.git"><strong>schema_registry_converter</strong></a><strong> </strong>crate for this this purpose</li></ul><p>Here’s an example of how the Rust code for encoding might look:</p><pre>use schema_registry_converter::async_impl::proto_raw::ProtoRawEncoder;<br><br>let msg = SimpleMessage {<br>    int_field: 1,<br>    float_field: 1.1,<br>    boolean_field: true,<br>    string_field: &quot;sample_string&quot;.to_string(),<br>    bytes_field: Bytes::from(&quot;bytes_string&quot;),<br>    timestamp_field: &quot;2020-01-01T00:02:00Z&quot;.to_string(),<br>};<br><br>// This is proto generated struct<br>let msg_proto: crate::proto::protobuf_test::SimpleMessage = (&amp;msg).into();<br>let encoded_data = msg_proto.encode_to_vec();<br><br>let sr_settings = SrSettings::new();<br>let proto_encoder = ProtoRawEncoder::new(sr_settings.clone());<br>// Schema name in Confluent<br>let full_name = &quot;com.mycorp.mynamespace.MessageWithOneOfType&quot;;<br>let magic_bytes = proto_encoder<br>    .encode(<br>        &amp;encoded_data,<br>        full_name,<br>        SubjectNameStrategy::RecordNameStrategy(schema_name.to_string()),<br>    )<br>    .await<br>    .unwrap();</pre><p>The encoded “magic bytes” are then written to a Kafka topic. Once this data reaches the consumer side, it needs to be decoded using the same schema.</p><h3>Kafka Consumer and Protobuf Decoding</h3><p>For ingestion, we use the <a href="https://crates.io/crates/rdkafka">rdkafka</a> Rust crate to create a Kafka consumer that reads from the customer’s topic. Once the data is read into bytes, we decode it back into the given schema using <a href="https://github.com/gklijs/schema_registry_converter/blob/v4.1.0/src/async_impl/proto_decoder.rs#L78"><strong>ProtoDecoder</strong></a> from the schema_registry_converter crate.</p><h4>How Decoding Works</h4><p>The ProtoDecoder reads the first 5 bytes of the data, expecting the first byte to be 0. The next 4 bytes are the schema ID, which is then used to fetch the corresponding schema from the schema registry. After fetching the schema, the remaining data is decoded into an internal structure, <a href="https://github.com/gklijs/schema_registry_converter/blob/v4.1.0/src/async_impl/proto_decoder.rs#L153">DecodeResultWithContext</a>.</p><p>Here’s how the kafka ingestion logic looks like:</p><pre>use rdkafka::admin::AdminClient;<br>use schema_registry_converter::async_impl::proto_decoder::{DecodeResultWithContext, ProtoDecoder};<br><br>// Cache the proto decoders so that they can be used without any expiry<br>// Take the write lock only in the beginning when there is no entry<br>// Post that we take read lock to fetch the decoder. We can take multiple<br>// read locks in parallel<br>static PROTO_DECODERS = Arc&lt;RWLock&lt;SchemaRegistryUrl, ProtoDecoder&gt;&gt;;<br><br>// Create Kafka client with given config<br>client = AdminClient::from_config(&amp;admin_client_config);<br><br>// Create kafka consumer<br>let consumer: StreamConsumer = consumer_config.create()?;<br>// Susbcribe to the topic to start consuming the messages from the beginning<br>consumer.subscribe(&amp;[&amp;topic_str])<br><br>// Read 10k messages with timeout of 100ms<br>let mut num_msgs_read = 0;<br>let mut msgs_read = Vec::new();<br>let start = Instant::now();<br>while (msgs_read &lt; 10000) {<br>  // if we have elapsed the timeout, break<br>  if remaining.is_none() {<br>     break;<br>  }<br>  let remaining = timeout.checked_sub(loop_start.duration_since(Instant::now()));<br>  let msg = tokio::time::timeout(remaining_time, stream.next());<br>  num_msgs_read += 1;<br>  msgs_read.push(msg);<br>}<br><br>// Fetch proto decoder from cache<br>let proto_decoder = PROTO_DECODERS.get(&lt;schema_registry_url&gt;).read().await;<br>let mut decoded_msgs: Vec&lt;DecodeResultWithContext&gt; = Vec::new();<br>for msg in msgs_read {<br>  let decoded_msg = proto_decoder.decode_with_context(msg).await.unwrap();<br>  decoded_msgs.push(decoded_msg);<br>}<br><br>// Conversion from intermediate structure into your own Struct<br>// The logic would be similar to any other conversion library where <br>// we map the data to your schema</pre><h3>Let’s Look at the Numbers</h3><p>The time spent on each Kafka ingestion iteration breaks down into three parts:</p><ol><li><strong>Kafka client initialization</strong>: ~2 seconds</li><li><strong>Reading 10,000 messages</strong>: 100 ms</li><li><strong>Decoding the messages</strong>: ~1.5 seconds</li></ol><p>So, the total time for each iteration is approximately <strong>3.6 seconds</strong>. As we can see, a significant portion of this time is spent on initializing the Kafka client and decoding messages.</p><h3>Performance Considerations</h3><ul><li><strong>Initialization Overhead</strong>: Initializing the Kafka client for each pipeline iteration added a costly delay of 2 seconds. By caching or reusing the Kafka consumer across iterations, we were able to eliminate this overhead.</li><li><strong>Sync vs. Async Decoding</strong>: By adding metrics, we identified the main bottleneck in the decoding process. The sync module of the schema_registry_converter crate doesn’t cache schemas, leading to performance issues. Switching to the async module, which includes built-in caching, resolved this and significantly improved throughput.</li></ul><p>After applying these optimizations, we achieved a major reduction in latency, with P99 times now close to <strong>500 ms</strong> per ingestion iteration. However, there were some challenges we encountered along the way.</p><h3>Challenges and Considerations</h3><ul><li><strong>Decoding Map Types</strong>: The schema_registry_converter crate doesn’t natively support map types due to limitations in its underlying library, <a href="https://github.com/Rantanen/protofish"><strong>protofish</strong></a>. To address this, we forked both schema_registry_converter and protofish libraries, and added support for map types. A helpful <a href="https://github.com/Rantanen/protofish/issues/11">discussion</a> on GitHub guided us through the implementation.</li><li><strong>Removing Duplicate Imports in Protobuf Files</strong>: The crate also doesn’t handle situations where schema A imports schemas B and C, and both B and C share a common import, D. To resolve this, we replaced the Vec used for <a href="https://github.com/gklijs/schema_registry_converter/blob/v4.2.0/src/async_impl/proto_decoder.rs#L184">dependencies</a> with a HashMap to automatically remove duplicate imports.</li><li><strong>Field Names with Underscores</strong>: Protobuf messages with underscores in field names were problematic since the <strong>protofish</strong> <a href="https://github.com/Rantanen/protofish/blob/0.4.0/src/proto.pest#L10">parser</a> doesn’t support them. We added this functionality based on suggestions from a <a href="https://github.com/protocolbuffers/protobuf/issues/15899#issuecomment-1960100918">GitHub discussion</a>, allowing us to handle underscores in field names smoothly.</li></ul><p>Through these improvements and by implementing native support for key features ourselves, we’ve built a highly performant and scalable Kafka ingestion pipeline in Rust at Fennel. Our deep dive into the libraries, including forking and extending functionality where needed, has been critical in overcoming challenges.</p><p>Both <strong>schema_registry_converter</strong> and <strong>protofish</strong> are excellent libraries, and we hope to contribute back to them in the future to help grow the Rust community. We hope these insights and custom solutions will inspire or assist others working on similar real-time data processing systems. If any of this excites you, feel free to shoot me a DM on <a href="https://www.linkedin.com/in/sai-harsha-vellanki/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cdc2f768c5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering S3 File Processing: Optimizing I/O for Faster Downloads and Data Transformation (Part 2)]]></title>
            <link>https://medium.com/@saiharshavellanki/mastering-s3-file-processing-optimizing-i-o-for-faster-downloads-and-data-transformation-part-2-7a81eb1d0a9b?source=rss-c03f971cec37------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a81eb1d0a9b</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[parallel-processing]]></category>
            <dc:creator><![CDATA[Sai Harsha Vellanki]]></dc:creator>
            <pubDate>Sun, 06 Oct 2024 17:18:46 GMT</pubDate>
            <atom:updated>2024-10-06T17:18:46.353Z</atom:updated>
            <content:encoded><![CDATA[<p>In the <a href="https://medium.com/@saiharshavellanki/mastering-s3-file-processing-optimizing-i-o-for-faster-downloads-and-data-transformation-part-1-bd245f9d969c">previous part</a> of this series, we explored strategies to optimize I/O when working with multiple S3 files, focusing on improving performance before CPU processing kicks in. Now, in this second part, we’re going a step further — introducing a background parallel download service to streamline file fetching and eliminate I/O bottlenecks.</p><p>Think of it as a dedicated service running behind the scenes, managing S3 file downloads and making sure your application gets the data exactly when it needs it, without any I/O slowdowns.</p><p>The image below illustrates a high-level summary of the approach</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*pxOdLIDjhZfqUHyLyjMAVw.png" /></figure><h3>The Power of Background Parallel Downloads</h3><p>Imagine having a caching service, named S3Cache, which handles the background downloading of S3 files, ensuring they’re readily available when your main task requests them. The service operates with a memory limit (say, 300MB per dataset), allowing you to maintain control over resource usage.</p><p>Here’s how the S3Cache operates with three key functionalities:</p><ul><li><strong>Download</strong>: Downloads S3 files to disk using techniques we discussed in Part 1, and marks the file’s status as either <em>Downloading</em> or <em>Downloaded</em>.</li><li><strong>Get</strong>: Retrieves the file from the cache. If it’s already downloaded, it returns immediately. If still pending, it waits until the download completes. And if the file isn’t cached yet (perhaps due to memory constraints), it downloads it on demand and serves it</li><li><strong>Delete</strong>: Removes files from the cache, freeing up memory.</li></ul><h3>Inside the Caching Service</h3><p>At its core, the caching service uses the following structures:</p><ul><li><strong>Concurrent Hashmap</strong>: Maps the S3 file path to a structure containing the file status, the local file path and a notify mechanism for threads waiting on this file.</li><li><strong>Sender Channel</strong>: The main task pushes files to this channel when it identifies files that need to be downloaded.</li><li><strong>Delete Sender Channel</strong>: Files processed are sent to this channel for deletion from the cache once no longer needed.</li></ul><pre>use tokio::sync::{mpsc, Notify};<br><br>enum DownloadStatus {<br>    Downloaded,<br>    Downloading,<br>}<br><br>struct FileDownloadInfo {<br>    status: DownloadStatus,<br>    notify: Arc&lt;Notify&gt;,<br>    local_file_path: PathBuf,<br>}<br><br>pub struct S3Cache {<br>    files: Arc&lt;scc::HashMap&lt;String /*S3 file path*/, FileDownloadInfo&gt;&gt;, <br>    sender: mpsc::UnboundedSender&lt;String&gt;,<br>    delete_sender: mpsc::UnboundedSender&lt;String&gt;,<br>    identifier: String, //unique identifier for dataset<br>}</pre><h3>Background Download Worker</h3><p>We run a separate thread that continuously listens for files to download or delete, processing each request asynchronously to ensure nothing blocks the main thread. Here’s a sneak peek at the logic:</p><ul><li>Files are only downloaded when there’s enough free space.</li><li>The service waits for any tasks, fetches them from the Sender Channel, and downloads the files from S3, marking them as &quot;Downloaded&quot; and notifying any threads waiting on that file.</li><li>Deletion requests are handled similarly: files are deleted from both S3 and local storage, freeing up disk space.</li></ul><p>This asynchronous system ensures that CPU threads are never blocked by I/O operations, maximizing throughput. Let’s take a closer look at how this works:</p><pre>async fn downloader_task(<br>    mut receiver: mpsc::UnboundedReceiver&lt;String&gt;,      // Channel to receive download requests<br>    mut delete_receiver: mpsc::UnboundedReceiver&lt;String&gt;, // Channel for delete requests<br>    s3: Arc&lt;S3&gt;,       // S3 client to perform the download<br>    files: Arc&lt;scc::HashMap&lt;String, FileDownloadInfo&gt;&gt;, // Cached files<br>    identifier: String,   // Dataset identifier<br>    disk_limit: usize,    // Disk usage limit<br>) {<br>    let mut disk_used: i64 = 0;<br>    let mut size_map: HashMap&lt;String, i64&gt; = HashMap::new(); // Track file sizes<br>    let mut health_ticker = tokio::time::interval(Duration::from_secs(5));<br><br>    loop {<br>        tokio::select! {<br>            // Handle incoming download requests<br>            Some(file) = receiver.recv(), if disk_used &lt; (disk_limit as i64) =&gt; {<br>                if !files.contains_async(&amp;file).await {<br>                    log::error!(&quot;[{}] File not found in cache: {:?}&quot;, identifier, file);<br>                    continue;<br>                }<br>                <br>                let size = get_file_size(s3.clone(), &amp;file, disk_limit).await;<br>                size_map.insert(file.clone(), size);<br>                disk_used += size;<br><br>                //TODO: Perform the actual download from S3 to local path<br>                <br>                files.update_async(&amp;file, |_, entry| {<br>                    entry.status = DownloadStatus::Downloaded;<br>                    entry.notify.notify_waiters(); // Notify any waiting threads<br>                }).await.expect(&quot;Failed to update file download status&quot;);<br>            },<br><br>            // Handle file deletion requests<br>            Some(file) = delete_receiver.recv() =&gt; {<br>                if !files.contains_async(&amp;file).await {<br>                    log::error!(&quot;[{}] Invalid delete request for file: {:?}&quot;, identifier, file);<br>                    continue;<br>                }<br><br>                let file_entry = files.remove_async(&amp;file).await.unwrap().1;<br>                let size = size_map.remove(&amp;file).unwrap_or(0);<br>                disk_used -= size;<br><br>                // Delete the local file<br>                tokio::fs::remove_file(file_entry.local_file_path)<br>                    .await<br>                    .expect(&quot;Failed to delete file&quot;);<br>            },<br><br>            // Periodic health check<br>            _ = health_ticker.tick() =&gt; {<br>                log::info!(&quot;Health check&quot;);<br>            },<br><br>            // Stop when both channels are closed<br>            else =&gt; break,<br>        }<br>    }<br>}</pre><h3>Fetching Files from Cache</h3><p>Fetching files from the cache is straightforward. If a file is already cached and downloaded, it is returned immediately. If the file is still downloading, the task waits until the download is complete.</p><pre>fn fetch_cached_file(&amp;self, file: String //Remote S3 path) -&gt; Pin&lt;Box&lt;dyn Future&lt;Output = Result&lt;(Bytes, bool)&gt;&gt; + Send + &#39;_&gt;&gt; {<br>        Box::pin(async move {<br>            if !self.files.contains_async(&amp;file).await {<br>                log::error!(&quot;[{}] File not found in prefetch cache, directly fetching: {:?}&quot;, self.identifier, file);<br>                // Directly fetch the file and return since it not cached<br>                // Store the file in cache since it can be requested multiple times<br>                <br>                // TODO: Download the file<br>                data = s3.download(...)<br>                let entry = FileEntry {<br>                    local_file_path: local_path.clone(),<br>                    status: DownloadStatus::Downloaded,<br>                    notify: Arc::new(Notify::new()),<br>                };<br>                self.files.insert_async(file.clone(), entry).await.map_err(|_| {<br>                    anyhow!(&quot;Failed to insert file into cache: {:?}&quot;, file)<br>                })?;<br>                return Ok(data, false));<br>            }<br><br>            let file_entry = self.files.read_async(&amp;file, |_, v| v.clone()).await.unwrap();<br><br>            match file_entry.status {<br>                FileStatus::Downloaded =&gt; Ok((data, true)),<br>                FileStatus::Downloading =&gt; {<br>                    let res = timeout(Duration::from_secs(10), file_entry.notify.notified()).await;<br>                    if res.is_err() {<br>                        log::error!(&quot;Timeout while waiting for file to download: {:?}&quot;,file);<br>                        // Retry the operation, the file could be downloaded now.<br>                        return self.fetch_cached_file(file).await;<br>                    }<br>                    // Received the notification, the file should be downloaded now.<br>                    Ok((data, false))<br>                }<br>            }<br>        })<br>    }</pre><p><strong>Pros</strong></p><ul><li>No S3 Rate limiting since the files are downloaded serially</li><li>CPU thread is never blocked for I/O and I/O happens in parallel to CPU increasing the throughput</li></ul><h3>The Performance Boost: Real-World Gains</h3><p>Now, let’s talk numbers. Before optimizing our I/O, processing 10 files took around <strong>440 seconds</strong> — downloading each file individually and then processing them one by one. By introducing background downloads and caching, we reduced this time significantly:</p><ul><li><strong>Before Part 1</strong>: (8 seconds download + 3 seconds CPU processing) * 40 iterations = 440 seconds.</li><li><strong>With Part 1 Optimization</strong>: 12 seconds for batch download * 1 iteration + 6 seconds for processing * 40 iterations = 252 seconds.</li><li><strong>With Background Downloads</strong> (this post): <strong>120 seconds total</strong> — since downloads now happen in the background, the CPU is free to process files as soon as they arrive. So total time spent = 3 seconds for CPU processing * 40 iterations = 120 seconds</li></ul><p>This results in a <strong>3.6x improvement in throughput</strong>!</p><h3>Final Thoughts</h3><p>By separating I/O from CPU-bound tasks, we maximize the efficiency of both operations. The result is a system that downloads and processes files concurrently, leading to significant performance improvements. Since the majority of the time is now spent on CPU processing, we can further enhance performance by optimizing this stage — such as processing the data in parallel batches. This would enable even more efficient use of resources and reduce the overall processing time.</p><h4>References:</h4><ul><li><a href="https://docs.rs/tokio/latest/tokio/sync/struct.Notify.html">Tokio Notify</a></li><li><a href="https://doc.rust-lang.org/stable/std/sync/mpsc/fn.channel.html">Rust channels</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a81eb1d0a9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering S3 File Processing: Optimizing I/O for Faster Downloads and Data Transformation (Part 1)]]></title>
            <link>https://medium.com/@saiharshavellanki/mastering-s3-file-processing-optimizing-i-o-for-faster-downloads-and-data-transformation-part-1-bd245f9d969c?source=rss-c03f971cec37------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd245f9d969c</guid>
            <category><![CDATA[parallel-processing]]></category>
            <category><![CDATA[fault-tolerance]]></category>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[Sai Harsha Vellanki]]></dc:creator>
            <pubDate>Thu, 05 Sep 2024 19:24:30 GMT</pubDate>
            <atom:updated>2024-09-06T02:44:10.509Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><p>In this two-part series, we’ll explore strategies we developed at <a href="https://fennel.ai/">Fennel</a> to optimize I/O when downloading and processing multiple S3 files, making your systems more efficient and cost-effective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xPttQdqCuFvRfj-E.png" /><figcaption>Image Source: <a href="https://images.app.goo.gl/wh6sakFugrtb1agA8">Link</a></figcaption></figure><p>Imagine you have a task that requires downloading some data from S3 and transforming it into a specific format. Each file varies in size, but for simplicity, let’s assume an average file size of 30 MB containing around 100,000 rows (i.e., an average row size of around 315 bytes). Once processed, these rows are sent to Kafka, leveraging transactions to ensure <a href="https://youtu.be/WscozkoXLHM?feature=shared">exactly-once processing</a>.</p><p>However, there’s a limit on transaction sizes — say, 30,000 messages per transaction. Which means that processing each file will take 3–4 iterations to handle all the rows. The real bottleneck arises from downloading these S3 files <strong>one by one</strong>, slowing down the overall job and inflating costs due to repeated file downloads. Let’s break down how we can address these challenges.</p><h3>Initial Approach (V0): Sequential Downloads</h3><p>The simplest approach is to download each file from S3 in memory and process 30,000 messages at a time, storing the file’s name and offset in a persistent store. While this method is resilient to random crashes (because data stored in memory gets wiped after a crash), it suffers from inefficiency. Downloading the same file multiple times over increases both latency and S3 costs.</p><p><strong>Pros:</strong></p><ul><li>Resilience to crashes</li></ul><p><strong>Cons:</strong></p><ul><li>High latency and increased S3 costs due to redundant downloads</li></ul><h3>Optimised Approach (V1): Disk Caching</h3><p>In V1, we download the file once, cache it on disk, and reuse it for 3–4 iterations. <strong>This method reduces I/O time approximately by 4x</strong>, as the file is only downloaded once. This cuts down the S3 costs. However, we now have the added complexity of cleaning up cached files once they’re processed.</p><p><strong>The risk with this approach is that if the system crashes after a file has been processed and deleted, but before the task completes, it leads to an incomplete run.</strong> This necessitates a re-download.</p><p>To address this, we propose storing file paths in a persistent store and deferring deletion to the start of the next iteration, ensuring smoother operation even if a crash occurs. For the sake of simplicity, we can adopt immediate deletion assuming such crashes occur rarely.</p><p><strong>Pros:</strong></p><ul><li>Reduced I/O time</li><li>Reduced S3 costs</li></ul><p><strong>Cons:</strong></p><ul><li>Additional file management complexity</li></ul><h3>Further Optimizations (V2): Parallel Downloads &amp; Batch Caching</h3><p>To further improve performance, V2 involves downloading multiple files (say 5–10) in parallel and caching them on disk. This approach not only leverages parallelism to speed up the download process, but also allows the cached files to be used for many iterations (up to 30–40 times, depending on the batch size).</p><p><strong>How to Decide Cache Size:</strong> For example, if we allocate 300 MB for each dataset and each file is 30 MB, we can cache up to 10 files per dataset. With customers having around 10–20 datasets, this results in a cache size of 3–6 GB. This is a reasonable size, provided we clean up the data after use. One challenge here is ensuring that the files are fully downloaded even in the event of crashes.</p><h3>Handling Crashes and Partial Downloads</h3><p>When downloading files, system crashes can lead to incomplete files being cached. One way to mitigate this is to use temporary files. These files reside in the /tmp directory and are cleaned up during the time of system restart. Here’s how this might look in Rust:</p><pre>async download_locally() -&gt; Result&lt;()&gt; {<br>  let s3_path = &quot;s3://&lt;bucket&gt;/file&quot;;<br>  <br>  // Use S3 file path so that it is easy to identify the location of file on disk<br>  let local_path = &quot;/tmp/{s3_path}&quot; <br>  <br>  // Initialise reader stream to read data in chunks and write each chunk to destination<br>  let mut stream = self.store.get(&amp;s3_path).await?.into_stream();<br>  let mut writer = tokio::fs::File::create(local_path).await?;<br>  while let Some(bytes) = stream.try_next().await? {<br>        writer.write_all(&amp;bytes).await?;<br>  }<br>  <br>  // Return Ok as response denoting the file has been downloaded successfully<br>  Ok(())<br>}</pre><h3><strong>Beware of the Hidden Bug</strong></h3><p>A subtle yet critical bug in file-writing arises from how data moves between memory and disk. When writing data, it first resides in application memory and later gets flushed to the OS page cache. However, it is not immediately written to the disk, meaning that if the system crashes before the flush occurs, data can be lost.</p><p>Here’s how the process works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*ElV_tByLpjfn-gi6D4i1HQ.png" /></figure><ol><li><strong>Writing to Application Memory:</strong> When you write data, it is first stored in application memory, and not directly on the disk.</li><li><strong>Flush to OS Page Cache:</strong> Periodically, the OS moves this data to the page cache (still in memory), but it’s not yet on disk.</li><li><strong>Writing to Disk:</strong> Eventually, the data is written to disk, triggered by certain thresholds (size, time, or memory pressure).</li></ol><p><strong>Impact on Readers:</strong> When reading a file, the OS will provide data from both the page cache and disk. However, any data still in application memory isn’t visible to readers, meaning you could encounter incomplete reads if data hasn’t been flushed properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*-xvKRolkkyUwipvxjiCm3A.png" /></figure><p><strong>This is why, to ensure that the data is fully written and safe for readers, it’s essential to flush or close the file explicitly.</strong></p><p>Calling writer.flush() forces the OS to write all buffered data to disk, but a more reliable approach is using writer.close(). Closing the file not only flushes the data but also finalizes the file, ensuring that all write operations are completed properly.</p><p>Here is how a sample flush operation looks like in Rust:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H8CbI5IlUUSlOmuNrO94JA.png" /></figure><h3>What If Row Sizes Vary?</h3><p>Till now, we’ve assumed an average row size of 315 bytes, but what happens if the row size increases to, say, 1 KB? This would drastically reduce our throughput to about one-third of the original performance, since larger rows mean fewer files can be cached at a time.</p><p>The obvious solution might be to increase the cache size, but this comes with a caveat. The /tmp directory we’re using for temporary files is technically known as <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/"><strong><em>ephemeral storage</em></strong></a>, and it has certain size limits. Exceeding these limits triggers disk pressure on the node, leading Kubernetes to evict the workload, which would severely disrupt the system.</p><p><strong>Instead of increasing the ephemeral storage, a better approach is to download the files to disk and handle their deletion manually.</strong> This gives us more control over storage usage while still safeguarding against random crashes during downloads.</p><h3>Avoiding Partial Downloads</h3><p>One common issue when downloading files is the risk of partial downloads, especially in the event of a crash. Using a checksum to verify file integrity might seem like a good solution, but there’s an even more efficient approach.</p><p>First, we download the file into a temporary location, and then use a rename operation to move the file to its final destination once the download is complete. This ensures atomicity, which means that either the entire file is available or none of it is, eliminating the possibility of partial downloads.</p><p>In Rust, this rename operation is called persist, which makes sure that the temporary file is safely and atomically renamed, and that the final file is complete and ready to use.</p><p>Here&#39;s how persist operation looks like in Rust:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SbTy6nrzsvWfzjBkMyKRxQ.png" /></figure><h3>Conclusion</h3><p>Till now, we have seen three methods which <strong>reduce I/O time by 30–40 times</strong>, which is huge! We have also discovered how we can ensure that the S3 data we download is atomic, i.e., each file is either completely downloaded, or not downloaded at all. This way by ensuring that our data is fully persisted, we can increase cache size to support larger datasets without fear of data loss or partial downloads.</p><p>However, this approach still suffers from the rate limiting done by S3 on parallel downloads for multiple datasets at once. In the next part of this series, we’ll explore how to reduce the effective I/O time even further (to almost zero!) using queueing, which is greatly helpful for projects involving large scale data spread across multiple datasets.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd245f9d969c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating the Tech Career: Key Lessons from 5 Years in the Industry]]></title>
            <link>https://medium.com/@saiharshavellanki/navigating-the-tech-career-key-lessons-from-5-years-in-the-industry-ba10c307cd93?source=rss-c03f971cec37------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba10c307cd93</guid>
            <category><![CDATA[career-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[tech-career]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[work-life-balance]]></category>
            <dc:creator><![CDATA[Sai Harsha Vellanki]]></dc:creator>
            <pubDate>Sat, 31 Aug 2024 15:46:29 GMT</pubDate>
            <atom:updated>2024-08-31T15:46:29.455Z</atom:updated>
            <content:encoded><![CDATA[<p>In the past five years, I’ve worked at three distinct companies — Uber (a public company), Rippling (a mid-stage startup), and <a href="https://fennel.ai/"><strong>Fennel AI</strong></a> (an early-stage startup). Through these experiences, I’ve learned that several key factors contribute to employee satisfaction in the tech industry.</p><h3>1. Continuous Learning</h3><p>The opportunity to constantly learn new things is essential. Whether it’s mastering a new programming language, exploring emerging technologies, or improving skills like documentation and service design, staying on the cutting edge is critical. <strong>One way to accelerate this growth is by engaging with people who are two levels above you.</strong> At Uber, I was fortunate enough to work with one of our senior engineers who changed the way I thought about the real world problems and helped me with boosting my ideas. We often had brainstorming sessions where they constantly challenged my thinking by discussing about topics like issues in the current system, evaluating the need for a re-architecture, reducing system latencies, extending our solution to work for other teams, etc.</p><blockquote>The experience of your mentors can fast-track your own learning and broaden your understanding of the industry.</blockquote><h3>2. Career Growth</h3><p>Career progression is a huge motivator, even if it doesn’t always come with immediate financial rewards. Promotions might not instantly boost your salary, but they often position you for future success. For example, being a senior developer today means you’re better prepared to lead projects in the future.</p><blockquote>The skills you acquire during your growth phase will pay off when you need them most.</blockquote><h3>3. Work-Life Balance</h3><p>Work-life balance isn’t just about how many hours you work, it’s also about how you feel about your work at the end of the day. You could be working 12-hour days and still feel pumped if you love what you do. It’s important to find a role where you can maintain a healthy balance, but this doesn’t always mean sticking to a rigid 9-to-5.</p><blockquote>Work-life balance is less about the hours you put in and more about how energised you feel at the end of the day — passion can make even long hours fly by.</blockquote><h3>4. Company Culture</h3><p>How does your company treat you? And more importantly, how do your manager and teammates value your contributions? Culture is all about feeling included, having your voice heard, and knowing that your ideas matter.</p><blockquote>A supportive, inclusive environment is one where you can truly thrive.</blockquote><h3>5. Compensation</h3><p><strong>At the end of the day, your salary matters. It is what pays your bills.</strong></p><p>While growth and learning are critical, the financial compensation you receive for your work is also key to your satisfaction. Based on your own financial responsibilities and risk appetite, you can decide to optimise on what you need the most. It could be more in-hand salary, more stock options, more paid leaves, or any other specific perks such as a good medical insurance.</p><blockquote>Do not be afraid of negotiation. There is nothing exciting about being underpaid.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*q43E-EwaaTNecWOy" /><figcaption>Source: <a href="https://hrsea.economictimes.indiatimes.com/news/learning-and-development/is-learning-without-disturbing-your-work-life-balance-possible/93894813?utm_source=copy&amp;utm_medium=pshare">Link</a></figcaption></figure><h3><strong>How to Choose the Right Company for You</strong></h3><p>Now, the big question: How do you choose the right company? It’s simple — if a company offers at least three out of the five elements above, you’re in a good spot. Four out of five, and you’re in an amazing place. If you hit all five? You’ve found your dream job.</p><p>Here’s my personal advice for those early in their careers. It is solely based on my experience so far, and these are the key points which I wish someone would have told me at the beginning of my career.</p><h4>For Beginners (0–5 Years of Experience):</h4><ol><li><strong>Learning</strong> — Focus on learning. The more you invest in acquiring new skills in the early stages of your career, the more you’ll stand out later. Compromising on learning and upskilling just for the sake of money or growth in a single direction will hinder your overall development in long run.</li><li><strong>Culture</strong> — Align yourself with teams that share your values. Culture is like a seed — if you nurture it with the right people, it’ll grow with you as you move up the ladder. Surrounding yourself with people that share similar values can help you bring your best self to work, every single day. This is personally a very important choice I made while selecting a company. Being an early engineer at Fennel, I closely understood how creating a strong foundation for good culture attracts the right talent and helps us build towards a shared goal. It can be as simple as recognising someone when they go out of their way, celebrating small wins and having each others back when things don’t go as expected.</li><li><strong>Growth</strong> — Don’t chase promotions for the sake of the title or validation. Focus on taking on roles where you can fully leverage your strengths and gain valuable experience.</li></ol><blockquote>Beware of the allure of high salaries early in your career. It’s tempting to join a company that offers more money, but if you sacrifice learning and growth, you could end up feeling unfulfilled in the long run. If you’re already well-skilled, by all means, prioritise compensation.</blockquote><blockquote><strong>Just never compromise your values for a bigger pay check.</strong></blockquote><h4>For Mid-Career Professionals (6–10 Years of Experience):</h4><ol><li><strong>Growth</strong> — Now’s the time to build on the learning you did in your early years. With more experience, you should be ready to take on leadership roles and manage larger projects. So choose a company which allows you to nurture your interests in the right direction. It could be growing as a Tech Lead or transitioning to a management position, like an Engineering Manager. This is the time you start creating impact on bigger things for the company and your team.</li><li><strong>Salary</strong> — It’s also time to start focusing more on financial rewards. You’ve invested years in learning and growing, and now you deserve a salary that reflects your value. If you’re not satisfied, consider switching teams or even companies. Often, high-impact teams within a company pay more than others, so start there.</li><li><strong>Work-Life Balance</strong> — Don’t forget to maintain a healthy balance. Twenties and early thirties are the time to enjoy life while staying productive. Poor health choices now can have lasting effects.</li></ol><p>As for those with more than 10 years of experience, I’ll leave that to the experts. I’m still navigating my own career, but I believe by that time, you’ll have a clear sense of what you want and need.</p><h3>Final Thoughts</h3><p>These insights are drawn from my personal experiences and conversations with colleagues who share similar perspectives. Everyone’s journey is different and there are so many factors which come in while making your next career decision. The key is to find what works for you, knowing that your priorities will evolve as your career progresses, and it is okay to change directions as you grow.</p><p>For instance, I recently joined Fennel AI, where I’m tackling exciting problems that help me grow as an engineer as well as contribute to the growth of the company. Within under a year, I was able to work towards empowering customers to seamlessly ingest and process massive datasets with lightning speed!</p><p>If you’re curious to learn more about the work I do, let’s <a href="https://www.linkedin.com/in/sai-harsha-vellanki/">connect</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba10c307cd93" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>