<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Trevor’s Blog: Data Engineering]]></title><description><![CDATA[Post about Data Engineering]]></description><link>https://trevor-barnes.com/s/data-engineering</link><image><url>https://substackcdn.com/image/fetch/$s_!4Ems!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5a60147-95d5-428a-8ced-88ab3a250b8a_608x608.png</url><title>Trevor’s Blog: Data Engineering</title><link>https://trevor-barnes.com/s/data-engineering</link></image><generator>Substack</generator><lastBuildDate>Sat, 11 Apr 2026 06:05:33 GMT</lastBuildDate><atom:link href="https://trevor-barnes.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Trevor Barnes]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[trevorbarnes91@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[trevorbarnes91@substack.com]]></itunes:email><itunes:name><![CDATA[Trevor Barnes]]></itunes:name></itunes:owner><itunes:author><![CDATA[Trevor Barnes]]></itunes:author><googleplay:owner><![CDATA[trevorbarnes91@substack.com]]></googleplay:owner><googleplay:email><![CDATA[trevorbarnes91@substack.com]]></googleplay:email><googleplay:author><![CDATA[Trevor Barnes]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Stop using Python for Data Engineering!]]></title><description><![CDATA[Start writing today.]]></description><link>https://trevor-barnes.com/p/stop-using-python-for-data-engineering</link><guid isPermaLink="false">https://trevor-barnes.com/p/stop-using-python-for-data-engineering</guid><dc:creator><![CDATA[Trevor Barnes]]></dc:creator><pubDate>Sun, 13 Oct 2024 20:00:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe88c5e-e1ac-4745-b4f3-29cc591f685d_1174x1176.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://substack.com/refer/trevor.49?utm_source=substack&amp;utm_context=post&amp;utm_content=152635109&amp;utm_campaign=writer_referral_button&quot;,&quot;text&quot;:&quot;Start a Substack&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Start writing today. Use the button below to create a Substack of your own</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://substack.com/refer/trevor.49?utm_source=substack&amp;utm_context=post&amp;utm_content=152635109&amp;utm_campaign=writer_referral_button&quot;,&quot;text&quot;:&quot;Start a Substack&quot;,&quot;hasDynamicSubstitutions&quot;:false}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://substack.com/refer/trevor.49?utm_source=substack&amp;utm_context=post&amp;utm_content=152635109&amp;utm_campaign=writer_referral_button"><span>Start a Substack</span></a></p></div><p>Why? Because I am going to say the meme "Python Slow", but in all honesty it is much more than that. If executives knew how much money is being thrown out the window because we are moving Tb's to Pb's of data each day in a language that is not optimized for anything other than getting people who have never programmed before to be able to run their first program in less than a minute, heads would roll. Now, I am not saying that you can't use a Python API to do data engineering, you just need to make sure that the query engine under the hood is not Python based. With each passing day, it seems like a new query engine is being built, whether its Apache Spark, DuckDB, Polars, Datafusion, or many other smaller projects that are rapidly gaining traction, if you aren't actively working to refactor your pandas (and potentially Dask) dataframes to an engine that manages the data via C++, C, Java, or Rust under the hood, you aren't doing anyone any favors.</p><h2>Anecdotes gonna Anecdote</h2><p>Recently, I was tasked with refactoring a Python script that was taking about 20 hours to run. I was wondering how much data was being processed in order for a job to take that long to run, it must have been dozens of terabytes of data or highly complex computations running on a small ec2 instance out there. Well, come to find out it's running on a i4.16xlarge machine. That's 64vCPU and 512Gb of RAM! So, this means that the data source they are pulling from must be I/O constrained, right? Again, not the issue. It was a sharded, read-replica Postgres instance that could eat up any load that was thrown at it, especially given its production criticality. So, the source will let you read data as fast as you ask for it, and the queries when you filtered for the unique ID were blazingly fast. &nbsp;My next thought was "whoever wrote the script must really not know what they are doing". So I dove into the code base... pure Python written by 2 very talented Software Engineers that were using optimizations in Python that looked like they were straight out of the "Fluent Python" book, this Python was far better than anything I could have hope to write. So, the machine is large enough, the source is fast enough, the code is optimized enough, how the hell am I supposed to speed up this code?</p><h2>"Just refactor to Rust, bro!"</h2><p>Enter stage right, meme 2. I needed to move this data that was growing at an exponential rate and quickly to our analytics warehouse, but how? I had been learning some Rust and C in my spare time out of curiosity and decided "Screw it, I'll meme this project, we are refactoring to Rust". &nbsp;I was prepared for this to take weeks, fighting the borrow checker, dealing with lifetime errors, "map error, trait does not exi...", refactoring newb shoddily written Rust code so it could maybe see a 20% speed boost over its Python counterpart. Writing Rust actually wasn't that bad. I know I wasn't writing it as "idiomatically" as I should, but hey I could always clean it up later.</p><p>Well, roughly 1.2k lines of poorly written, beginner Rust code later... that Python script that was taking 20 hours to complete, ran in.....drum roll...... 45 minutes on Rust. How, idk? Clones everywhere, poorly optimized data structures, using sqlx and Tokio crates incorrectly, but Rust was just faster. My boss was impressed, but I wasn't, I felt like some type of fraud, could it really be that easy? I asked to spend more time cleaning the code, but everyone was just happy that they could get the data quickly.</p><h2>What's going on?</h2><p>As someone who just had a passing interest in systems languages, I was now hooked on systems programming for Data Engineering. It just kind of clicked "Why not use the most performant languages to support the largest and most cumbersome data processes within a business?" The Data Engineering community seems to be stuck on Python and Pandas.</p><p>Before I explain what I think is happening I mean no disrespect to Business Intelligence, Data Analysts, and Data Engineers. This has just been my experience working at several different companies, and one of those being in FAANG. I am not from a Computer Science or Software Development background. My degree was in Aviation Technology, I have more credentials to be a pilot and aircraft mechanic than a Software Engineer, but I noticed a lot of my colleagues from the BI space normally have a trajectory of Analyst -&gt; BI -&gt; Data Engineer. Meaning, most Data Engineers I have run into have only ever worked within Python and have never really needed to understand the machine on a more granular level than "code goes in, number comes out".</p><p>I believe modern Data Engineering is suffering from the same issues as modern web dev. Too many people from non-CS backgrounds who take a Udemy course, or go to a bootcamp, or read "Automate the Boring Stuff with Python" (one of the best programming books ever, btw) and then do some leetcode to learn how to sort a Python array to pass the coding test for an entry level Date Engineering position, then work their way up from there. There is no shame in this, this is what I did years ago to get an entry level position at Amazon!</p><h2>How to fix it?</h2><p>Even at Amazon, I worked with Data Engineers that did the same thing as me, not from CS backgrounds and never worked as a Software Developer. Then I met Dennis... I call Dennis the first <em>true </em>Data Engineer I met. Dennis was a former Software Developer and more importantly a former Marine. He didn't take bullshit, but also didn't give it either. When he talked about Data Engineering, it was on a different level. Before this time, data was discussed as tables and dataframes being pushed from one place to the next, as long as the data landed from point A to point B, who cared about anything else, customer was happy, we were happy.</p><p>Then Dennis explained that it wasn't good enough, data will grow and your pipelines will clog, jobs will start failing which will cause other pipelines to start failing and he was right. Our data was growing rapidly and the cracks in our queries on Redshift were starting to give. Moving from Python and pipelines doing CSV copies into Redshift had to go. We were now worried about column compression, ZOrdering, partitioning, when to use parquet vs avro vs json vs csv, "can we move this pipeline to EMR to reduce the load on our cluster", "we need to start utilizing spectrum", separate compute from storage. Dennis gave me my first real lesson in Data Engineering after years of doing "Data Engineering".</p><p>Upon reflection I was in the middle of the first big data revolution. We were moving from a Data Engineering world of &nbsp;"just ship the data" to understanding if we optimized our data pipelines and storage, we could easily save hundreds of thousands if not millions of dollars a year.</p><h2>Big Data Revolution 2: Electric Bugaloo</h2><p>There has been a rise in Big Data Applications for Data Engineering that focus on optimizing compute. In the first big data revolution we optimized storage with new compression algorithms and starting to utilize formats like parquet/delta. This big data revolution will be focused on utilizing those algorithms to do more with less on systems level languages. We are already starting to see the shift:</p><ul><li><p>Polars -&gt; Rust</p></li><li><p>Apache Spark - Photon -&gt; C++</p></li><li><p>Apache Spark - Comet -&gt; Rust</p></li><li><p>CUdf -&gt; C</p></li><li><p>Datafusion -&gt; Rust</p></li><li><p>DuckDB -&gt; C++</p></li><li><p>Apache Arrow (in-memory format used by a couple of the technologies above)</p></li></ul><p>These are the future tools of Data Engineering. So should you go out and learn one of these languages in order to stay relevant in Data Engineering? Absolutely not, you will be able to be an extremely effective Data Engineer just knowing Python.</p><p>So what's the deal with the clickbait title? Well, I truly believe the future of Data Engineering is Python APIs <em>for </em>systems languages. Every single bullet point technology above has a Python API that you can use that will instantly speed up your data pipelines. If I am using the Python version of Polars, will it be faster than Rust*? No. That is because while running those jobs, Python is limited by it's runtime and GIL, while I can just slap a <code>#[tokio::main]</code> on my main function in Rust and asynchronously run X number of threads and tasks in parallel with <code>tokio::task</code>.</p><h1>Conclusion</h1><p>All this is to say, while you don't need to learn a systems language to leverage highly performant Data Engineering programs, I think every programmer whether a web dev, data scientist, data engineer, or any other will always become better at their programming job if they learn computer science fundamentals. You can still utilize Python, but just use it as the wrapper around a systems language based library.</p><p>Footnote:</p><ul><li><p>I want to clarify that the Python implementation of Polars runs the Rust operations faster than if they were in pure Rust. The reason for this being that Polars can have the Rust compiler solely focus on optimizing Polars library only when written for the Python API, where if you were to use Polars crate in a Rust application, Rust has to try to optimize for other crates, too. More is explained by the creator of Polars: <a href="https://github.com/pola-rs/polars/issues/8391?ref=trevor-barnes.com">https://github.com/pola-rs/polars/issues/8391</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Reflections on Data Engineering Described]]></title><description><![CDATA[What is Data Engineering?]]></description><link>https://trevor-barnes.com/p/reflections-on-data-engineering-described</link><guid isPermaLink="false">https://trevor-barnes.com/p/reflections-on-data-engineering-described</guid><dc:creator><![CDATA[Trevor Barnes]]></dc:creator><pubDate>Fri, 05 Apr 2024 22:49:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1d0bc555-4f7b-4be5-b054-e5f729461cef_2000x1333.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>What is Data Engineering?</h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OA1g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdbf5ec1-4fb7-487e-9284-32608c8dd124_2000x1333.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OA1g!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdbf5ec1-4fb7-487e-9284-32608c8dd124_2000x1333.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OA1g!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdbf5ec1-4fb7-487e-9284-32608c8dd124_2000x1333.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OA1g!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdbf5ec1-4fb7-487e-9284-32608c8dd124_2000x1333.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OA1g!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdbf5ec1-4fb7-487e-9284-32608c8dd124_2000x1333.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OA1g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdbf5ec1-4fb7-487e-9284-32608c8dd124_2000x1333.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cdbf5ec1-4fb7-487e-9284-32608c8dd124_2000x1333.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Reflections on Data Engineering Described&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Reflections on Data Engineering Described" title="Reflections on Data Engineering Described" srcset="https://substackcdn.com/image/fetch/$s_!OA1g!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdbf5ec1-4fb7-487e-9284-32608c8dd124_2000x1333.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OA1g!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdbf5ec1-4fb7-487e-9284-32608c8dd124_2000x1333.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OA1g!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdbf5ec1-4fb7-487e-9284-32608c8dd124_2000x1333.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OA1g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdbf5ec1-4fb7-487e-9284-32608c8dd124_2000x1333.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>This has been a very tricky definition to narrow down at the companies I have worked. What would be considered a "good" data engineer at some companies wouldn't even get in the door at the other, but not necessarily because of a skill or knowledge gap. The difference could be broken down to a lack of a solid definition for a data engineer. One company might look for an understanding of Scala programming, AWS EMR, Hadoop, Lambda, and Kinesis, while the other needs focus on Linux servers, python, airflow, and shell scripting.</p><p>Fundamentally, a "data engineer" to me is anyone with the knowledge to implement a common and robust set of software discipline to move information from source to consumer. <em>Fundamentals of Data Engineering</em> pretty much aligns with this philosophy. While their definition is a little more robust, it captures the gist of what a Data Engineer can expect from a fundamental level. Data Engineers are data lifecycle managers. The need to make sure that from generation to storage to ingestion to transformation to serving that security, data management, DataOps, data architecture, orchestration, and software engineering best practices are followed.</p><h2>The Data Engineering &#8220;Pendulum&#8221;</h2><p>One of the topics that really stuck with me when I took the University of Washington&#8217;s &#8220;Big Data&#8221; program was the back and forth between data systems focusing on parallelizing (MPP) across multiple compute nodes, and Moore&#8217;s law making it easier to process data on a single compute node. 1980-2000 focused on MPP, 2000-2010 focused back on highly capable data warehouses, and 2010-2020 focused on data lakes. Now we are in a mix between utilizing MPP platforms like AWS EMR, Databricks, Redshift, but also being able to do more with less with architectures like Data Mesh that allow tools like DBT to aggregate data and version control it across multiple endpoints. Couple that with the growth of optimizing compute for ETL with python packages like Polars operating on AWS Lambda and you can build rather robust architectures that can handle large amounts of data very quickly for minimal costs.</p><h2>Modern Data Engineering</h2><p>One thing I do not agree with in <em>&#8221;Fundamentals of Data Engineering&#8221;</em> is that the authors believe the utilization of several different tools in each step of the lifecycle thus creating &#8220;<em>A</em> type Data Engineers&#8221; (those that focus on tech that abstract away a lot of the code) will be the most optimal solution for most situations. While <em>in theory</em> this sounds like a good idea, connecting all the different toolsets together has not always been an easy task and then creates a whole host of new problems that require a different type of DevOps knowledge to manage.</p><p>It is best to choose tools as a component of an ecosystem rather than the merits of the tool on its own accord. As an example, if your data stack utilizes Airbyte, DBT, and Databricks it might be tempting to choose a tool like Airflow as your orchestrator of choice, especially when several data engineers have experience with creating pipelines in Airflow. In reality, it might be significantly better long term to go with a tool like Dagster instead of Airflow because of the out-of-the-box integrations with Airbyte, DBT, and Databricks that Dagster offers.</p><h3>Open Source and COTS Overload</h3><p>I have heard that you should &#8220;stand on the shoulder of giants&#8221; and avoid writing bespoke code, and I agree with this. For the most part, tools like Airbyte, DBT, Dagster, and the like allow users to get up and running ETL without needing to write UIs and connectors from scratch. I think that they can certainly help shape the architectures, but like I mentioned earlier, it gets a point where you are just managing log files from several different applications trying to figure out who is the culprit when something goes wrong. So now you have to become an expert in how each open source tool functions and what underlying tech they are using. Deploying Airbyte? Hopefully your Kubernetes, Containerization, Python, PyArrow, and DBT skills are good or else you are going to be shrugging your shoulders when your first error happens. Databricks? Better learn how to read the messy Java Errors and pick up some basic understanding of Scala, too, or might as well just not deploy at all.</p><p>I have been witness in the past to these types of deployment errors and have fallen victim to them myself. Early in my learning, I tried to deploy a bunch of Singer pipelines without fundamentally understanding linux, cron, the CLI, and how python connects to RestAPIs and databases. I could get stuff up and running following the tutorials, but had no clue how to debug the errors. Was it a Postgres error? A dbfs error? A python error?</p><p>A this point you might think I am leading into the statement &#8220;Just write your own tools!&#8221;, but you can fall into a deeper trap creating bespoke tools.</p><h3>Being Bespoke</h3><p>There is nothing more satisfying than writing custom pipelines from scratch and watching them hour by hour and day by day operate without problem. You spent countless hours reading docs for modules and libraries, writing tests and watching as data from your program moves from point A to point B flawlessly, but then you share your code&#8230;. Everything you thought made sense and was good coding habits, you now realize is a spaghetti mess that won&#8217;t be useful outside of you using it. You try to get your peers to understand it, but you now realize that even with your code comments you have no idea why you wrote <em>that function that way</em>. I mean sure, it cuts times from air byte by 90% and uses 95% less compute than that heavy open source tool you deployed for moving a bunch of data from simple RDBs, but is it any good if no one can use it?</p><p>I have seen this in pretty much every job I have worked, and unfortunately I have been guilty of perpetuating these bad habits. It is important to realize when your programs are worse than alternatives, either Open Source or maybe another person&#8217;s code that you work with. I have seen the main inhibitor of quality Data Engineering is people getting overly attached to their outdated and over complex spaghetti code.</p><h3>Grading Data Engineering Systems</h3><p>As analysts and engineers, we need to be constantly be evaluating our systems and verifying that they are still optimal, but what do we look at? I am proposing the following table for grading:</p><p>Field Description Score 1-5 (5 is best) Cost Is this solution cost effective? 1 Agility Is this developed using agile best practices? 3 Scalability Can this scale to the largest datasets you expect in the future? 5 Simplicity Is it simple to use or contribute code or use the API/SDK? 2 Reuse How easy is it to deploy on other systems? 3 Interoperability Can it work with other systems? 4</p><p>Your min score is 6 and max score is 30. I would assume that if any of these fields get a 1 that you would not want to proceed with it unless there is a plan to improve that field. I also assume that you would want at least a minimum score of 20 before proceeding with the system.</p><p>I will use my Rust ETL as an example.</p><p>Field Score Reason Cost 5 It can&#8217;t get any cheaper, the system is extremely compute efficient (a rust quality more than anything doing with my code) and you can easily deploy it to lambda which is one of the cheapest ways to use compute Agility 2 While it is version controlled, there is no roadmap or features planned with very little comments, I look to improve this score in the future Scalability 5 I am using tokio, async, and parallelism, which when deployed allows for infinite scaling, I also am utilizing Polars &#8220;streaming&#8221; which allows me to spill larger than memory datasets to disk Simplicity 3 While it does have a CLI interface and you can construct pipelines using YAML, any bugs for a non-Rust dev will be very tricky to debug. Using expect() instead of unwrap() should help give clearer errors, though Reuse 4 The code can be deployed on nearly every platform once compiled for that platform Interoperability 3 While connectors need to be manually written if it doesn&#8217;t exist already, if the connector exists it should allow you to pull and push data as needed</p><p>It looks like my rust based ETL scores high as far as performance and cost goes, but lacks in ease of use. But like I mentioned, Rust is mainly the reason the code is efficient and scalable. This means if I were to build a data engineering team around this tool or if it was in the selection process for a current Data Engineering team, they would need to focus on being highly agile, and make sure that code is clear, concise, and well documented.</p><h2>Conclusion</h2><p>Data Engineering from the abstract perspective is relatively easy to define, it is just when you need to define it in the same way you need to define something as abstract as the color blue, it becomes difficult. Data Engineering means a lot of different things to different people and companies. If you find yourself moving data from point A to point B on a daily basis and you are also responsible for the security, quality, and control of the tools or code that runs those pipelines, then you are a data engineer.</p>]]></content:encoded></item><item><title><![CDATA[Modern Data Engineering]]></title><description><![CDATA[Introduction]]></description><link>https://trevor-barnes.com/p/fpbp-modern-data-engineering</link><guid isPermaLink="false">https://trevor-barnes.com/p/fpbp-modern-data-engineering</guid><dc:creator><![CDATA[Trevor Barnes]]></dc:creator><pubDate>Thu, 14 Mar 2024 21:57:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/baf426b5-0599-458b-886e-503b88c1e60d_2000x1328.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction</h2><h3>My Past Experience</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lXaI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13976e9c-6c69-4d19-816e-e4f1a271ffa7_2000x1328.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lXaI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13976e9c-6c69-4d19-816e-e4f1a271ffa7_2000x1328.jpeg 424w, https://substackcdn.com/image/fetch/$s_!lXaI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13976e9c-6c69-4d19-816e-e4f1a271ffa7_2000x1328.jpeg 848w, https://substackcdn.com/image/fetch/$s_!lXaI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13976e9c-6c69-4d19-816e-e4f1a271ffa7_2000x1328.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!lXaI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13976e9c-6c69-4d19-816e-e4f1a271ffa7_2000x1328.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lXaI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13976e9c-6c69-4d19-816e-e4f1a271ffa7_2000x1328.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/13976e9c-6c69-4d19-816e-e4f1a271ffa7_2000x1328.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Modern Data Engineering&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Modern Data Engineering" title="Modern Data Engineering" srcset="https://substackcdn.com/image/fetch/$s_!lXaI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13976e9c-6c69-4d19-816e-e4f1a271ffa7_2000x1328.jpeg 424w, https://substackcdn.com/image/fetch/$s_!lXaI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13976e9c-6c69-4d19-816e-e4f1a271ffa7_2000x1328.jpeg 848w, https://substackcdn.com/image/fetch/$s_!lXaI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13976e9c-6c69-4d19-816e-e4f1a271ffa7_2000x1328.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!lXaI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13976e9c-6c69-4d19-816e-e4f1a271ffa7_2000x1328.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>I have been working on setting up Data Platforms and Data Engineering tools for nearly a decade. The start of my career in this field I was working at a large enterprise (<em>cough</em> Boeing <em>cough</em>) and we had their entire Supply Chain analytics ecosystem on a remote desktop using "Task Scheduler" on Windows machines to run <code>R</code> scripts to do data transforms on source systems (mostly Oracle and MSSQL) and push the results into Teradata. While Boeing isn't the bastion of proper process (just check the current news) they were certainly not alone of having this be a standard process for their Data Engineering pipelines. Actually, my experience and knowledge building out this "Data Engineering Lifecycle" is what landed me a job at Amazon, pretty much doing the same thing, but swap out a physical remote desktop for a virtual machine in the cloud (AWS EC2) and Teradata for Redshift.</p><p>I eventually helped shift our team at Amazon from using R scripts and ShinyR to AWS EMR and Apache Spark based applications. The throughput was astounding and we went from only being able to move a couple hundred MB at a time to GB and even TB of data. While Redshift is a distributed compute platform, there was no API that allowed for programmatic transforms like Apache Spark. With Apache Spark, we saw a simplification and greater throughput of Data Engineering pipelines. We could now write our code in Scala/Java/R/Python directly ontop of the storage (S3) and scale and kill compute nodes as needed! No need to spin up a massively expensive Redshift cluster when we could just share a pool of compute nodes with several other teams on a "as needed" basis. The savings were massive!</p><h3>Stepping into Modern Day</h3><p>At this time, Databricks was becoming popular and largely helping to abstract a lot of the pain points of administering a large Apache Spark platform to run your scripts. I immediately fell in love with the tech and hold an "Apache Spark Developer" accreditation (even got a fancy coat for it, too). But it wasn't just Databricks, it seemed like several tools were starting to gain popularity. Airflow, Dagster, Prefect, Airbyte, Stringer, Stitch, Fivetran, Great Expectations, DBT, Flink, Kafka, Redis, Spark, Flume, Foundry, Tableua, Snowflake, Looker, Cassandra, Segment, Redash, and the list goes on. You now no longer needed a team of Software Devs to manage the minutia of pipelines, but you also needed a new team now to manage all the licensing and debugging of tools that you are now vendor locked into, preventing any future possibility of an easy transition to newer tech.</p><p>I read blog after blog talk about the proper way to implement and connect all of this tooling, while some lead to success, a lot of experiences ended in quasi-failure states where Dr. Frankenstein's Data Engineering monster had destroyed the town. Type Tableau into google after Salesforce bought them and then fired their top developers and you will see the horror stories of people trying to move to different visualization software, but feel too locked into Tableau to get out, even though these small to medium sized companies are spending hundreds of thousands if not a million a year on licensing!</p><p>But looking at the cost of Databricks, I have started to consider a couple questions:</p><ul><li><p>What is the next big thing in Data Engineering?</p></li><li><p>Do we need pipelines to be faster?</p></li><li><p>Do we need more efficient code to lower cost and impact on the environment?</p></li><li><p>Are we missing an opportunity to get the performance of C/C++, but with a memory safe language?</p></li></ul><h3>So what's the Answer?</h3><p>I don't have one and don't thing I ever will, but look to gain <em>clarity</em> and <em>insight</em> on how to make things better.</p><p>I aim to explore not only the technical aspects of implementing a new tooling for Data Engineering, but one that looks at the process more connected in holistically. One where tooling is modular, but also aligned. Where complexity is abstracted into simplicity, but also where you can understand the underlying fundamentals, and more importantly, maybe the code can help you learn more about the fundamentals of data engineering.</p><h2>Defining Data Engineering</h2><p>Now we get to the crux of why I am writing this blog. I am operating off the theory that if we write Data Engineering tools in Rust, we can get better and more efficient compute performance than most Java/Scala/Python based analytics tools. We get memory safety, near C/C++ performance and in some instances better, type safety, and a large community of developers to help build this project. But first, I want go over some definitions of Data Engineering and what it means when referenced in posts</p><h3>What is Data Engineering?</h3><p>I would point to my book notes from my <a href="https://trevor-barnes.com/notes-from-fundamentals-of-data-engineering-data-engineering-described/">Data Engineering Described</a> post to get a more holistic perspective on what <em>data engineers</em> are what they do. Mainly, Data Engineering is a set of technical and business practices and knowledge that moves information to another location where it can be aggregated, analyzed, process, stored, and distributed to relevant users.</p><h3>What is the Goal?</h3><p>For brevity and the point of this blog series exploring implementing a Rust program for Data Engineering we will be following the following definition:</p><blockquote><p>We are type B (builders) data engineers focusing on the Storage -&gt; Ingestion -&gt; Transformation phase of the data engineering lifecycle and focus on the undercurrents of DataOps, Orchestration, and Software Engineering, with the explicit goal of: *Reducing cost of the data engineering lifecycle in order to increase the scalability, simplicity, and interoperability of our data engineering software. We will be operating from the perspective of a Stage 1 (Starting with Data) organization that is operating without any current data engineering infrastructure.</p></blockquote><p>Each blog post will aim to slightly increase in complexity. We will start off simple and increase complexity as we move through each lesson. While the aim is not to teach Rust, I will do my best to explain concepts without diving too deep into details. I will try to point you to my other blog where I am working to put all my notes from learning Rust: <a href="https://rustycloud.org/?ref=trevor-barnes.com">rustycloud.org</a></p><h2>Why Rust?</h2><p>Why not? It is fast, type safe, memory safe, implements functional programming, you can do object oriented programming (sort of), a large community of users and an active development community.</p><p>I originally started learning Go and had an idea to do something similar in Go, but one day a coworker of mine I highly respect said "Dude, learn Rust instead, it will pay off better in the long run". I wasn't going to argue with someone who has a Doctorate in Cyber Security that worked at Red Hat. That's it... That is why I started learning Rust and have not looked back.</p><h3>The Dreaded Rust Learning Curve</h3><p>The learning curve for Rust is steep, but hey, if I was able to pick up some of the basics, I am sure you can, too. I will admit I am still deep in the process of learning Rust so some questions may be way out of my scope of knowledge, but will do the best I can to answer questions.</p><p>Realistically, the only two areas I get really tripped up <em>sometimes</em> is Borrowing/Ownership and Lifetimes.</p><h4>Borrowing &amp; Ownership</h4><blockquote><p>Ownership is a set of rules that govern how a Rust program manages memory. All programs have to manage the way they use a computer&#8217;s memory while running. Some languages have garbage collection that regularly looks for no-longer-used memory as the program runs; in other languages, the programmer must explicitly allocate and free the memory. Rust uses a third approach: memory is managed through a system of ownership with a set of rules that the compiler checks</p></blockquote><ul><li><p>From "The Rust Programming Language" available on NoStarch</p></li></ul><p>Essentially, Rust will delete/remove variables that it assumes are no longer in use. For a better explanation please visit <a href="https://rustycloud.org/ownership/index.html?ref=trevor-barnes.com">Ownership on Rusty Cloud</a></p><h4>Lifetimes</h4><p>Lifetimes are used to keep variables alive that would go out of scope, but need to stay in scope. I still have an in-work page on my rust blog <a href="https://rustycloud.org/generics_traits_lifetimes/index.html?ref=trevor-barnes.com">here</a> but look to get it up as soon as possible.</p><h4>Other Rust 'Quirks'</h4><p>There are other steep learning curve items that I see people talk about in forums like error handling when to use <code>?</code> or <code>unwrap</code> implementing traits, zero-cost abstractions, no encapsulation, etc...</p><h2>Conclusion</h2><p>While I can't promise to create a solution to all your Data Engineering needs, I am looking to improve my skills and maybe if other people are interested, they could pester me to keep up the pace on posting or give me ideas for topics to comment on in future posts. I am hoping that we can increase our Data Engineering and Rust knowledge together!</p><p>Thanks for reading!</p>]]></content:encoded></item></channel></rss>