<script data-pm-proxy="intercept"></script><?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[VuTrinh.]]></title><description><![CDATA[My mom reads my articles to support her son. Now, she can design a data architecture and write ETL scripts.]]></description><link>https://vutr.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!2JXp!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb91e59e-4df2-4ac8-b3b4-1f4e830f7b42_256x256.png</url><title>VuTrinh.</title><link>https://vutr.substack.com</link></image><generator>Substack</generator><lastBuildDate>Tue, 01 Sep 2026 16:46:16 GMT</lastBuildDate><atom:link href="/__u/vutr.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Vu Trinh]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[vutr27@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[vutr27@substack.com]]></itunes:email><itunes:name><![CDATA[Vu Trinh]]></itunes:name></itunes:owner><itunes:author><![CDATA[Vu Trinh]]></itunes:author><googleplay:owner><![CDATA[vutr27@substack.com]]></googleplay:owner><googleplay:email><![CDATA[vutr27@substack.com]]></googleplay:email><googleplay:author><![CDATA[Vu Trinh]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[How to start learning data engineering in 2026?]]></title><description><![CDATA[Horizontal learning, AI and how to create impact fast.]]></description><link>https://vutr.substack.com/p/how-to-start-learning-data-engineering</link><guid isPermaLink="false">https://vutr.substack.com/p/how-to-start-learning-data-engineering</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Tue, 01 Sep 2026 05:16:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!25hB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=205485370&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=205485370"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!25hB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!25hB!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!25hB!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!25hB!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!25hB!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!25hB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:76464,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210852447?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!25hB!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!25hB!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!25hB!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!25hB!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79cce4e8-6269-4a53-907c-24eb3b0289b0_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h1>Intro</h1><p>I&#8217;ve written quite a few articles about how to learn data engineering skills: the <a href="/__u/vutr.substack.com/p/the-data-engineer-roadmap?utm_source=publication-search">roadmap</a>, the <a href="/__u/vutr.substack.com/p/how-to-become-a-senior-data-engineer?utm_source=publication-search">mindset</a>, <a href="/__u/vutr.substack.com/p/7-insights-to-help-you-learn-any?utm_source=publication-search">OLAP</a>, <a href="/__u/vutr.substack.com/p/how-to-learn-python-effectively?utm_source=publication-search">Python</a>, <a href="/__u/vutr.substack.com/p/how-to-start-learning-stream-processing?r=2rj6sg&amp;utm_campaign=post-expanded-share&amp;utm_medium=web">stream processing</a>, <a href="/__u/vutr.substack.com/p/deep-dive-into-the-kimball-dimensional?utm_source=publication-search">data modeling</a>, <a href="/__u/vutr.substack.com/p/5-insights-to-help-you-learn-any?utm_source=publication-search">open table formats</a>&#8230;</p><p>However, I don&#8217;t feel they provide a comprehensive, straightforward guide for newcomers; some LinkedIn folks or my Substack readers often reach out and say they still don&#8217;t know where to begin learning data engineering.</p><p>So, I think it would be nice to have an article like this one: not a step-by-step guide to learning all the technical skills, but rather a guideline that gives you direction on what to do and what not to do, based on my observations and experience.</p><p>The ideal audience for this article is recent graduates, career switchers, and those who have just started their careers in data engineering. If you&#8217;ve already been working in data engineering for a while, you can think of this as a &#8220;review&#8221; guide, a chance to reflect on what you&#8217;ve learned along the way.</p><p>&#8212;</p><p>Here are all the things I would do if I had to start learning data engineering all over again in 2026. </p><blockquote><p><em><strong>Note:</strong> Read this article only if you&#8217;re sure you want to pursue a career in data engineering and already understand what a data engineer is responsible for. If not, please make sure you have that understanding before going any further.</em></p></blockquote><div><hr></div><h1>tl:dr</h1><ul><li><p>At first, you learn &#8220;enough&#8221; to do an end-to-end project that could actually provide &#8220;business value&#8221;. (a pet project that helps you answer some questions with data)</p><ul><li><p>The goal is to be aware of how you can bring value.</p></li></ul></li><li><p>Invest in data modeling early.</p></li><li><p>Invest your time in deep-dive processes later; learn how to scale your learning of fundamentals to new concepts/ideas/tools.</p></li><li><p>Be proactive</p></li><li><p>Leverage AI to learn, but don&#8217;t abuse it too soon at your early career stage. Making mistakes and actually doing something is a privilege.</p></li><li><p>Keep in mind: AI is the new customer now.</p></li></ul><div><hr></div><h1>Mistake</h1><p>One of the mistakes I see among newcomers is that they try to master a single skill before moving on (e.g., mastering Python, SQL, or an OLAP service). The truth is, to provide value as a data engineer, you must do a lot of things.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!-wV3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!-wV3!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png 424w, /__u/substackcdn.com/image/fetch/$s_!-wV3!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png 848w, /__u/substackcdn.com/image/fetch/$s_!-wV3!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-wV3!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!-wV3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png" width="1274" height="736" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:736,&quot;width&quot;:1274,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:65153,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210852447?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!-wV3!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png 424w, /__u/substackcdn.com/image/fetch/$s_!-wV3!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png 848w, /__u/substackcdn.com/image/fetch/$s_!-wV3!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-wV3!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a0629da-5acb-434a-bdf3-555423a89ef8_1274x736.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">To move data from A &#8594; B robustly, you have to master a lot of things.</figcaption></figure></div><p>A simple pipeline that reads from PostgreSQL, transforms it, and writes the result to Snowflake requires you to, at least, know how to do these things:</p><ul><li><p>Data modeling to design how tables in Snowflake are organized.</p></li><li><p>Write Python code to read data from PostgreSQL.</p></li><li><p>Write SQL to transform the data and sink it to Snowflake</p></li><li><p>Create an Airflow DAG to glue everything together.</p></li><li><p>Write tests to validate all the logic.</p></li><li><p>Automate the development process with CI/CD.</p></li><li><p>Optimize the SQL query if it is slow.</p></li><li><p>Scale everything accordingly if the data volume increases.</p></li><li><p>Talk to the stakeholders if there is an incorrect number or the requirement changes.</p></li><li><p>&#8230;</p></li></ul><p>To bring value fast and effectively, you don&#8217;t need to go down the rabbit hole with one skill. The key is to learn a bit here and there.</p><div><hr></div><h1>A bit here and there</h1><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=210852447&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=210852447"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote>
      <p>
          <a href="/__u/vutr.substack.com/p/how-to-start-learning-data-engineering">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Benchmarking DuckDB and Polars on 10GB, 50GB, 100GB, 200GB, and 465GB datasets.]]></title><description><![CDATA[For Fun]]></description><link>https://vutr.substack.com/p/benchmarking-duckdb-and-polars-on</link><guid isPermaLink="false">https://vutr.substack.com/p/benchmarking-duckdb-and-polars-on</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Tue, 25 Aug 2026 05:15:34 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6rhX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207376654&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207376654"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><div class="callout-block" data-callout="true"><p><em><strong>Disclaimer</strong>: This article is not sponsored by or affiliated with any organization. The intent is not to criticize or undermine either vendor; the benchmark is based solely on my curiosity and observations.</em></p><p><em>Also, don&#8217;t use this benchmark alone to decide whether to use DuckDB or Polars for your needs. Any production tool decision should be based on your context, requirements, and benchmarks designed around your specific use cases.</em></p></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!6rhX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!6rhX!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!6rhX!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!6rhX!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!6rhX!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!6rhX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:188277,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/209884292?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!6rhX!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!6rhX!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!6rhX!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!6rhX!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d9f92a2-64ab-41ce-ae31-dae55ca4e71c_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>Intro</h1><p>Polars and DuckDB have been the obvious choices for many organizations for single-node processing.</p><p>They&#8217;re performant, easy to use, and easy to set up.</p><p>One day, I just thought it would be fun to run both of them on the same dataset to see how they perform.</p><p>In this article, I will try to run DuckDB and Polars on datasets of 10GB, 50GB, 100GB, 200GB, and 465 GB.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!JDtB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!JDtB!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png 424w, /__u/substackcdn.com/image/fetch/$s_!JDtB!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png 848w, /__u/substackcdn.com/image/fetch/$s_!JDtB!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png 1272w, /__u/substackcdn.com/image/fetch/$s_!JDtB!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!JDtB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png" width="466" height="329.0660592255125" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:620,&quot;width&quot;:878,&quot;resizeWidth&quot;:466,&quot;bytes&quot;:100410,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/209884292?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!JDtB!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png 424w, /__u/substackcdn.com/image/fetch/$s_!JDtB!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png 848w, /__u/substackcdn.com/image/fetch/$s_!JDtB!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png 1272w, /__u/substackcdn.com/image/fetch/$s_!JDtB!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa12a9aa6-d3a2-42e9-8a9b-66dc81257430_878x620.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><em><strong>The data volume here is the amount of data in memory; when generating data, the on-disk size will be 3x-4x smaller, since the data will be written in compressed Parquet.</strong></em></p><p>The motivation for the dataset size is that I want to see how DuckDB and Polars perform if the data fits entirely in my laptop's 24 GB RAM (with a 10 GB dataset), then stress test them with a dataset larger than the memory (from 50GB, 100GB, 200GB, to the extreme case of 465GB). Besides speed, I also try to observe reliability (e.g., query failures) and memory usage. All the code is available <a href="https://github.com/vutrinh274/duckdb_polars_benchmarking">here</a>.</p><p>If you only care about the results and observations, feel free to jump right away to the &#8220;Result&#8221; section :d</p><blockquote><p><em><strong>Note 1</strong>: This benchmark was run on my laptop, so the results could be very different if it were run on a more isolated machine. Also, there are likely performance tuning techniques for both tools that I'm not aware of, so feel free to share your suggestions in the comments.</em></p><p><em><strong>Note 2: </strong>I asked Claude to help me set up the code for this benchmark. However, all the design decisions and intentions were mine.</em></p><p><em><strong>Note 3</strong>: I run this in the way I like so I&#8217;m pretty sure it&#8217;s not the standard way to run a benchmark :d</em></p><p><em><strong>Note 4</strong>: This article won&#8217;t dive much into DuckDB or Polars. You can check out my previous articles here:</em></p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;4e219c05-efd6-40b8-bdd6-29b3b44b84d5&quot;,&quot;caption&quot;:&quot;With only $7/month (billed annually), you can access all the materials you need to grow from junior &#8594; senior DE.&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;showDescription&quot;:true,&quot;showImage&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;DuckDB at a high level&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:167177248,&quot;name&quot;:&quot;Vu Trinh&quot;,&quot;bio&quot;:&quot;Data Engineer &#183; Trusted by 18,000+ engineers &#183; I write what it takes to become a production-ready data engineer &#8594; vutr.substack.com&quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!UWAa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4805f673-db97-4f7c-85c4-44b345a8de80_256x256.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-06-23T05:16:04.443Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!nwm8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://vutr.substack.com/p/duckdb-at-a-high-level&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:201853360,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:17,&quot;comment_count&quot;:3,&quot;publication_id&quot;:1930705,&quot;publication_name&quot;:&quot;VuTrinh.&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!2JXp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb91e59e-4df2-4ac8-b3b4-1f4e830f7b42_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;ced83c7a-1bc6-47d0-ae05-4e92927c402c&quot;,&quot;caption&quot;:&quot;With only $7/month (billed annually), you can access all the materials you need to grow from junior &#8594; senior DE.&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;showDescription&quot;:true,&quot;showImage&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Polars at a high level&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:167177248,&quot;name&quot;:&quot;Vu Trinh&quot;,&quot;bio&quot;:&quot;Data Engineer &#183; Trusted by 18,000+ engineers &#183; I write what it takes to become a production-ready data engineer &#8594; vutr.substack.com&quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!UWAa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4805f673-db97-4f7c-85c4-44b345a8de80_256x256.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-06-30T05:15:08.215Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!7R9g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://vutr.substack.com/p/polars-at-a-high-level&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:202698885,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:10,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1930705,&quot;publication_name&quot;:&quot;VuTrinh.&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!2JXp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb91e59e-4df2-4ac8-b3b4-1f4e830f7b42_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div></blockquote><div><hr></div><h1>Setup</h1><blockquote><p><em>I ran this on my laptop: an Apple M5 with a 10-core CPU, 24 GB of RAM, and a 1 TB SSD. I also tried to dedicate as many resources as possible to the benchmark; during the run, I closed all other applications.</em></p></blockquote><h2>Python dependencies</h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!jsBI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!jsBI!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png 424w, /__u/substackcdn.com/image/fetch/$s_!jsBI!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png 848w, /__u/substackcdn.com/image/fetch/$s_!jsBI!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jsBI!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!jsBI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png" width="206" height="214.24" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:520,&quot;width&quot;:500,&quot;resizeWidth&quot;:206,&quot;bytes&quot;:104567,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/209884292?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!jsBI!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png 424w, /__u/substackcdn.com/image/fetch/$s_!jsBI!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png 848w, /__u/substackcdn.com/image/fetch/$s_!jsBI!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jsBI!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa65ef036-801b-48f5-abaa-da578f0a5d76_500x520.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>First, clone <a href="https://github.com/vutrinh274/duckdb_polars_benchmarking">this repo</a>.</p><p>Enter its folder and run </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;f43281c2-5dad-4b9a-9717-e41727af2c49&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">uv sync</code></pre></div><p>&#8230;to install the required Python libraries.</p><p>We leverage ibis-bench, the <a href="https://ibis-project.org/">ibis</a> library with utilities for benchmarking across engines such as DuckDB, Polars, and DataFusion.</p><p>We use native functions in ibis-bench to generate data and run benchmarks. However, we need a thin wrapper (<em><strong>/src/bench/tuned_run.py</strong></em>) on top of it because there are two shortcomings:</p><ul><li><p>ibis-bench&#8217;s own CLI doesn&#8217;t have a way to pass DuckDB memory_limit/temp_directory/max_temp_director_size setting.</p></li><li><p>ibis-bench&#8217;s own <em><strong>write_data.py</strong></em> always materializes Polars LazyFrame results using an in-memory engine rather than a streaming engine (given the incompleteness of <a href="https://github.com/pola-rs/polars/issues/16694#issuecomment-2146668559">the Polars streaming engine in the past</a>). With the <a href="https://github.com/pola-rs/polars/issues/20947">recent introduction of Polars' new streaming engine</a>, this wrapper attempts to force the Polars data-writing process to use it. </p></li></ul><blockquote><p><em><span>With Polars streaming engine, instead of processing all at once, the data is split into </span>small batches<span> that flow through the query pipeline, rather than the entire table being materialized in memory.</span></em></p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!pwRT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F797a5482-ad5c-4cfa-9697-482b4194ab9d_1846x522.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!pwRT!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F797a5482-ad5c-4cfa-9697-482b4194ab9d_1846x522.png 424w, /__u/substackcdn.com/image/fetch/$s_!pwRT!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F797a5482-ad5c-4cfa-9697-482b4194ab9d_1846x522.png 848w, /__u/substackcdn.com/image/fetch/$s_!pwRT!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F797a5482-ad5c-4cfa-9697-482b4194ab9d_1846x522.png 1272w, /__u/substackcdn.com/image/fetch/$s_!pwRT!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F797a5482-ad5c-4cfa-9697-482b4194ab9d_1846x522.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!pwRT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F797a5482-ad5c-4cfa-9697-482b4194ab9d_1846x522.png" width="1456" height="412" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/797a5482-ad5c-4cfa-9697-482b4194ab9d_1846x522.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:412,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!pwRT!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F797a5482-ad5c-4cfa-9697-482b4194ab9d_1846x522.png 424w, /__u/substackcdn.com/image/fetch/$s_!pwRT!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F797a5482-ad5c-4cfa-9697-482b4194ab9d_1846x522.png 848w, /__u/substackcdn.com/image/fetch/$s_!pwRT!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F797a5482-ad5c-4cfa-9697-482b4194ab9d_1846x522.png 1272w, /__u/substackcdn.com/image/fetch/$s_!pwRT!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F797a5482-ad5c-4cfa-9697-482b4194ab9d_1846x522.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p><em><span>This contrasts with the in-memory engine, which tries to fit the entire dataset into memory.</span></em></p></blockquote><p>For DuckDB and Polars, we will use the latest stable versions (at the time of this writing)</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;toml&quot;,&quot;nodeId&quot;:&quot;51eb14eb-ae4b-4a6b-aee5-8a440af40160&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-toml">dependencies = [
    "ibis-bench==0.2.0",
    "duckdb==1.5.5",
    "polars==1.43.2",
]</code></pre></div><h2>The queries</h2><blockquote><p><em>You can view all the queries <a href="https://github.com/vutrinh274/duckdb_polars_benchmarking/blob/main/queries/tpch_queries.sql">here</a>.</em></p></blockquote><p>The ibis-bench library provides 22 tcph queries written in DuckDB SQL and the Polars DataFrame API. Let&#8217;s take a brief overview of these queries:</p><h3>Q1</h3><p>Pricing summary: revenue, quantity, discount grouped by return status/line status for items shipped before a given date. Full sequential scan + aggregation over all of lineitem (biggest table); simple GROUP BY, no joins</p><h3>Q2</h3><p>Cheapest suppliers for a part type/size, in a given region. Multi-way join (5 tables) + correlated subquery; Tests join planning and subquery execution</p><h3>Q3</h3><p>Highest-revenue unshipped orders for a market segment. 3-table join + GROUP BY + ORDER BY + LIMIT; tests join + sort/top-N</p><h3>Q4</h3><p>Count of orders per priority where at least one line item was received late. Join + correlated EXISTS subquery; tests semi-join / subquery-to-join rewriting</p><h3>Q5</h3><p>Revenue by nation for a region within a year. 6-table chain join (customer &#8594; orders &#8594; lineitem &#8594; supplier &#8594; nation &#8594; region) where supplier and customer must resolve to the same nation; tests the optimizer&#8217;s join-order selection across a long join chain, since joining in the wrong order blows up intermediate result size long before the final small GROUP BY</p><h3>Q6</h3><p>Total revenue lost to discounts in a date/discount/quantity range. Single-table filter + aggregation on lineitem; tests scan + predicate pushdown, no joins</p><h3>Q7</h3><p>Revenue between two nations via suppliers/customers, by year. Self-referential nation join (both supplier and customer nation) + multi-table join.</p><h3>Q8</h3><p>Market share of a nation&#8217;s suppliers for a part type over time. Large join (8 tables) + conditional aggregation (CASE-WHEN)</p><h3>Q9</h3><p>Profit by nation/year for parts matching a name pattern. Large join (6 tables) + string pattern match + GROUP BY on derived year</p><h3>Q10</h3><p>Customers with the highest returned-item revenue, by nation. Join + GROUP BY + ORDER BY + LIMIT; similar shape to Q3 but keyed on customer.</p><h3>Q11</h3><p>Parts whose total supply value is a significant fraction of a nation&#8217;s total. Aggregation + correlated subquery comparing to an aggregate threshold (HAVING against a scalar subquery)</p><h3>Q12</h3><p>Correlation between shipping mode and order priority (late shipments). Join + CASE-based conditional counts; tests conditional aggregation.</p><h3>Q13</h3><p>Distribution of orders per customer (including customers with zero orders). LEFT OUTER JOIN + GROUP BY + a second aggregation over the first (nested grouping); tests outer join handling</p><h3>Q14</h3><p>Percentage revenue from promotional parts in a time window. Join + conditional SUM (CASE) over lineitem/part; tests filtered aggregation.</p><h3>Q15</h3><p>Supplier(s) with the highest total revenue in a quarter. View/CTE + join + subquery to find the max; tests subquery materialization and top-N-by-group</p><h3>Q16</h3><p>Count of suppliers who can supply parts matching a spec, excluding certain suppliers/complaints. Join + NOT IN / anti-join subquery + COUNT DISTINCT; tests anti-join and distinct aggregation.</p><h3>Q17</h3><p>Avg yearly revenue loss from small-quantity orders of a specific part. Correlated subquery computing a per-part average as a filter threshold; tests scalar subquery pushdown.</p><h3>Q18</h3><p>Top orders by total quantity, for customers with very large orders. Join + GROUP BY + HAVING on an aggregate + correlated subquery; tests large-order/HAVING filtering.</p><h3>Q19</h3><p>Revenue from parts meeting one of several brand/quantity/shipping combinations. Single join with a complex OR-of-ANDs predicate; tests predicate simplification/optimization.</p><h3>Q20</h3><p>Suppliers in a nation who over-supply a part relative to half its total shipped quantity. Nested correlated subqueries (2 levels) + anti-join-like filter; one of the most subquery-heavy queries</p><h3>Q21</h3><p>Suppliers with late-shipped line items on multi-supplier orders, excluding certain cases. Self-join on lineitem + EXISTS/NOT EXISTS subqueries; tests complex existence checks.</p><h3>Q22</h3><p>Customers with no orders in the last 7 years but above-average account balance, by country code. Correlated subquery (avg balance) + NOT EXISTS + string prefix matching; tests subquery + anti-join combo</p><div><hr></div><h1>The experiment</h1><h2>Generate data and run benchmark</h2><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=209884292&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=209884292"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div>
      <p>
          <a href="/__u/vutr.substack.com/p/benchmarking-duckdb-and-polars-on">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[I spent 10 hours vibe-coding a tool to visualize any Parquet file’s internals]]></title><description><![CDATA[Petquar, watch the 20s demo below]]></description><link>https://vutr.substack.com/p/i-spent-10-hours-vibe-coding-a-tool</link><guid isPermaLink="false">https://vutr.substack.com/p/i-spent-10-hours-vibe-coding-a-tool</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Wed, 19 Aug 2026 05:19:16 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!adNO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=211812379&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=211812379"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!adNO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!adNO!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png 424w, /__u/substackcdn.com/image/fetch/$s_!adNO!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png 848w, /__u/substackcdn.com/image/fetch/$s_!adNO!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png 1272w, /__u/substackcdn.com/image/fetch/$s_!adNO!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!adNO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png" width="1456" height="818" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:818,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:641597,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/211812379?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!adNO!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png 424w, /__u/substackcdn.com/image/fetch/$s_!adNO!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png 848w, /__u/substackcdn.com/image/fetch/$s_!adNO!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png 1272w, /__u/substackcdn.com/image/fetch/$s_!adNO!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75491d29-ac1b-4170-9a3d-5c52cb96c8a1_3016x1694.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>Parquet is the most important file format in data engineering.</p><p>Its columnar (hybrid) format and self-contained nature make it work so well for analytical workloads.</p><p>Learning Parquet matters not only because it&#8217;s one of the most widely adopted file formats in data engineering, but also because you can apply Parquet&#8217;s fundamentals to nearly all analytical storage systems: from how data is organized and encoded to how metadata plays an important role in query performance.</p><p>That said, I realized it can be a bit challenging for beginners to learn about Parquet, especially without a detailed visualization of its internals.</p><p>I created a tool (with Claude) to help you visualize any Parquet file.</p><p>It&#8217;s totally free.</p><p>Just: </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;6921b01f-e578-4873-878c-d82c61705387&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">pip install git+https://github.com/vutrinh274/petquar.git</code></pre></div><p>And:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;50920e3b-f14d-44be-9ff4-c36fed1bc036&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">petquar &lt;your-path-to-the-parquet-file&gt;</code></pre></div><blockquote><p><em>All the source code available here: <a href="https://github.com/vutrinh274/petquar">GitHub repo</a>.</em></p></blockquote><p>It will then open a new browser tab with that Parquet file&#8217;s internals. The UI includes:</p><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;d688e9c8-155e-4897-9bc8-7c5284649432&quot;,&quot;duration&quot;:null}"></div><ul><li><p>The beginning and end of the file, including the magic numbers</p></li><li><p>Row group cards that visualize the file&#8217;s row groups</p></li><li><p>Inside each row group are the column chunks</p></li><li><p>A row group&#8217;s size (shown once expanded) and a column chunk&#8217;s size are proportional to their real, compressed size on disk</p></li><li><p>Clicking a row group or column chunk opens an Inspector panel with a plain-language explanation and the raw facts, so you can see exactly what&#8217;s inside the file.</p></li><li><p>Column chunk information covers encoding, whether a bloom filter is present, and min/max statistics -- and drills down to the page level too, showing the number of pages plus each page&#8217;s encoding and min/max statistics.</p></li><li><p>The schema (every column&#8217;s name, type, and nullability) is available from the FileMetadata block.</p></li><li><p>All of this information is parsed by Rust arrow-rs.</p></li></ul><p>So, give it a try and see if it helps you.</p><p>Don&#8217;t hesitate to send feedback (the link next to the &#8220;petquar&#8221; logo, top left) so I can improve it further.</p><div><hr></div><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=211812379&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=211812379"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><p></p>]]></content:encoded></item><item><title><![CDATA[A stream processing project right on your laptop: Kafka, Flink, and ClickHouse]]></title><description><![CDATA[To learn stream processing]]></description><link>https://vutr.substack.com/p/a-stream-processing-project-right</link><guid isPermaLink="false">https://vutr.substack.com/p/a-stream-processing-project-right</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Tue, 18 Aug 2026 05:15:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ZjMX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=206789223&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=206789223"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ZjMX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ZjMX!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!ZjMX!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!ZjMX!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ZjMX!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ZjMX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3432680c-36d0-4247-919b-25836928b08b_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:298983,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/209201442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ZjMX!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!ZjMX!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!ZjMX!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ZjMX!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3432680c-36d0-4247-919b-25836928b08b_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Intro</h1><p>In the previous <a href="/__u/open.substack.com/pub/vutr/p/how-to-start-learning-stream-processing?r=2rj6sg&amp;utm_campaign=post&amp;utm_medium=web">article</a>, I shared my experience of self-learning stream processing from zero. While writing it, I realized that theory alone won&#8217;t make it click. That&#8217;s why I designed a project to better understand what a stream processing project looks like.</p><p>This article acts as a guideline to walk you through the project. There will be 4 scenarios, each with a different setup, output, and relevant concepts. My intention is to give you a playground where you can tune all kinds of configurations to learn about stream processing. </p><p>Throughout this article, I also share what I learned after running these scenarios. </p><p>We will go through them one by one. </p><blockquote><p><em><strong>Note 1</strong>: This project is developed with the help of Claude. The planning, design and intention still from myself.</em> </p><p><em><strong>Note 2</strong>: This project aims to dive deeper into the technical aspects of stream processing, so we will skip the "business" aspect here. If you're building a side project to learn the full data engineering lifecycle or strengthen your resume, I still recommend focusing on the business value and doing data modeling before moving on other things.</em></p></blockquote><div><hr></div><h1>Prerequisite</h1><p>This project requires you to have experience working with Python and Docker. Also, it would be great if you read or learned Kafka, Flink, and ClickHouse fundamentals, as well as stream processing concepts (event/process time, windowing, watermarking, &#8230;) beforehand. </p><p>If not, I suggest you read <a href="/__u/open.substack.com/pub/vutr/p/how-to-start-learning-stream-processing?r=2rj6sg&amp;utm_campaign=post&amp;utm_medium=web">this article</a> first.</p><div><hr></div><h1>Set up</h1><p>You can follow along by cloning the <a href="https://github.com/vutrinh274/stream_processing_project">GitHub repo here</a>.</p><p>After cloning, make sure you&#8217;re in the folder and start the Docker containers:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;4d79e146-d572-4d37-8d09-593a8eed4e07&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">docker compose up -d --build</code></pre></div><p>The project has three main components:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!2th-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!2th-!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png 424w, /__u/substackcdn.com/image/fetch/$s_!2th-!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png 848w, /__u/substackcdn.com/image/fetch/$s_!2th-!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png 1272w, /__u/substackcdn.com/image/fetch/$s_!2th-!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!2th-!,w_2400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png" width="1200" height="278.57142857142856" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;large&quot;,&quot;height&quot;:338,&quot;width&quot;:1456,&quot;resizeWidth&quot;:1200,&quot;bytes&quot;:131741,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/209201442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-large" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!2th-!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png 424w, /__u/substackcdn.com/image/fetch/$s_!2th-!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png 848w, /__u/substackcdn.com/image/fetch/$s_!2th-!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png 1272w, /__u/substackcdn.com/image/fetch/$s_!2th-!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0f43525-17a0-4799-b267-e8b139ec47e2_1850x430.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p>Kafka for message absorption: A single Kafka broker container that exposes port 9092. We will publish messages using this port.</p></li><li><p>Flink for stream processing: two containers:</p><ul><li><p>Flink JobManager container that exposes port 8081. We will submit a Flink job using this port. Also, access localhost:8081 for the Flink UI.</p></li><li><p>Flink TaskManager container is where the Flink job is executed. The TaskManager will have 6 slots. We will understand what these slots mean later.</p></li></ul></li><li><p>ClickHouse is the destination: a single container that exposes port 8123.</p></li></ul><p>Prometheus and Grafana are also there for observability. All the Grafana charts&#8217; configurations can be found in <code>charts.json</code></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!aT89!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24c735b5-6259-4361-9c25-0320450da46e_1308x504.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!aT89!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24c735b5-6259-4361-9c25-0320450da46e_1308x504.png 424w, /__u/substackcdn.com/image/fetch/$s_!aT89!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24c735b5-6259-4361-9c25-0320450da46e_1308x504.png 848w, /__u/substackcdn.com/image/fetch/$s_!aT89!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24c735b5-6259-4361-9c25-0320450da46e_1308x504.png 1272w, /__u/substackcdn.com/image/fetch/$s_!aT89!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24c735b5-6259-4361-9c25-0320450da46e_1308x504.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!aT89!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24c735b5-6259-4361-9c25-0320450da46e_1308x504.png" width="634" height="244.29357798165137" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/24c735b5-6259-4361-9c25-0320450da46e_1308x504.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:504,&quot;width&quot;:1308,&quot;resizeWidth&quot;:634,&quot;bytes&quot;:65527,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/209201442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24c735b5-6259-4361-9c25-0320450da46e_1308x504.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!aT89!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24c735b5-6259-4361-9c25-0320450da46e_1308x504.png 424w, /__u/substackcdn.com/image/fetch/$s_!aT89!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24c735b5-6259-4361-9c25-0320450da46e_1308x504.png 848w, /__u/substackcdn.com/image/fetch/$s_!aT89!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24c735b5-6259-4361-9c25-0320450da46e_1308x504.png 1272w, /__u/substackcdn.com/image/fetch/$s_!aT89!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24c735b5-6259-4361-9c25-0320450da46e_1308x504.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You can access the Grafana UI for monitoring metrics via localhost:3000. The dashboard name is &#8220;Stream Processing Project&#8221;</p><p>&#8212;</p><p>Then install the Python libraries for some related Python scripts.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!CMZX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!CMZX!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png 424w, /__u/substackcdn.com/image/fetch/$s_!CMZX!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png 848w, /__u/substackcdn.com/image/fetch/$s_!CMZX!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png 1272w, /__u/substackcdn.com/image/fetch/$s_!CMZX!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!CMZX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png" width="571" height="265.8948497854077" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:434,&quot;width&quot;:932,&quot;resizeWidth&quot;:571,&quot;bytes&quot;:94163,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/209201442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!CMZX!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png 424w, /__u/substackcdn.com/image/fetch/$s_!CMZX!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png 848w, /__u/substackcdn.com/image/fetch/$s_!CMZX!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png 1272w, /__u/substackcdn.com/image/fetch/$s_!CMZX!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bfec3cf-6acf-4be7-89b8-4991c40064f8_932x434.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;3f92173e-3bd7-4355-9703-e3a5fa1bc225&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">uv sync
source .venv/bin/activate</code></pre></div><p>Those Python scripts are:</p><ul><li><p><code>event_gen.py</code>: the synthetic clickstream event generator. Its job is to simulate user sessions moving through a funnel (page_view &#8594; product_view &#8594; add_to_cart &#8594; purchase). Each event will be ~1KB. We will use logic in this script for our source data in this project.</p></li><li><p><code>producer.py</code>: a configurable Kafka producer logic. Leverage <code>event_gen.py</code> for generating events and publishing them (to Kafka). Accept inputs from outside to control running duration, the Kafka batch size, or the linger ms. </p></li><li><p><code>multi_producer.py</code>: run several <code>producer.py</code> processes in parallel.</p></li><li><p><code>event_injector.py</code>: publishes a set of ad-hoc events (from a JSON spec file) with controllable <code>event_time</code> and send-order. It is used for the two scenarios that we observe on the correctness (basic window sum, late-event threshold).</p></li><li><p><code>run_experiment.py</code>: this is the scenario runner. It reads <code>experiments/scenarios.yml</code> to get each scenario&#8217;s configuration and automates each scenario: Flink TaskManager resource limiting, Kafka topic recreation, Flink job cancel/submit, launching producers, and printing a pipeline measurement report at the end.</p></li><li><p><code>windowed_revenue.py</code>: the PyFlink job that reads <code>clickstream</code> from Kafka, counts every event (no filtering) in a tumbling window grouped by (category, country), writes results to ClickHouse.</p></li><li><p><code>raw_event_sink.py</code>: simpler PyFlink job with no-windowing logic. Writes every event straight to ClickHouse as its own row (no aggregation), used to measure true single-event latency.</p></li></ul><div><hr></div><h1>Understand TaskSlot</h1><p>For Flink execution resources in this project, we set the number of TaskSlots to 6.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Gx3Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3f40329-3399-4813-bc67-a7158e7c505e_488x38.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Gx3Q!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3f40329-3399-4813-bc67-a7158e7c505e_488x38.png 424w, /__u/substackcdn.com/image/fetch/$s_!Gx3Q!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3f40329-3399-4813-bc67-a7158e7c505e_488x38.png 848w, /__u/substackcdn.com/image/fetch/$s_!Gx3Q!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3f40329-3399-4813-bc67-a7158e7c505e_488x38.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Gx3Q!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3f40329-3399-4813-bc67-a7158e7c505e_488x38.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Gx3Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3f40329-3399-4813-bc67-a7158e7c505e_488x38.png" width="488" height="38" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c3f40329-3399-4813-bc67-a7158e7c505e_488x38.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:38,&quot;width&quot;:488,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7890,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/209201442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3f40329-3399-4813-bc67-a7158e7c505e_488x38.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!Gx3Q!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3f40329-3399-4813-bc67-a7158e7c505e_488x38.png 424w, /__u/substackcdn.com/image/fetch/$s_!Gx3Q!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3f40329-3399-4813-bc67-a7158e7c505e_488x38.png 848w, /__u/substackcdn.com/image/fetch/$s_!Gx3Q!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3f40329-3399-4813-bc67-a7158e7c505e_488x38.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Gx3Q!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3f40329-3399-4813-bc67-a7158e7c505e_488x38.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>But what is a TaskSlot?</p><p>A TaskManager is a JVM process, whereas a TaskSlot is a piece of the resource within that process.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!yAFN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!yAFN!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png 424w, /__u/substackcdn.com/image/fetch/$s_!yAFN!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png 848w, /__u/substackcdn.com/image/fetch/$s_!yAFN!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png 1272w, /__u/substackcdn.com/image/fetch/$s_!yAFN!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!yAFN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png" width="504" height="337.8162162162162" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:744,&quot;width&quot;:1110,&quot;resizeWidth&quot;:504,&quot;bytes&quot;:165084,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/209201442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!yAFN!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png 424w, /__u/substackcdn.com/image/fetch/$s_!yAFN!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png 848w, /__u/substackcdn.com/image/fetch/$s_!yAFN!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png 1272w, /__u/substackcdn.com/image/fetch/$s_!yAFN!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f4e75e4-74df-4a0d-89ef-cc16e3c9ac38_1110x744.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>The TaskManager&#8217;s  memory is shared between the slots.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!X4lv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!X4lv!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png 424w, /__u/substackcdn.com/image/fetch/$s_!X4lv!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png 848w, /__u/substackcdn.com/image/fetch/$s_!X4lv!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png 1272w, /__u/substackcdn.com/image/fetch/$s_!X4lv!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!X4lv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png" width="403" height="525.0239043824702" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:654,&quot;width&quot;:502,&quot;resizeWidth&quot;:403,&quot;bytes&quot;:65224,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/209201442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!X4lv!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png 424w, /__u/substackcdn.com/image/fetch/$s_!X4lv!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png 848w, /__u/substackcdn.com/image/fetch/$s_!X4lv!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png 1272w, /__u/substackcdn.com/image/fetch/$s_!X4lv!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b1ba416-61c8-4723-b227-b8dbde9bd712_502x654.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>There is no CPU isolation between the TaskSlots.</p></li><li><p>By default, a slot can run subtasks of different tasks as long as they are from the same job.</p><blockquote><p><em>A Flink job is a dataflow graph with a series of transformation. You can think of task is a step in it where subtask is a parallel unit execution of a task.</em></p></blockquote><ul><li><p>This mechanism is called slot sharing. Tasks that share the same slot-sharing group can be executed in the same slot and, thus, share resources. By default, all tasks are assigned the same <code>SlotSharingGroup</code>, called <code>default</code></p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!rgMc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!rgMc!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png 424w, /__u/substackcdn.com/image/fetch/$s_!rgMc!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png 848w, /__u/substackcdn.com/image/fetch/$s_!rgMc!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png 1272w, /__u/substackcdn.com/image/fetch/$s_!rgMc!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!rgMc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png" width="318" height="352.78125" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:568,&quot;width&quot;:512,&quot;resizeWidth&quot;:318,&quot;bytes&quot;:50919,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/209201442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!rgMc!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png 424w, /__u/substackcdn.com/image/fetch/$s_!rgMc!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png 848w, /__u/substackcdn.com/image/fetch/$s_!rgMc!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png 1272w, /__u/substackcdn.com/image/fetch/$s_!rgMc!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0697fed1-0920-4dbb-a7a1-1149f9c14e0b_512x568.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li><li><p>This means that a slot can hold one parallel job instance, which by default can contain one subtask from each task in the job. In our scenarios, the Flink job will have two tasks (e.g., A and B); each will have 6 subtasks that run in parallel (e.g., A1, A2&#8230;, B1, B2&#8230;), for a total of 12 subtasks. Because subtasks from different tasks can run on the same slot, these 12 subtasks can share 6 slots, for example:</p><ul><li><p>Slot 1: A1 + B1</p></li><li><p>Slot 2: A2 + B2</p></li><li><p>Slot 3: A3 + B3</p></li><li><p>Slot 4: A4 + B4</p></li><li><p>Slot 5: A5 + B5</p></li><li><p>Slot 6: A6 + B6</p></li></ul></li></ul><p>Now let&#8217;s jump on the first scenario.</p><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=209201442&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=209201442"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div>
      <p>
          <a href="/__u/vutr.substack.com/p/a-stream-processing-project-right">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[[FREE] What Is a Data Contract?]]></title><description><![CDATA[Context, definition, and implementation (based on my imagination)]]></description><link>https://vutr.substack.com/p/what-is-a-data-contract</link><guid isPermaLink="false">https://vutr.substack.com/p/what-is-a-data-contract</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Thu, 13 Aug 2026 05:15:22 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ypFR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=205485370&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=205485370"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ypFR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ypFR!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!ypFR!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!ypFR!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ypFR!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ypFR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:125901,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ypFR!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!ypFR!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!ypFR!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ypFR!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b891176-a675-489d-8253-207d8df9aad5_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>Intro</h1><p>Over the last 3&#8211;4 years, several key terms have gained popularity.</p><p>Some I&#8217;ve had the chance to learn and apply; others still leave me skeptical.</p><p>One of them is the &#8220;data contract&#8221;. </p><p>In this article, I want to look into this concept to understand what it is, its motivation, and how it would be applied.</p><p>Note that I don&#8217;t have any prior experience with data contracts, so I&#8217;m approaching the topic with a bit of skepticism, based purely on my experience and observation.</p><p>So, enjoy :d</p><div><hr></div><h1>Context</h1><p>I found the term &#8220;data contract&#8221; the same way you guys probably do, scrolling LinkedIn and seeing it stands next to words like &#8220;data mesh&#8221; or &#8220;data product&#8221;. </p><p>&#8220;Is it a thing? Is it legit? &#8220;</p><p>&#8212;</p><p>Software engineers have had API contracts for a long time.</p><p>It&#8217;s an agreement that hides complex, internal things and only exposes what the API consumer needs.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!O7Ly!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!O7Ly!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png 424w, /__u/substackcdn.com/image/fetch/$s_!O7Ly!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png 848w, /__u/substackcdn.com/image/fetch/$s_!O7Ly!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png 1272w, /__u/substackcdn.com/image/fetch/$s_!O7Ly!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!O7Ly!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png" width="1456" height="415" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:415,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:70270,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!O7Ly!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png 424w, /__u/substackcdn.com/image/fetch/$s_!O7Ly!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png 848w, /__u/substackcdn.com/image/fetch/$s_!O7Ly!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png 1272w, /__u/substackcdn.com/image/fetch/$s_!O7Ly!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8d18e81-2096-4d58-a382-6386888bfb79_1612x460.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>By doing it this way, the producer can change things behind the scenes without any worry about breaking the interface for anyone who depends on them.</p><blockquote><p><em>Sound very like the object oriented huh?</em></p></blockquote><p>&#8212;</p><p><a href="https://andrew-jones.com/">Andrew Jones</a> is widely recognized for introducing the &#8220;data contract&#8221; in 2021, while building the data platform at GoCardless, treating data as a product with explicit interfaces to manage data quality, ownership, and governance.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!CXBN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!CXBN!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png 424w, /__u/substackcdn.com/image/fetch/$s_!CXBN!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png 848w, /__u/substackcdn.com/image/fetch/$s_!CXBN!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png 1272w, /__u/substackcdn.com/image/fetch/$s_!CXBN!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!CXBN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png" width="550" height="212.8482972136223" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:1292,&quot;resizeWidth&quot;:550,&quot;bytes&quot;:39484,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!CXBN!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png 424w, /__u/substackcdn.com/image/fetch/$s_!CXBN!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png 848w, /__u/substackcdn.com/image/fetch/$s_!CXBN!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png 1272w, /__u/substackcdn.com/image/fetch/$s_!CXBN!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7748b766-9999-4b72-8ebb-f93df31e185e_1292x500.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>His point is that almost every data platform begins with pulling data out of an organization's OLTP databases, where the data was designed for the company applications. This means we (usually data engineers) have to put a lot of effort into adapting it into something useful for analytical reporting or modeling.</p><p>Disasters happen when changes are made to the source without the consuming team being fully aware. Breaking changes and data migrations are part of any backend application lifecycle.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!D9B-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!D9B-!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png 424w, /__u/substackcdn.com/image/fetch/$s_!D9B-!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png 848w, /__u/substackcdn.com/image/fetch/$s_!D9B-!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png 1272w, /__u/substackcdn.com/image/fetch/$s_!D9B-!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!D9B-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png" width="558" height="227.2398190045249" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:540,&quot;width&quot;:1326,&quot;resizeWidth&quot;:558,&quot;bytes&quot;:61961,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!D9B-!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png 424w, /__u/substackcdn.com/image/fetch/$s_!D9B-!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png 848w, /__u/substackcdn.com/image/fetch/$s_!D9B-!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png 1272w, /__u/substackcdn.com/image/fetch/$s_!D9B-!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe49e0d6b-51af-4657-b163-1ae5db2d7691_1326x540.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Because the data is organized to serve the applications, the engineers responsible for making these changes may not understand how they affect the way the data is used in the OLAP realm.</p><p>He proposes to stop exposing the internal shape of the data inside the source system. Instead, design a separate, deliberate structure for what we hand downstream, one that stays stable even when the source changes underneath it.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!DlN4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!DlN4!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png 424w, /__u/substackcdn.com/image/fetch/$s_!DlN4!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png 848w, /__u/substackcdn.com/image/fetch/$s_!DlN4!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png 1272w, /__u/substackcdn.com/image/fetch/$s_!DlN4!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!DlN4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png" width="522" height="183.91895604395606" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:513,&quot;width&quot;:1456,&quot;resizeWidth&quot;:522,&quot;bytes&quot;:78773,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!DlN4!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png 424w, /__u/substackcdn.com/image/fetch/$s_!DlN4!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png 848w, /__u/substackcdn.com/image/fetch/$s_!DlN4!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png 1272w, /__u/substackcdn.com/image/fetch/$s_!DlN4!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee08c0e-30c8-473e-86e3-c86df591d9ce_1778x626.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>So when something changes in the source, we don&#8217;t just expose the change as-is; we produce an interface designed for consumption, decoupled from how that data is represented internally.</p><p>Then treat that downstream-facing structure with the same discipline software engineers already apply to customer-facing APIs: document it, version it (and try not to break it)</p><div><hr></div><h1>What is it?</h1><p>Set aside the context; what is a data contract, at the most basic level?</p><p>A <strong>data</strong> contract is an agreement between <strong>data</strong> producers and <strong>data</strong> consumers.</p><p>It has details that link the business side (the logical meaning of the data) with the technical side (how it's physically implemented), plus extra metadata like data quality rules, SLAs, and expected behavior.</p><p>&#8212;</p><p>Instead of a contract between two services, a data contract sits between whoever generates the data and whoever consumes it.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!L7s5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!L7s5!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png 424w, /__u/substackcdn.com/image/fetch/$s_!L7s5!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png 848w, /__u/substackcdn.com/image/fetch/$s_!L7s5!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png 1272w, /__u/substackcdn.com/image/fetch/$s_!L7s5!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!L7s5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png" width="1094" height="236" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:236,&quot;width&quot;:1094,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53232,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!L7s5!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png 424w, /__u/substackcdn.com/image/fetch/$s_!L7s5!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png 848w, /__u/substackcdn.com/image/fetch/$s_!L7s5!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png 1272w, /__u/substackcdn.com/image/fetch/$s_!L7s5!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe59ff062-be67-414b-8f81-92eb61b2db95_1094x236.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>It&#8217;s a promise about well-modeled, high-quality, trusted data, and the producers try hard to provide these properties.</p><p>&#8212;</p><p>Effective data contracts typically include four things:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Px5T!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc603832-e8c2-4544-b516-138647887520_684x770.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Px5T!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc603832-e8c2-4544-b516-138647887520_684x770.png 424w, /__u/substackcdn.com/image/fetch/$s_!Px5T!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc603832-e8c2-4544-b516-138647887520_684x770.png 848w, /__u/substackcdn.com/image/fetch/$s_!Px5T!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc603832-e8c2-4544-b516-138647887520_684x770.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Px5T!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc603832-e8c2-4544-b516-138647887520_684x770.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Px5T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc603832-e8c2-4544-b516-138647887520_684x770.png" width="306" height="344.4736842105263" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fc603832-e8c2-4544-b516-138647887520_684x770.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:770,&quot;width&quot;:684,&quot;resizeWidth&quot;:306,&quot;bytes&quot;:43900,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc603832-e8c2-4544-b516-138647887520_684x770.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Px5T!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc603832-e8c2-4544-b516-138647887520_684x770.png 424w, /__u/substackcdn.com/image/fetch/$s_!Px5T!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc603832-e8c2-4544-b516-138647887520_684x770.png 848w, /__u/substackcdn.com/image/fetch/$s_!Px5T!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc603832-e8c2-4544-b516-138647887520_684x770.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Px5T!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc603832-e8c2-4544-b516-138647887520_684x770.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>Schema: field names, data types, and relationships between elements)</p></li><li><p>Ownership: which team or individual is responsible for maintaining it. This information helps streamline communication when something breaks or needs to be discussed. (or someone to blame)</p></li><li><p>Service level objectives: agreed-upon metrics like update frequency, acceptable error rates, and response times. This sets expectations for how data should be delivered.</p></li><li><p>Version information: how the contract has changed over time</p></li></ul><p>It&#8217;s essentially a digital record &#8212; it could be a JSON or YAML file.</p><p>&#8212;</p><p>It's just a digital record to &#8230; record the promise; so, how could it be enforced?</p><div><hr></div><h1>How we implement it</h1><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=210242401&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=210242401"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><p>The data contract itself doesn't enforce anything.</p><p>It's just the source of truth.</p><p>The enforcement happens in the actions around it.</p><p>It&#8217;s mostly found in:</p><ul><li><p>CI checks that validate the contract before deployment: contract violations block the deployment.</p></li><li><p>Production validation that runs against the live dataset: confirming schema, quality, and SLA commitments are genuinely being met once data is actually flowing (what pre-deployment checks missed)</p></li><li><p>Consumer-side checks: critical consumers run their own validation on top of everything, confirming what they&#8217;re actually receiving matches what the contract promised.</p></li></ul><p>Essentially, it&#8217;s schema checking, plus other promises. Remember from the previous section: a contract isn&#8217;t only a schema; it also carries ownership and service level objectives, like update frequency and acceptable error rates.</p><p>So enforcement has to check more than &#8220;are the field names and types right.&#8221; It has to check whether the data is actually showing up on time.</p><div><hr></div><h1>The contract standard and validation engine</h1><h2>The contract</h2><p>As discussed, a contract is just a record.</p><p>However, it must follow some structure to allow the validation engine to access it, and more importantly, I think it should have a standard to standardize the implementation.</p><p>When searching online, the dominant one I found right now is the <a href="https://bitol-io.github.io/open-data-contract-standard/v3.1.0/">Open Data Contract Standard (ODCS),</a> governed by Bitol, a Linux Foundation project. ODCS leverages YAML as its format, which makes contracts easy to version and manage. So the contract itself, the actual document with the ID, status, description, schema, and everything else, is written as a <code>.yaml</code> file. It&#8217;s supported by many <a href="https://bitol-io.github.io/open-data-contract-standard/v3.1.0/vendors/">vendors</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Sejy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02bbdf69-a865-4537-b648-6985abc28277_384x414.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Sejy!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02bbdf69-a865-4537-b648-6985abc28277_384x414.png 424w, /__u/substackcdn.com/image/fetch/$s_!Sejy!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02bbdf69-a865-4537-b648-6985abc28277_384x414.png 848w, /__u/substackcdn.com/image/fetch/$s_!Sejy!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02bbdf69-a865-4537-b648-6985abc28277_384x414.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Sejy!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02bbdf69-a865-4537-b648-6985abc28277_384x414.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Sejy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02bbdf69-a865-4537-b648-6985abc28277_384x414.png" width="230" height="247.96875" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/02bbdf69-a865-4537-b648-6985abc28277_384x414.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:414,&quot;width&quot;:384,&quot;resizeWidth&quot;:230,&quot;bytes&quot;:12597,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02bbdf69-a865-4537-b648-6985abc28277_384x414.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Sejy!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02bbdf69-a865-4537-b648-6985abc28277_384x414.png 424w, /__u/substackcdn.com/image/fetch/$s_!Sejy!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02bbdf69-a865-4537-b648-6985abc28277_384x414.png 848w, /__u/substackcdn.com/image/fetch/$s_!Sejy!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02bbdf69-a865-4537-b648-6985abc28277_384x414.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Sejy!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02bbdf69-a865-4537-b648-6985abc28277_384x414.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>That YAML file is then checked for validity using a separate JSON Schema that Bitol publishes alongside the standard: a JSON Schema for ODCS is provided specifically so it can be imported into an IDE or a validator to check whether a given YAML file is a valid contract (based on ODCS).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!TTmm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!TTmm!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png 424w, /__u/substackcdn.com/image/fetch/$s_!TTmm!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png 848w, /__u/substackcdn.com/image/fetch/$s_!TTmm!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TTmm!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!TTmm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png" width="324" height="317.58415841584156" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:594,&quot;width&quot;:606,&quot;resizeWidth&quot;:324,&quot;bytes&quot;:39968,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!TTmm!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png 424w, /__u/substackcdn.com/image/fetch/$s_!TTmm!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png 848w, /__u/substackcdn.com/image/fetch/$s_!TTmm!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TTmm!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F215674be-d689-4bd6-917b-5b725a5eb8db_606x594.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The YAML gets checked against the JSON Schema, which defines every required and optional field, its expected type, and the rules attached to it.</p><p>In the ODCS YAML file, there are:</p><blockquote><p><em>You can view the ODCS YAML example <a href="https://bitol-io.github.io/open-data-contract-standard/v3.1.0/examples/all/full-example/">here</a>.</em></p></blockquote><p>Identity fields:</p><ul><li><p>a unique ID (to avoid naming collisions)</p></li><li><p>a name</p></li><li><p>a version number</p></li><li><p>a status: &#8220;proposed,&#8221; &#8220;draft,&#8221; &#8220;active,&#8221; &#8220;deprecated,&#8221; or &#8220;retired,&#8221; so a contract&#8217;s lifecycle stage is explicit.</p></li></ul><p>Description fields</p><ul><li><p>purpose: the intended use for the data</p></li><li><p>limitations: technical, compliance, or legal restrictions on how it can be used</p></li><li><p>usage: the recommended way to actually consume it</p></li></ul><p>Dataset-related fields:</p><ul><li><p>datasets and schema: the data&#8217;s shape</p></li><li><p>data quality: rules like completeness or accuracy checks on individual columns</p></li><li><p>stakeholders and roles: who&#8217;s accountable, and for what part</p></li><li><p>service-level agreements: what response time or freshness is promised</p></li></ul><h2>The validation engine</h2><p>As discussed, a piece of YAML file doesn&#8217;t enforce anything. There must be a validation engine. </p><p>An ideal engine must validate those things:</p><ul><li><p><strong>The contract&#8217;s format</strong>: is in the correct format?</p></li><li><p><strong>Schema validation</strong>: does the data still match the structure the contract promised? Field names and types are correct; nothing is renamed or dropped underneath the consumer without warning. There must be a central place to store and version the tables&#8217; schema here. </p></li><li><p><strong>Data quality</strong>: does the data &#8220;behave&#8221; the way it&#8217;s supposed to? This covers things like completeness, validity (does it fall within expected values), uniqueness (no unintended duplicates), volume (roughly the expected amount arrived), or freshness (it showed up when it was supposed to).</p></li></ul><blockquote><p><em>However, there are some gaps I believe the programmatic engine cannot validate. It is the dataset&#8217;s purpose, usage, and limitations. They are free-text description fields, written for a human to read. These are more like guidelines than measurable rules.</em> </p></blockquote><p>&#8212;</p><p>Based on my imagination, the validation engine must be observed as two parts: the rule engine and the compute engine. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!2bt3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!2bt3!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png 424w, /__u/substackcdn.com/image/fetch/$s_!2bt3!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png 848w, /__u/substackcdn.com/image/fetch/$s_!2bt3!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png 1272w, /__u/substackcdn.com/image/fetch/$s_!2bt3!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!2bt3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png" width="1456" height="594" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:594,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:84107,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!2bt3!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png 424w, /__u/substackcdn.com/image/fetch/$s_!2bt3!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png 848w, /__u/substackcdn.com/image/fetch/$s_!2bt3!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png 1272w, /__u/substackcdn.com/image/fetch/$s_!2bt3!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad6540b-dceb-4025-b84b-0914904b6dae_1524x622.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Contract&#8217;s format and schema validation is lightweight, as it only touches a small amount of metadata.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!8IxP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!8IxP!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png 424w, /__u/substackcdn.com/image/fetch/$s_!8IxP!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png 848w, /__u/substackcdn.com/image/fetch/$s_!8IxP!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png 1272w, /__u/substackcdn.com/image/fetch/$s_!8IxP!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!8IxP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png" width="402" height="323.5451612903226" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:998,&quot;width&quot;:1240,&quot;resizeWidth&quot;:402,&quot;bytes&quot;:139861,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!8IxP!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png 424w, /__u/substackcdn.com/image/fetch/$s_!8IxP!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png 848w, /__u/substackcdn.com/image/fetch/$s_!8IxP!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png 1272w, /__u/substackcdn.com/image/fetch/$s_!8IxP!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5112165c-d8d1-49d2-9a16-ede58bc078b5_1240x998.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>However, data quality is a different story.</p><p>Although some rules can be checked using metadata (e.g., updated time to check freshness), most data rules require data scanning; compute engine resources must be a concern here. Ideally, this engine is also the one your company uses for data transformation to avoid syntax mismatch. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Y8-4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Y8-4!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png 424w, /__u/substackcdn.com/image/fetch/$s_!Y8-4!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png 848w, /__u/substackcdn.com/image/fetch/$s_!Y8-4!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Y8-4!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Y8-4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png" width="496" height="308.45297504798464" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:648,&quot;width&quot;:1042,&quot;resizeWidth&quot;:496,&quot;bytes&quot;:59575,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Y8-4!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png 424w, /__u/substackcdn.com/image/fetch/$s_!Y8-4!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png 848w, /__u/substackcdn.com/image/fetch/$s_!Y8-4!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Y8-4!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea20f7f3-76e5-4881-9c5f-9f3882a0a535_1042x648.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>However, this does not rule out using different compute engines for different contract validation use cases. For example, near-real-time validation could use Spark Streaming or Flink.</p><p>&#8212;</p><p>Also, the validation engine should be flexible enough to allow the user to add or adjust rules. This is where the rule engine comes into play; it stores all the rules somewhere and exposes a method to let the user interact with the rule. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!YwTV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!YwTV!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png 424w, /__u/substackcdn.com/image/fetch/$s_!YwTV!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png 848w, /__u/substackcdn.com/image/fetch/$s_!YwTV!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png 1272w, /__u/substackcdn.com/image/fetch/$s_!YwTV!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!YwTV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png" width="544" height="163.74129353233832" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:242,&quot;width&quot;:804,&quot;resizeWidth&quot;:544,&quot;bytes&quot;:23788,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!YwTV!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png 424w, /__u/substackcdn.com/image/fetch/$s_!YwTV!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png 848w, /__u/substackcdn.com/image/fetch/$s_!YwTV!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png 1272w, /__u/substackcdn.com/image/fetch/$s_!YwTV!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b620cec-15a2-4d57-90a1-1f6ecb7c1e10_804x242.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The crucial thing to note is that there is no single tool called the &#8220;validation engine&#8220;, it must be a solution where the technical component depends on the organization's requirements and context. </p><p>It could be Great Expectations, dbt test, or a self-development solution for the engine rule.</p><p>It could be Databricks, BigQuery, Snowflake, Trino, Spark, Flink, or DuckDB for the compute engine.</p><p>&#8212;</p><p>Although the idea of a data contract is attractive, implementing it is not easy. The contract recording is just the tip of the iceberg. You also need to build the validation engine for it, which requires as much effort as the main data pipelines. </p><p>However, the obstacle of data contracts does not stop at the technical side.</p><div><hr></div><h1>The cultural obstacle</h1><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!0DeP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!0DeP!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png 424w, /__u/substackcdn.com/image/fetch/$s_!0DeP!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png 848w, /__u/substackcdn.com/image/fetch/$s_!0DeP!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0DeP!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!0DeP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png" width="346" height="235" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:470,&quot;width&quot;:692,&quot;resizeWidth&quot;:346,&quot;bytes&quot;:57293,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/210242401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!0DeP!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png 424w, /__u/substackcdn.com/image/fetch/$s_!0DeP!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png 848w, /__u/substackcdn.com/image/fetch/$s_!0DeP!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0DeP!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8f44033-ae08-4520-9aff-9fbf12f71281_692x470.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Data contracts are not a familiar concept like &#8220;data warehouse&#8220;, &#8220;ETL&#8220;, &#8220;data lake&#8220; or &#8220;data quality&#8220;.  </p><p>Not to mention that applying it requires time and resource investment.</p><p>Also, it can easily become something people feel like they have to do rather than something they want to do for the benefits it brings.</p><p>The tools can&#8217;t fix this; it requires mindset shifting. </p><p>How do you convince the CEO to invest time and resources in a data contract?</p><p>How do you convince the data producer to follow through on the &#8220;promises&#8221;?</p><p>How do you convince consumers to validate the dataset based on the contract?</p><p>These actions give people more work to do and add more time to the overall raw-to-insight process. That takes a lot of education and alignment, which involves many people. And whenever something involves a lot of people, it&#8217;s always a hard mission.</p><p>&#8212;</p><p>I&#8217;m writing this section to identify the culture obstacle, not to solve it. It&#8217;s more about bringing awareness. That said, I&#8217;d guess one of the first steps is starting with the organization&#8217;s current, specific problem, and elaborating on how a data contract would actually help with that.</p><p>An MVP built around a data contract can help catch issues that would have already happened before they reach production. That kind of concrete.</p><div><hr></div><h1>Outro</h1><p>In this article, I tried to learn and research data contracts, a fairly new concept in data engineering. <span>We started with its context, what it is, and how to implement it with the&nbsp;</span><em><strong><span>contract encoding</span></strong></em><span>&nbsp;and the </span><em><strong><span>validation engine</span></strong></em><span>.</span> Finally, I laid out some thoughts about the obstacles to data contract implementation; besides the technical, mindset shifting is also a big one.</p><p>Thank you for reading this far; see you in my next article.</p><div><hr></div><h1>Reference</h1><p><em>[1] Andrew Jones, <a href="https://andrew-jones.com/blog/data-contracts/">Data Contracts</a> (2021)</em></p><p><em>[2] Andrew Jones, <a href="https://medium.com/selectstar/a-guide-to-data-contracts-with-andrew-jones-95acd897faa5">A Guide to Data Contracts with Andrew Jones</a> (2025)</em></p>]]></content:encoded></item><item><title><![CDATA[How to start learning stream processing from zero?]]></title><description><![CDATA[The dataflow model, throughput and latency, and the tools]]></description><link>https://vutr.substack.com/p/how-to-start-learning-stream-processing</link><guid isPermaLink="false">https://vutr.substack.com/p/how-to-start-learning-stream-processing</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Tue, 11 Aug 2026 05:16:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lYnp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=205485370&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=205485370"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!lYnp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!lYnp!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!lYnp!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!lYnp!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!lYnp!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!lYnp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:527763,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/208319564?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!lYnp!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!lYnp!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!lYnp!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!lYnp!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73611923-8490-4ae9-bc07-d13ea5424fba_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><p>You know what? After finishing this article, I realized it would be even better to have a companion article that walks through a hands-on project to reinforce the concepts covered here.</p><p>I'm designing a practical stream-processing project you can learn from. See you next week ;)</p><div><hr></div><h1>Intro</h1><p>For a long time, batch processing has been a commodity; it's easy to get your head around, it serves many use cases, and it&#8217;s straightforward to implement. </p><p>In contrast, stream processing has been like a high-end product; only big players want and use it. It has many more concepts to learn, and it&#8217;s more complex to implement than batch processing.</p><p>&#8212;</p><p>AI has changed a lot of things.</p><p>One of those is to give organizations a more compelling reason to adopt real-time analytics.</p><p>Instant business decisions, model training with the latest data, or agent observability.</p><p>(At least that is the thing a lot of data vendors are saying now)</p><p>Low-latency insights are usually the result of stream processing, the computational paradigm where data is processed continuously.</p><p>&#8212;</p><p>In this article, I share my experience and research so you can start learning stream processing on your own. </p><blockquote><p><em><strong>Important note</strong>: This is a learning guideline; it does not guarantee you can successfully run a real-time analytics project in production. That requires a lot of factors and cover them not in the scope of this article. </em></p></blockquote><div><hr></div><h1>The difference</h1><p>The first thing you have to learn is the difference between batch and stream processing. Because it will define everything you learn later, from motivation and performance monitoring to fault tolerance. </p><p>&#8212;</p><h3>Definition</h3><p>In batch processing, you gather the data over a period and then process it in a single operation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!0W-b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!0W-b!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png 424w, /__u/substackcdn.com/image/fetch/$s_!0W-b!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png 848w, /__u/substackcdn.com/image/fetch/$s_!0W-b!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0W-b!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!0W-b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png" width="490" height="297.61744966442956" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:362,&quot;width&quot;:596,&quot;resizeWidth&quot;:490,&quot;bytes&quot;:59332,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/208319564?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!0W-b!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png 424w, /__u/substackcdn.com/image/fetch/$s_!0W-b!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png 848w, /__u/substackcdn.com/image/fetch/$s_!0W-b!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0W-b!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb83a2d16-49ec-41b4-a085-3c153ce54173_596x362.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>For example, you read and process a Parquet file (with Spark or whatever framework you prefer), and then write the results somewhere.</p><p>Or, you take a snapshot of an OLTP database, transform it with SQL, and load it into the OLAP database.</p><p>The two scenarios share a property: the data is captured in a defined boundary. It could be an hour, a day, 3 days, or a week of data.</p><p>When a system processes data in a batch, it knows the size of the data, which simplifies the processing a lot. </p><p>&#8212;</p><p>For stream processing, there isn&#8217;t a defined boundary. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!j28V!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!j28V!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png 424w, /__u/substackcdn.com/image/fetch/$s_!j28V!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png 848w, /__u/substackcdn.com/image/fetch/$s_!j28V!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png 1272w, /__u/substackcdn.com/image/fetch/$s_!j28V!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!j28V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png" width="1456" height="785" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:785,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:348380,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/208319564?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!j28V!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png 424w, /__u/substackcdn.com/image/fetch/$s_!j28V!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png 848w, /__u/substackcdn.com/image/fetch/$s_!j28V!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png 1272w, /__u/substackcdn.com/image/fetch/$s_!j28V!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46bf5f6e-134e-4a58-8350-3355726678b2_1698x916.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>It follows the nature of the data flow.</p><p>Most of the data we work with doesn&#8217;t have a natural boundary; it is unbounded: from the user interaction on the website to data from IoT sensors (unless the website is down or the sensor runs out of power).</p><p>We place artificial boundaries on the data flow so the processing can happen seamlessly (batch processing)</p><h2>Data operations and fault tolerance</h2><p>When a database does aggregation and joins, it comes down to looking for records with the same key. With batch processing, the searching scope is defined. This makes the system know when the searching is done, thus finishing the aggregation or join.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!llmW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!llmW!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png 424w, /__u/substackcdn.com/image/fetch/$s_!llmW!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png 848w, /__u/substackcdn.com/image/fetch/$s_!llmW!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png 1272w, /__u/substackcdn.com/image/fetch/$s_!llmW!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!llmW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png" width="982" height="892" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:892,&quot;width&quot;:982,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:207155,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/208319564?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!llmW!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png 424w, /__u/substackcdn.com/image/fetch/$s_!llmW!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png 848w, /__u/substackcdn.com/image/fetch/$s_!llmW!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png 1272w, /__u/substackcdn.com/image/fetch/$s_!llmW!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2075104f-8412-4c6b-a8e7-c21bc6b42fba_982x892.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>With stream processing, aggregation and joins have, in theory, an infinite search space, which requires us to apply techniques (windowing and watermarks; we'll be back to these later) to limit it temporarily. </p><p>Regarding fault tolerance, you reload the batch data from the source (if the batch is still available). Typically, you reprocess the entire batch, not part of it.</p><p>In stream processing, things are different: you need to know which stream position to restart processing from, and the source must be able to &#8220;replay&#8221; the data stream from that position.</p><h2>Performance</h2><p>In a batch, the performance of the processing is usually defined by:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!TWfF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!TWfF!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png 424w, /__u/substackcdn.com/image/fetch/$s_!TWfF!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png 848w, /__u/substackcdn.com/image/fetch/$s_!TWfF!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TWfF!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!TWfF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png" width="1444" height="672" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:672,&quot;width&quot;:1444,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:162527,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/208319564?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!TWfF!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png 424w, /__u/substackcdn.com/image/fetch/$s_!TWfF!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png 848w, /__u/substackcdn.com/image/fetch/$s_!TWfF!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TWfF!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6768d4c-f4a2-43ee-af01-82031eba75da_1444x672.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>The data volume? 100GB, 1TB or 10TB</p></li><li><p>How long does processing take? 1 hour, 2 hours or 12 hours.</p></li></ul><p>Typically, these two define and identify a less straightforward factor: your required throughput.</p><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=208319564&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=208319564"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div>
      <p>
          <a href="/__u/vutr.substack.com/p/how-to-start-learning-stream-processing">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[How to learn Python effectively]]></title><description><![CDATA[...as a data engineer]]></description><link>https://vutr.substack.com/p/how-to-learn-python-effectively</link><guid isPermaLink="false">https://vutr.substack.com/p/how-to-learn-python-effectively</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Tue, 04 Aug 2026 05:15:16 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4Mef!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207376654&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207376654"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!4Mef!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!4Mef!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!4Mef!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!4Mef!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!4Mef!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!4Mef!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:156738,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207376654?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!4Mef!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!4Mef!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!4Mef!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!4Mef!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a74d0ae-13ae-4fea-890b-02e341c57f20_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>Intro</h1><p>I bet some of you might think like:</p><p>&#8220;AI can code better than us; why would I need to learn to code anymore?&#8221;</p><p>I thought that too. I hesitated a bit: &#8220;Is this article necessary?&#8220;</p><p>After reflecting on my journey with Python, from 6 years ago to when I delegated nearly all code writing to AI 6 months ago, I came to this conclusion: learning to code (Python) still matters, especially in this era when nearly everyone on the Internet tells you not to.</p><blockquote><p><em><strong>Note</strong>: All my sharing here, including my attitude toward AI coding tools, is purely from my observation and experience.</em></p></blockquote><p>What you're reading is my approach to learning Python effectively as a data engineer. It starts with understanding Python's core concepts and syntax.</p><p>Then gradually moves on to the production-ready skills you'll actually need: debugging, testing, dependency management, code organization, object-oriented programming, working with APIs, and DataFrame libraries, using familiar data engineering tools such as Airflow and Polars.</p><div><hr></div><h1>The motivation behind knowing how to do things right</h1><p>The reason I write about Python here might not be questioned much. It&#8217;s obviously the most dominant programming language in data engineering. We speak Python all the time (only less than SQL). </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ycjq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ycjq!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png 424w, /__u/substackcdn.com/image/fetch/$s_!ycjq!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png 848w, /__u/substackcdn.com/image/fetch/$s_!ycjq!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ycjq!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ycjq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png" width="466" height="283.12749003984067" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:610,&quot;width&quot;:1004,&quot;resizeWidth&quot;:466,&quot;bytes&quot;:210672,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207376654?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ycjq!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png 424w, /__u/substackcdn.com/image/fetch/$s_!ycjq!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png 848w, /__u/substackcdn.com/image/fetch/$s_!ycjq!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ycjq!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa97fcf05-0035-4e69-b101-1d81c796f878_1004x610.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Python earns that position thanks to its user-friendliness and large ecosystem of libraries, which let you do anything in data engineering.</p><p>It&#8217;s easy for humans to read and understand.</p><p>The proliferation of AI coding tools seems to make writing Python code easier.</p><p>But more Python code does not mean more quality Python code. </p><p>I don&#8217;t feel comfortable handing everything to AI, although I know it could do very well if I give it enough context, requirements, and expectations. The feeling of not knowing how the code that runs a critical function works keeps me from sleeping well. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!igtB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!igtB!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png 424w, /__u/substackcdn.com/image/fetch/$s_!igtB!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png 848w, /__u/substackcdn.com/image/fetch/$s_!igtB!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png 1272w, /__u/substackcdn.com/image/fetch/$s_!igtB!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!igtB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png" width="460" height="246.97201017811705" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:422,&quot;width&quot;:786,&quot;resizeWidth&quot;:460,&quot;bytes&quot;:56439,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207376654?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!igtB!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png 424w, /__u/substackcdn.com/image/fetch/$s_!igtB!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png 848w, /__u/substackcdn.com/image/fetch/$s_!igtB!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png 1272w, /__u/substackcdn.com/image/fetch/$s_!igtB!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a40091-bdcb-443d-8baf-d31410ac952f_786x422.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I believe we still need to engage with understanding what AI produces, not only to guarantee correctness but also to ensure scalability, readability, and maintainability.</p><p>To achieve this with Python code, we must know how to do all of that ourselves before validating the AI&#8217;s work. You still need to have an understanding of the programming language&#8217;s nature and your own experience of writing maintainable code for the AI tool.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!x6Y1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!x6Y1!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png 424w, /__u/substackcdn.com/image/fetch/$s_!x6Y1!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png 848w, /__u/substackcdn.com/image/fetch/$s_!x6Y1!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png 1272w, /__u/substackcdn.com/image/fetch/$s_!x6Y1!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!x6Y1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png" width="377" height="246.96524064171123" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:490,&quot;width&quot;:748,&quot;resizeWidth&quot;:377,&quot;bytes&quot;:61912,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207376654?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!x6Y1!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png 424w, /__u/substackcdn.com/image/fetch/$s_!x6Y1!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png 848w, /__u/substackcdn.com/image/fetch/$s_!x6Y1!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png 1272w, /__u/substackcdn.com/image/fetch/$s_!x6Y1!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24d7e1d9-378e-4fa8-bec7-41705319874d_748x490.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You can say we can achieve all of that by installing some skills for the AI; one for planning, one for reviewing, one for linting,&#8230;</p><p>That&#8217;s true; that works, even well.</p><p>But again, that&#8217;s only effective if you have the mental model for how to do things right. When you rely on an AI coding tool to do things right without knowing how to do that by yourself, two things happen:</p><ul><li><p>You lose total control of what AI produces; when issues occur and features need to be added, you rely on AI. When issues occur and features need to be added again, you rely on AI another round. It just happens like that over and over again. There is no way to get back control.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ctqk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ctqk!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png 424w, /__u/substackcdn.com/image/fetch/$s_!ctqk!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png 848w, /__u/substackcdn.com/image/fetch/$s_!ctqk!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ctqk!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ctqk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png" width="404" height="319.5962441314554" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:674,&quot;width&quot;:852,&quot;resizeWidth&quot;:404,&quot;bytes&quot;:76251,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207376654?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ctqk!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png 424w, /__u/substackcdn.com/image/fetch/$s_!ctqk!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png 848w, /__u/substackcdn.com/image/fetch/$s_!ctqk!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ctqk!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F562761d2-00ea-4d47-8b9f-220c59606ca0_852x674.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li><li><p>You will soon lose joy and motivation. For all day long, the things you need to do are enter some prompt, install some skills, and press enter 90% of the time- no thinking, no reasoning. Just tell me the difference between doing that and scrolling short videos; you&#8217;re on autopilot and rely on external factors to give you the joy.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!PbCS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!PbCS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png 424w, /__u/substackcdn.com/image/fetch/$s_!PbCS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png 848w, /__u/substackcdn.com/image/fetch/$s_!PbCS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png 1272w, /__u/substackcdn.com/image/fetch/$s_!PbCS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!PbCS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png" width="417" height="236.45108695652175" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:626,&quot;width&quot;:1104,&quot;resizeWidth&quot;:417,&quot;bytes&quot;:90220,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207376654?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!PbCS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png 424w, /__u/substackcdn.com/image/fetch/$s_!PbCS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png 848w, /__u/substackcdn.com/image/fetch/$s_!PbCS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png 1272w, /__u/substackcdn.com/image/fetch/$s_!PbCS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826f0e59-edc9-4887-8374-1c2c0476e286_1104x626.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li></ul><p>What I&#8217;m trying to say is that, to achieve long-term feasibility of using AI for coding, you must know how to do the right things.</p><p>This is why I think using an AI coding tool too early in your career is not a good idea.</p><p>You need time to practice and observe on your own to gain enough experience doing the right things when drafting code. When you hand everything over to AI, you lose the opportunity. Gradually, you will rely more and more on AI; without it, you don&#8217;t know how to do things right, and as we discussed above, that&#8217;s not feasible in the long term.</p><p>&#8212;</p><p>If you pick up any truly successful case study of vibe coding, you will reach the same conclusion yourself: the people behind those cases all have experience coding themselves, and they know how to do the right things before letting AI do that.</p><p>Don&#8217;t let some stories about a CEO pitching a product that is vibe coded completely demotivate you; that CEO will certainly lose total control over the app and hire an engineer, the one who actually knows how to code, to help him.</p><p>Now, after being on the same page on whether we need to learn code or not, let&#8217;s dive into how to learn Python effectively.</p><div><hr></div><h1>Syntax and the way you write code</h1><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207376654&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207376654"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div>
      <p>
          <a href="/__u/vutr.substack.com/p/how-to-learn-python-effectively">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Data Modeling: Kimball vs. Inmon]]></title><description><![CDATA[Normalization, their approaches and motivations.]]></description><link>https://vutr.substack.com/p/data-modeling-kimball-vs-inmon</link><guid isPermaLink="false">https://vutr.substack.com/p/data-modeling-kimball-vs-inmon</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Tue, 28 Jul 2026 05:15:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!-yJi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=206789223&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=206789223"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!-yJi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!-yJi!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!-yJi!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!-yJi!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-yJi!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!-yJi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:209938,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/206789223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!-yJi!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!-yJi!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!-yJi!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-yJi!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d70711d-42bb-4ea1-91d6-84143b2d9763_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Intro</h1><p>If you spend enough time in data engineering, you must already know the importance of data modeling; it might slow the team down a bit at first, but in the long term, it literally backs your entire data foundation.</p><p>The data model defines many things:</p><ul><li><p>Which entities are there? Customer? Device? Subscription Package?</p></li><li><p>What is the relationship between them?</p></li><li><p>Which data will be collected? Source A? Source B? Extract all the fields or just five fields?</p></li><li><p>How to calculate a metric?</p></li><li><p>Which constraints and business rules does this table have? Thus, it defines what quality data looks like.</p></li><li><p>&#8230;</p></li></ul><p>&#8212;</p><p>I used to link data modeling &#8594; dimensional modeling (Kimball), but in fact there are other data modeling approaches such as Inmon or Vault. </p><p>&#8212;</p><p>In this article, I want to deliver my understanding of the difference between the Kimball and Inmon approaches. The goal is to give you a mental model of what these approaches look like and their ultimate goals; from that, you can understand why a company chooses one or combines them. </p><blockquote><p><em><strong>Note:</strong> This article does not deep-dive into these two approaches; instead, I want to focus on the differences in how the two guide the data modeling process. </em></p></blockquote><p>But first, we will learn about data normalization and denormalization. We will spend a long time on this; it&#8217;s a good opportunity to learn about them.</p><div><hr></div><h1>Normalization vs. denormalization</h1><p>Let&#8217;s imagine we have a table with the schema:</p><ul><li><p>employee_id</p></li><li><p>certifications, which is a list of nested fields:</p><ul><li><p>{ cert_name: "AWS Certified", issuer: "Amazon", expiry: "2027-03" }</p></li><li><p>{ cert_name: "Scrum Master", issuer: "Scrum.org", expiry: "2026-11" }</p></li></ul></li><li><p>manager_id</p></li><li><p>manager_name</p></li><li><p>department.</p></li></ul><h2>Denormalization</h2><p>This table can be considered a form of denormalization, in which it can contain nested and repeated data.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ru9F!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ru9F!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png 424w, /__u/substackcdn.com/image/fetch/$s_!ru9F!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png 848w, /__u/substackcdn.com/image/fetch/$s_!ru9F!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ru9F!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ru9F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png" width="1456" height="534" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:534,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:195093,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/206789223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ru9F!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png 424w, /__u/substackcdn.com/image/fetch/$s_!ru9F!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png 848w, /__u/substackcdn.com/image/fetch/$s_!ru9F!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ru9F!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64299db8-d3bf-411c-a673-cd5b671189bc_1854x680.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When you want to answer &#8220;which certifications expire in the next 90 days&#8221;, you can&#8217;t just filter a column for it. The dates you need are nested within the &#8220;certifications&#8221; section.</p><p>You need to unpack every row&#8217;s nested object first.</p><p>Nested data like this prevents the basic database operations (which are supposed to be easy with normalization): querying and updating a single sub-value without touching the surrounding structure.</p><p>Let&#8217;s normalize it.</p><p>Database normalization is the method used to control the relationships of tables and columns (in a table). Its purpose is to avoid data redundancy, thus guaranteeing data integrity.</p><p>The concept was first introduced by Edgar Codd in the early 1970s. He also introduced normalization forms, which are sequential, with the higher one including the characteristics of the previous one and being stricter (solving more data integrity problems).</p><p> &#8212;</p><p>In my experience as a data engineer, understanding the first three forms is enough. In the next section, we will go through each form and apply it to normalize our example data to see which problem each form solves.</p><blockquote><p><em>&#8220;NF&#8221; stands for normal form</em></p></blockquote><h2>1NF</h2><p>Let&#8217;s flatten and unnest the data:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!g64Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!g64Y!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png 424w, /__u/substackcdn.com/image/fetch/$s_!g64Y!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png 848w, /__u/substackcdn.com/image/fetch/$s_!g64Y!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png 1272w, /__u/substackcdn.com/image/fetch/$s_!g64Y!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!g64Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png" width="1456" height="390" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:106062,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/206789223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!g64Y!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png 424w, /__u/substackcdn.com/image/fetch/$s_!g64Y!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png 848w, /__u/substackcdn.com/image/fetch/$s_!g64Y!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png 1272w, /__u/substackcdn.com/image/fetch/$s_!g64Y!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11e56f13-512c-44b1-94a5-065395e100a5_1462x392.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>At first, we can use the employee_id as the unique identifier for a row; after flattening, this is no longer feasible, as you can see; id 42 appears twice because this employee has two certifications: AWS and Scrum.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!j6kS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!j6kS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png 424w, /__u/substackcdn.com/image/fetch/$s_!j6kS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png 848w, /__u/substackcdn.com/image/fetch/$s_!j6kS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png 1272w, /__u/substackcdn.com/image/fetch/$s_!j6kS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!j6kS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png" width="508" height="158.1509433962264" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:198,&quot;width&quot;:636,&quot;resizeWidth&quot;:508,&quot;bytes&quot;:20439,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/206789223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!j6kS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png 424w, /__u/substackcdn.com/image/fetch/$s_!j6kS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png 848w, /__u/substackcdn.com/image/fetch/$s_!j6kS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png 1272w, /__u/substackcdn.com/image/fetch/$s_!j6kS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0d60f92-633c-4578-a027-440eaa1f1df9_636x198.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>&#8212;</p><p>To uniquely identify a row, let&#8217;s combine the employee_id + cert_id and use them as the primary key. Each row can now be addressed.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!I4uv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!I4uv!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png 424w, /__u/substackcdn.com/image/fetch/$s_!I4uv!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png 848w, /__u/substackcdn.com/image/fetch/$s_!I4uv!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png 1272w, /__u/substackcdn.com/image/fetch/$s_!I4uv!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!I4uv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png" width="1384" height="256" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:256,&quot;width&quot;:1384,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52699,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/206789223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!I4uv!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png 424w, /__u/substackcdn.com/image/fetch/$s_!I4uv!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png 848w, /__u/substackcdn.com/image/fetch/$s_!I4uv!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png 1272w, /__u/substackcdn.com/image/fetch/$s_!I4uv!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39b97fd1-602d-49a2-9a8c-ea6ca5170776_1384x256.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>By flattening the data and defining the primary key (in this case, the combination of employee_id and cert_id), we normalize it to 1NF.</p><p>In a 1NF table, each column holds a single, atomic value. The table has a unique primary key. It ensures that each row in the table has a unique identifier and that a column doesn&#8217;t contain mixed types or multiple values.</p><p>However, it still has data integrity problems. Back to our example, as you can see, the &#8220;department&#8221; and &#8220;manager_name&#8221; are now repeated across every cert record for the same employee.</p><h2>2NF</h2><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=206789223&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=206789223"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div>
      <p>
          <a href="/__u/vutr.substack.com/p/data-modeling-kimball-vs-inmon">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[[FREE] I spent 10 hours learning multithreading and multiprocessing]]></title><description><![CDATA[Mental model and putting it in Python context]]></description><link>https://vutr.substack.com/p/free-i-spent-10-hours-learning-multithreading</link><guid isPermaLink="false">https://vutr.substack.com/p/free-i-spent-10-hours-learning-multithreading</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Thu, 23 Jul 2026 05:16:13 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ti2v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207238522&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207238522"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ti2v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ti2v!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!ti2v!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!ti2v!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ti2v!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ti2v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:238131,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ti2v!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!ti2v!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!ti2v!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ti2v!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3291bef-ebe3-4b8e-8ec5-2111b716414d_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Intro</h1><p>In production environments, whether you process terabytes of data or serve 10,000 user requests per second, optimization ultimately comes down to utilizing your hardware resources as efficiently as possible to achieve the desired results.</p><p>To do that, we must understand how things work internally, especially how CPUs are utilized.</p><p>&#8212;</p><p>In this article, I outline my understanding of multithreading and multiprocessing and discuss them in the context of Python, the most widely used programming language for data engineers. </p><blockquote><p><em>This article is based purely on my understanding. If you notice anything incorrect or outdated, feel free to leave a comment.</em></p></blockquote><div class="pullquote"><p>Before discussing multithreading and multiprocessing in Python, let&#8217;s first review some concepts. </p></div><h1>Process and thread</h1><p>A <strong>process</strong> is an independent running program.</p><p>When you launch a process, the Operating System (OS) gives the process a set of separate resources that it doesn&#8217;t need to share with others, including its own piece of memory space.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!I_vq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!I_vq!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png 424w, /__u/substackcdn.com/image/fetch/$s_!I_vq!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png 848w, /__u/substackcdn.com/image/fetch/$s_!I_vq!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png 1272w, /__u/substackcdn.com/image/fetch/$s_!I_vq!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!I_vq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png" width="372" height="454.5612244897959" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:958,&quot;width&quot;:784,&quot;resizeWidth&quot;:372,&quot;bytes&quot;:95215,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!I_vq!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png 424w, /__u/substackcdn.com/image/fetch/$s_!I_vq!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png 848w, /__u/substackcdn.com/image/fetch/$s_!I_vq!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png 1272w, /__u/substackcdn.com/image/fetch/$s_!I_vq!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F718527ad-0a05-4e38-a438-f741d9a760a2_784x958.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A process never touches RAM directly.</p><p>It works with addresses the OS hands it, and the OS decides which piece of physical memory each one points to. So two processes can have data sitting next to each other in RAM and still not be able to access each other&#8217;s data. Neither one has an address that points into the other&#8217;s memory.</p><p>If they want to talk, they have to communicate via an intermediary, the OS, with mechanisms like pipes, sockets, shared memory segments, or message queues.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!doCb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!doCb!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png 424w, /__u/substackcdn.com/image/fetch/$s_!doCb!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png 848w, /__u/substackcdn.com/image/fetch/$s_!doCb!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png 1272w, /__u/substackcdn.com/image/fetch/$s_!doCb!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!doCb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png" width="454" height="390.44" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:688,&quot;width&quot;:800,&quot;resizeWidth&quot;:454,&quot;bytes&quot;:82948,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!doCb!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png 424w, /__u/substackcdn.com/image/fetch/$s_!doCb!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png 848w, /__u/substackcdn.com/image/fetch/$s_!doCb!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png 1272w, /__u/substackcdn.com/image/fetch/$s_!doCb!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff934f5d-3f44-4f27-9859-35d4a562e102_800x688.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is called <strong>inter-process communication (IPC)</strong>: data sent from one process must be serialized, passed through an OS-managed channel, and deserialized on the receiving process.</p><p>The exception is when you use shared memory; the OS maps the same physical memory pages into both address spaces.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ZvW6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ZvW6!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png 424w, /__u/substackcdn.com/image/fetch/$s_!ZvW6!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png 848w, /__u/substackcdn.com/image/fetch/$s_!ZvW6!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ZvW6!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ZvW6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png" width="412" height="359.2089136490251" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:626,&quot;width&quot;:718,&quot;resizeWidth&quot;:412,&quot;bytes&quot;:78529,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ZvW6!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png 424w, /__u/substackcdn.com/image/fetch/$s_!ZvW6!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png 848w, /__u/substackcdn.com/image/fetch/$s_!ZvW6!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ZvW6!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4544b7f1-1479-4221-9f6c-067f72dec7e9_718x626.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Process A writes to its pointer, process B reads from its pointer, and they're the same bytes in RAM. No de/serialization is needed. The challenge is to ensure that the shared memory is synchronized to prevent a race condition. </p><blockquote><p><em>A race condition occurs when the result depends on the order in which two actors happen to touch the same variable; one can overwrite the other&#8217;s work, or read a value that&#8217;s only half updated.</em></p></blockquote><p>A <strong>thread</strong> lives <em>inside</em> a process.</p><p>A single process can have multiple threads, and all of them share that process resource, including the memory space: the same heap or the same global variables.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!2L25!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!2L25!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png 424w, /__u/substackcdn.com/image/fetch/$s_!2L25!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png 848w, /__u/substackcdn.com/image/fetch/$s_!2L25!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png 1272w, /__u/substackcdn.com/image/fetch/$s_!2L25!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!2L25!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png" width="643" height="390.69546120058567" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:830,&quot;width&quot;:1366,&quot;resizeWidth&quot;:643,&quot;bytes&quot;:133245,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!2L25!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png 424w, /__u/substackcdn.com/image/fetch/$s_!2L25!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png 848w, /__u/substackcdn.com/image/fetch/$s_!2L25!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png 1272w, /__u/substackcdn.com/image/fetch/$s_!2L25!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d7ff05-974c-4d57-92fa-2bb22c978392_1366x830.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>These properties make sharing between threads cheap, as communication incurs less overhead than cross-process communication.</p><p>Also, creating a thread is lighter than creating a process.</p><p>&#8212;</p><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">In short, processes give you isolation and safety (two processes can&#8217;t see each other&#8217;s data &#8594; higher security). However, they are expensive to create and talk between.</mark></p><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Threads live inside a process. They share resources. They are cheap to create and to talk between. However, it&#8217;s unsafe by default (two threads can edit the same variable at the same time; require a mechanism to coordinate, such as locking)</mark></p><div><hr></div><h1>CPU cores</h1><p>A core is an individual processing unit inside a CPU. It fetches instructions and does the actual computing. A core runs one thread at a time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!heRn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!heRn!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png 424w, /__u/substackcdn.com/image/fetch/$s_!heRn!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png 848w, /__u/substackcdn.com/image/fetch/$s_!heRn!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png 1272w, /__u/substackcdn.com/image/fetch/$s_!heRn!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!heRn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png" width="306" height="303.57142857142856" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:750,&quot;width&quot;:756,&quot;resizeWidth&quot;:306,&quot;bytes&quot;:40627,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!heRn!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png 424w, /__u/substackcdn.com/image/fetch/$s_!heRn!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png 848w, /__u/substackcdn.com/image/fetch/$s_!heRn!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png 1272w, /__u/substackcdn.com/image/fetch/$s_!heRn!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5886e6f-122b-48a0-93a2-4ee0606d3218_756x750.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Multiprocessing and Multithreading</h1><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207865217&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207865217"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><p><strong>Multiprocessing</strong> means running multiple independent processes, each with its own memory space, that work on different parts of the same problem.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!5xT5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!5xT5!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png 424w, /__u/substackcdn.com/image/fetch/$s_!5xT5!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png 848w, /__u/substackcdn.com/image/fetch/$s_!5xT5!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png 1272w, /__u/substackcdn.com/image/fetch/$s_!5xT5!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!5xT5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png" width="1228" height="780" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:780,&quot;width&quot;:1228,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:145579,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!5xT5!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png 424w, /__u/substackcdn.com/image/fetch/$s_!5xT5!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png 848w, /__u/substackcdn.com/image/fetch/$s_!5xT5!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png 1272w, /__u/substackcdn.com/image/fetch/$s_!5xT5!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d420862-ed42-438e-9f42-8cb362a7dcb6_1228x780.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Because each process has its own memory, there&#8217;s no shared state to protect. Give them separate cores (assuming there are enough cores), and they run at the same instant, with nothing to coordinate on by default. (If you use shared memory, synchronization is still needed)</p><p>You might guess the challenge here. It&#8217;s communication.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!14eZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!14eZ!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png 424w, /__u/substackcdn.com/image/fetch/$s_!14eZ!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png 848w, /__u/substackcdn.com/image/fetch/$s_!14eZ!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png 1272w, /__u/substackcdn.com/image/fetch/$s_!14eZ!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!14eZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png" width="1456" height="762" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:762,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:113994,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!14eZ!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png 424w, /__u/substackcdn.com/image/fetch/$s_!14eZ!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png 848w, /__u/substackcdn.com/image/fetch/$s_!14eZ!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png 1272w, /__u/substackcdn.com/image/fetch/$s_!14eZ!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20e0030-35fd-4d76-b37e-ae8879018f5f_1640x858.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If two processes need to work together, things are not as straightforward, as they have to go through the OS as the intermediary. Pipes, sockets, and message queues charge you per message: for serialization, copying, and deserialization.</p><p>Shared memory avoids this, but introduces a synchronization problem instead. </p><p>The sharing overhead scales with how much these processes need to communicate.</p><p>In multiprocessing, each process can run on a CPU core or even different CPUs </p><blockquote><p>Some high-performance server could have multiple CPUs.</p></blockquote><p><strong>Multithreading</strong> means running multiple threads inside a single process, all sharing that process&#8217;s resources.</p><p>Because they share memory, one thread can access data from other threads; no serialization/deserialization is involved.</p><p>But that sharing is the danger.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!HcWt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!HcWt!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png 424w, /__u/substackcdn.com/image/fetch/$s_!HcWt!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png 848w, /__u/substackcdn.com/image/fetch/$s_!HcWt!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png 1272w, /__u/substackcdn.com/image/fetch/$s_!HcWt!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!HcWt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png" width="1204" height="630" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:630,&quot;width&quot;:1204,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:108095,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!HcWt!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png 424w, /__u/substackcdn.com/image/fetch/$s_!HcWt!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png 848w, /__u/substackcdn.com/image/fetch/$s_!HcWt!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png 1272w, /__u/substackcdn.com/image/fetch/$s_!HcWt!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9df21edd-897a-4948-b78f-bb60e00565d9_1204x630.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Two threads writing to the same variable without coordination can corrupt it or read a half-updated value (a race condition). This is why every programming language with multithreading support ships some form of lock, mutex, or semaphore; mechanisms whose job is to say &#8220;only one thread touches this at a time&#8221; and to make sure the next thread actually sees what the previous one wrote.</p><p>Multithreading is cheap to set up and cheap to communicate through, but it requires effort to ensure safe data sharing.</p><p>If all are read-only, that&#8217;s fine; however, if it involves modification, race conditions need to be considered. </p><div><hr></div><h1>Concurrency and Parallelism </h1><p>In short, </p><p>Concurrency is a way of organizing work so multiple things are in progress at once, even if only one of them is actually executing at any given instant. <span>Two or more tasks start and complete in </span>overlapping time slices, but not necessarily at the same time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!O-Q-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!O-Q-!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png 424w, /__u/substackcdn.com/image/fetch/$s_!O-Q-!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png 848w, /__u/substackcdn.com/image/fetch/$s_!O-Q-!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png 1272w, /__u/substackcdn.com/image/fetch/$s_!O-Q-!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!O-Q-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png" width="880" height="324" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:324,&quot;width&quot;:880,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19183,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!O-Q-!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png 424w, /__u/substackcdn.com/image/fetch/$s_!O-Q-!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png 848w, /__u/substackcdn.com/image/fetch/$s_!O-Q-!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png 1272w, /__u/substackcdn.com/image/fetch/$s_!O-Q-!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97652c00-7fc8-4585-ad17-cbcb36677cc8_880x324.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Parallelism allows multiple things to happen simultaneously. It has the same shape as concurrency: multiple things in progress at once, but adds a stricter requirement.</p><p>The executions must occur at the same time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!YVFg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ac720d-218e-451e-a85e-4132c9129072_806x312.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!YVFg!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ac720d-218e-451e-a85e-4132c9129072_806x312.png 424w, /__u/substackcdn.com/image/fetch/$s_!YVFg!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ac720d-218e-451e-a85e-4132c9129072_806x312.png 848w, /__u/substackcdn.com/image/fetch/$s_!YVFg!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ac720d-218e-451e-a85e-4132c9129072_806x312.png 1272w, /__u/substackcdn.com/image/fetch/$s_!YVFg!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ac720d-218e-451e-a85e-4132c9129072_806x312.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!YVFg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ac720d-218e-451e-a85e-4132c9129072_806x312.png" width="806" height="312" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/99ac720d-218e-451e-a85e-4132c9129072_806x312.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:312,&quot;width&quot;:806,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:17391,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ac720d-218e-451e-a85e-4132c9129072_806x312.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!YVFg!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ac720d-218e-451e-a85e-4132c9129072_806x312.png 424w, /__u/substackcdn.com/image/fetch/$s_!YVFg!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ac720d-218e-451e-a85e-4132c9129072_806x312.png 848w, /__u/substackcdn.com/image/fetch/$s_!YVFg!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ac720d-218e-451e-a85e-4132c9129072_806x312.png 1272w, /__u/substackcdn.com/image/fetch/$s_!YVFg!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ac720d-218e-451e-a85e-4132c9129072_806x312.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="pullquote"><p>After learning the concepts, let&#8217;s tie things together.</p></div><h1>Multiprocessing + Multithreading and Concurrency and Parallelism </h1><p>Multiprocessing gets you parallelism more easily. Each process is resource-isolated, so nothing in the code prevents the scheduler from placing them on separate cores and allowing them to run at the same time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Kg3y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79732cca-d440-4d19-babb-359b0237652c_1256x484.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Kg3y!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79732cca-d440-4d19-babb-359b0237652c_1256x484.png 424w, /__u/substackcdn.com/image/fetch/$s_!Kg3y!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79732cca-d440-4d19-babb-359b0237652c_1256x484.png 848w, /__u/substackcdn.com/image/fetch/$s_!Kg3y!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79732cca-d440-4d19-babb-359b0237652c_1256x484.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Kg3y!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79732cca-d440-4d19-babb-359b0237652c_1256x484.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Kg3y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79732cca-d440-4d19-babb-359b0237652c_1256x484.png" width="1256" height="484" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/79732cca-d440-4d19-babb-359b0237652c_1256x484.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:484,&quot;width&quot;:1256,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79842,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79732cca-d440-4d19-babb-359b0237652c_1256x484.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Kg3y!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79732cca-d440-4d19-babb-359b0237652c_1256x484.png 424w, /__u/substackcdn.com/image/fetch/$s_!Kg3y!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79732cca-d440-4d19-babb-359b0237652c_1256x484.png 848w, /__u/substackcdn.com/image/fetch/$s_!Kg3y!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79732cca-d440-4d19-babb-359b0237652c_1256x484.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Kg3y!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79732cca-d440-4d19-babb-359b0237652c_1256x484.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>But &#8220;more easily&#8221; isn&#8217;t &#8220;by definition.&#8221; The number of cores is still what decides. Run 16 processes on a 4-core machine and 12 of them are waiting for a core at any given moment.</p><p>Multithreading is interesting.</p><p>Imagine we have 4 threads inside one process; they can run:</p><ul><li><p>Concurrent only: if those threads run on a single CPU core.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!vrSV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!vrSV!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png 424w, /__u/substackcdn.com/image/fetch/$s_!vrSV!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png 848w, /__u/substackcdn.com/image/fetch/$s_!vrSV!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png 1272w, /__u/substackcdn.com/image/fetch/$s_!vrSV!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!vrSV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png" width="538" height="205.8185053380783" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:430,&quot;width&quot;:1124,&quot;resizeWidth&quot;:538,&quot;bytes&quot;:44262,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!vrSV!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png 424w, /__u/substackcdn.com/image/fetch/$s_!vrSV!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png 848w, /__u/substackcdn.com/image/fetch/$s_!vrSV!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png 1272w, /__u/substackcdn.com/image/fetch/$s_!vrSV!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a221424-f887-4d53-924d-427a2db09c8d_1124x430.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p>Also in parallel: if those threads could be run on 4 separate CPU cores.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Yh_X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Yh_X!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png 424w, /__u/substackcdn.com/image/fetch/$s_!Yh_X!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png 848w, /__u/substackcdn.com/image/fetch/$s_!Yh_X!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Yh_X!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Yh_X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png" width="534" height="300.5657142857143" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:394,&quot;width&quot;:700,&quot;resizeWidth&quot;:534,&quot;bytes&quot;:34653,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Yh_X!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png 424w, /__u/substackcdn.com/image/fetch/$s_!Yh_X!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png 848w, /__u/substackcdn.com/image/fetch/$s_!Yh_X!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Yh_X!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa14d7fc9-f188-4ad8-949d-d1008a9302aa_700x394.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li></ul><p>The OS scheduler examines every runnable thread in every process on the system and decides which thread runs on which core. A process can use as many cores as it has runnable threads at that instant, limited by the number of cores on the machine.</p><p>If you have more threads than available cores, some threads will need to run on the same core and will alternate: one thread runs for a short time, then the OS stops it to  resume another, and so on.</p><p>This means that in this case, only a subset of threads achieve true parallelism at any given instant, while the rest remain only concurrent, taking turns on a shared core. </p><div class="pullquote"><p>Now, let&#8217;s discuss multiprocessing + multithreading in Python </p></div><h1>GIL</h1><p>In the standard Python interpreter, CPython, there is a lock called the Global Interpreter Lock (GIL), which ensures that only one thread can execute Python bytecode at any given moment. Doesn&#8217;t matter how many cores are sitting free in your laptop. Only one thread is running Python code at a time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!GV8h!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!GV8h!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png 424w, /__u/substackcdn.com/image/fetch/$s_!GV8h!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png 848w, /__u/substackcdn.com/image/fetch/$s_!GV8h!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png 1272w, /__u/substackcdn.com/image/fetch/$s_!GV8h!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!GV8h!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png" width="666" height="256.5159010600707" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:436,&quot;width&quot;:1132,&quot;resizeWidth&quot;:666,&quot;bytes&quot;:54256,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!GV8h!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png 424w, /__u/substackcdn.com/image/fetch/$s_!GV8h!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png 848w, /__u/substackcdn.com/image/fetch/$s_!GV8h!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png 1272w, /__u/substackcdn.com/image/fetch/$s_!GV8h!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b2cf7bc-6aca-41e9-808f-890a5830ad87_1132x436.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p>Why CPython single-thread will need a dedicate article :d </p></blockquote><p>A thread releases the GIL lock whenever it is waiting on something outside the interpreter: a network call, a disk read, anything that hands control to the OS and blocks.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Hmfz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Hmfz!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png 424w, /__u/substackcdn.com/image/fetch/$s_!Hmfz!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png 848w, /__u/substackcdn.com/image/fetch/$s_!Hmfz!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Hmfz!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Hmfz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png" width="1096" height="616" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:616,&quot;width&quot;:1096,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:76058,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Hmfz!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png 424w, /__u/substackcdn.com/image/fetch/$s_!Hmfz!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png 848w, /__u/substackcdn.com/image/fetch/$s_!Hmfz!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Hmfz!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c23bdc-0e72-4b12-9b52-3b2b60a81361_1096x616.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p><em>One thing worth knowing, GIL is optional now. PEP 703 added a separate CPython build with no GIL, experimental in 3.13, officially supported in 3.14. It&#8217;s a different binary (</em>python3.14t<em>), you have to explicitly choose to use it. Everything in this article about GIL describes the standard build, which is still what you get by default.</em></p></blockquote><div><hr></div><h1>Multithreading</h1><p>But a released lock with nobody to catch it is wasted.</p><p>A single thread waiting for a file download releases the GIL, and since no other thread is waiting to use it, it just waits for the response as if the GIL were never a factor.</p><p>So, we bring in other threads with multithreading.</p><p>The <strong>threading</strong> module is Python&#8217;s interface for creating and managing these threads directly.</p><p>Thread(target=some_function) wraps a function as a unit of work. Then calling the  start() method hands it to the OS to schedule, and you can have as many of these running &#8220;at once&#8221; as you like, each one an independent thread the OS is free to interleave with the others.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!1u0U!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!1u0U!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png 424w, /__u/substackcdn.com/image/fetch/$s_!1u0U!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png 848w, /__u/substackcdn.com/image/fetch/$s_!1u0U!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png 1272w, /__u/substackcdn.com/image/fetch/$s_!1u0U!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!1u0U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png" width="1138" height="712" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:712,&quot;width&quot;:1138,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:107189,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!1u0U!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png 424w, /__u/substackcdn.com/image/fetch/$s_!1u0U!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png 848w, /__u/substackcdn.com/image/fetch/$s_!1u0U!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png 1272w, /__u/substackcdn.com/image/fetch/$s_!1u0U!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb47d9e6-b6ab-4d01-8c8a-06bddf911a5e_1138x712.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is the mechanism that actually allows you to have multiple tasks in flight. Without it, you&#8217;re back to the single-thread loop from before, one download after another, with nothing to hand the GIL to when it&#8217;s released. Now with the threading library, the released lock can be caught by some OS thread. </p><p>The described behavior also explains why <code>threading</code> earns its reputation on I/O-bound work but falls apart on CPU-bound work.</p><p>I/O-bound code spends nearly all its time waiting for outside, which is exactly the state that releases the GIL. CPU-bound Python code doesn&#8217;t wait for anything, so it holds the lock the whole time.</p><blockquote><p><em>With one exception: libraries like NumPy do their heavy work in C, which doesn&#8217;t need the interpreter, so they release the GIL while it runs.</em></p></blockquote><p>Another observation is that multithreading is a form of concurrency; threads are run in turn.</p><h2>Race conditions</h2><p><strong>But &#8220;run in turn&#8221; doesn&#8217;t mean &#8220;safe.&#8221;</strong> It&#8217;s tempting to assume that since threads never execute Python bytecode at the same instant, they can&#8217;t step on each other so race conditions never happen.</p><p>&#8212;</p><p>The GIL guarantees atomicity at the level of a single bytecode instruction, but a series of instructions is another story.</p><p>A simple counter += 1 looks atomic, but underneath, it reads the count, adds 1, and writes it back, three separate steps.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;ccbd6f44-fd77-44e3-b578-d8e64c9d5c29&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">counter = 0

def increment():
    global counter
    # many instructions behind the scenes of this
    counter += 1</code></pre></div><p>Besides giving up the GIL during I/O, CPython also switches threads that are busy computing.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ijJ_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ijJ_!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png 424w, /__u/substackcdn.com/image/fetch/$s_!ijJ_!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png 848w, /__u/substackcdn.com/image/fetch/$s_!ijJ_!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ijJ_!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ijJ_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png" width="1406" height="884" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:884,&quot;width&quot;:1406,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:108963,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ijJ_!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png 424w, /__u/substackcdn.com/image/fetch/$s_!ijJ_!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png 848w, /__u/substackcdn.com/image/fetch/$s_!ijJ_!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ijJ_!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb79bf963-6f7a-4716-aaf2-c7412c8f701d_1406x884.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A thread that wants the GIL waits, and after the switch interval (5 ms by default, sys.getswitchinterval()), it raises a flag asking for the lock. The running thread checks that flag between bytecode instructions and hands it over.</p><p>That check doesn&#8217;t know or care that &#8220;read, add, write&#8221; was supposed to happen in a single batch. It can land between any two of those steps.</p><p>Imagine thread A reads a counter value of 0. Before it adds or writes anything back, it checks the flag, sees thread B waiting, and hands over the lock. Thread B picks it up, runs the full counter += 1, increasing the counter to 1. Then A resumes, still holding a stale 0 from before it was paused, adds 1, and writes 1 back. Two increments happened. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!L7h2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!L7h2!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png 424w, /__u/substackcdn.com/image/fetch/$s_!L7h2!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png 848w, /__u/substackcdn.com/image/fetch/$s_!L7h2!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png 1272w, /__u/substackcdn.com/image/fetch/$s_!L7h2!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!L7h2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png" width="1456" height="471" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:471,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:187388,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!L7h2!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png 424w, /__u/substackcdn.com/image/fetch/$s_!L7h2!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png 848w, /__u/substackcdn.com/image/fetch/$s_!L7h2!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png 1272w, /__u/substackcdn.com/image/fetch/$s_!L7h2!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F783110ef-6aa8-4dbf-b45c-8fe08dd2dd09_1806x584.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The counter is now 1, not 2.</p><p>Thus, in Python multithreading, race conditions can still occur, even though threads can&#8217;t run at the same time. </p><p>&#8212;</p><p>I found that there is an optimization in <a href="https://www.reddit.com/r/learnprogramming/comments/16mlz4h/race_condition_doesnt_happen_from_python_310/">Python 3.10 to the way the GIL is released</a>.</p><p>Before 3.10, the release/acquire could occur at essentially any bytecode instruction. </p><p>After a specific 3.10 optimization, GIL release/acquire only happens at certain instructions; not every instruction is &#8220;releasable&#8221; anymore.</p><p>For example, given the previous example, the instructions to read the counter, increment it, and write it back don&#8217;t contain any eligible release instruction. Thus, the whole process of  counter += 1 could happen til the end on a single thread, preventing the chance of a race condition in our case. </p><blockquote><p><em>Caution: that only holds for this specific case. It doesn&#8217;t mean </em><code>+=</code><em> is safe from race conditions in general.</em></p></blockquote><blockquote><p><em>In the scope of this article, I won&#8217;t dive into the level of bytecode.</em> </p></blockquote><p>However, saying this does not mean that the optimization in Python 3.10 completely prevents race conditions in a multithreading environment without proper synchronization mechanisms. </p><div><hr></div><h1>Async</h1><p>Since we just discussed Python&#8217;s multithreading, I think we should move on to Python Async, as these two are often confused by Python users. </p><blockquote><p><em>I will just give an overview of Python Async here, especially how it compares to multithreading.</em></p></blockquote><p>In simple terms, async processing is a method in which a system handles other tasks without waiting for the current task to finish; when it finishes, the system can switch back (via a notification) and handle the result.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!-EQ1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!-EQ1!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png 424w, /__u/substackcdn.com/image/fetch/$s_!-EQ1!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png 848w, /__u/substackcdn.com/image/fetch/$s_!-EQ1!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-EQ1!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!-EQ1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png" width="1074" height="736" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:736,&quot;width&quot;:1074,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:64111,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!-EQ1!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png 424w, /__u/substackcdn.com/image/fetch/$s_!-EQ1!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png 848w, /__u/substackcdn.com/image/fetch/$s_!-EQ1!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png 1272w, /__u/substackcdn.com/image/fetch/$s_!-EQ1!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F626effa3-0bb6-4df1-8910-492bc9e9472d_1074x736.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Python&#8217;s asyncio library allows users to apply the described method. Given two tasks: one downloads a file from the Internet and the other performs a simple calculation. Async allows jumping to perform a simple calculation while waiting for I/O to complete.</p><p>You might wonder: it is quite similar to multithreading, where a download thread releases the GIL, and the perform thread acquires the lock. </p><p>The difference is where the work runs. Multithreading spawns multiple OS threads and lets the OS interleave them. Async runs all your tasks on a single thread, and context switching happens within your program rather than in the OS.</p><ul><li><p>You define a set of Async tasks.</p></li><li><p>Each task has an explicit wait point (the await keyword). But await alone doesn&#8217;t hand control back. Control only returns to the system when a task awaits something that actually suspends it: a network call, a disk read, or a timer.</p></li><li><p>The system here is a single event loop that manages every task. It runs one task until that task suspends, then switches to another and runs it until it suspends, and so on.</p></li><li><p>While a task is waiting, the event loop isn&#8217;t idle;  it&#8217;s watching for when waiting tasks become ready (e.g., their network response arrives) and resumes the matching task exactly where it left off.</p></li><li><p>All tasks run on a single thread. Nothing is competing for the lock.</p><ul><li><p>Which also means a blocking call from a task stalls everything.</p></li></ul></li></ul><p>In short: multithreading gives you real OS-level concurrency, at OS-level cost, with interruption points you don&#8217;t control.</p><p>Async gives you concurrency at, in theory, lower overhead, as it runs all your tasks on a single thread, with interrupt points you can control.</p><div><hr></div><h1>Multiprocessing</h1><p>For CPU-bound tasks, we can do multiprocessing in Python.</p><p>The multiprocessing module is Python&#8217;s interface for running CPU-bound code in parallel.  When initialized, the module spins up new OS processes, each with its own resources and, importantly, its own Python interpreter.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!TCPv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!TCPv!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png 424w, /__u/substackcdn.com/image/fetch/$s_!TCPv!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png 848w, /__u/substackcdn.com/image/fetch/$s_!TCPv!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TCPv!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!TCPv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png" width="992" height="612" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/caab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:612,&quot;width&quot;:992,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:96160,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207865217?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!TCPv!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png 424w, /__u/substackcdn.com/image/fetch/$s_!TCPv!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png 848w, /__u/substackcdn.com/image/fetch/$s_!TCPv!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TCPv!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaab6ed5-aa81-4e8f-8329-22e9dca9878b_992x612.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>How each process gets that interpreter varies. Python offers a few start methods. Some clone the interpreter that&#8217;s already running, which is fast. Others launch a fresh Python process from scratch: re-import your modules and rebuild your state.</p><p>There will be N separate Python interpreters, each with its own GIL, completely unaware of the others. Multiprocessing gets around the GIL by simply not sharing one.</p><p>N processes, N interpreters, and N GILs. The OS is now free to place each process&#8217;s interpreter on its own core, allowing each process to execute Python bytecode simultaneously.</p><p>However, the price for true parallelism shows up in two places:</p><ul><li><p>First, starting a process is heavier than starting a thread.</p></li><li><p>Second, sharing the data requires extra effort. Processes can't hand objects to each other directly. Python's default is to pickle everything through a <code>Queue</code> or <code>Pipe</code>, so you pay serialization on every message. Shared memory avoids that, but only for flat data (bytes and numeric arrays), not arbitrary Python objects.</p></li></ul><p>If your task can be handled faster with more CPU resources (CPU-bound), the multiprocessing module is your choice in Python. </p><div><hr></div><h1>Outro</h1><p>In this article, I shared what I learned about computer threads and processes, multithreading and multiprocessing, and concurrency and parallelism. Then I discussed how multithreading and multiprocessing relate to concurrency and parallelism. </p><p>Finally, I moved on to discuss these concepts in a Python context.</p><p>Thank you for reading this far. See you in my next article.</p>]]></content:encoded></item><item><title><![CDATA[Learn these 3 to gain 80% of the fundamentals of data engineering infrastructure]]></title><description><![CDATA[Storing, processing and moving data.]]></description><link>https://vutr.substack.com/p/learn-these-3-to-gain-80-of-the-technical</link><guid isPermaLink="false">https://vutr.substack.com/p/learn-these-3-to-gain-80-of-the-technical</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Tue, 21 Jul 2026 05:16:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!AKRu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=205485370&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=205485370"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!AKRu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!AKRu!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!AKRu!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!AKRu!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!AKRu!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!AKRu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:178216,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205485370?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!AKRu!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!AKRu!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!AKRu!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!AKRu!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8011644a-0472-40b4-a68b-f894f8194f6f_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Intro</h1><p>Many junior or graduate students, or even those who work in the data engineering field for 3-4 years, reach out and ask me something like this:</p><p>&#8220;I feel I lack fundamentals; I don&#8217;t know what I'm missing and don&#8217;t know where to begin &#8220;</p><p>The reasons are usually:</p><ul><li><p>&#8220;Vendors are doing a great job in abstracting the complexity behind the scenes; data engineers now just need to interact through the interface.&#8221;</p></li><li><p>&#8220;AI could do anything, so I don&#8217;t have motivation to learn&#8221;</p></li><li><p>&#8220;Too many things to learn&#8220;&#8220;</p></li></ul><p>&#8212;</p><p>I have been thinking about this problem for a while.</p><p>I wrote about the data engineering roadmap <a href="/__u/vutr.substack.com/p/the-data-engineer-roadmap?utm_source=publication-search">here</a>, but I think it&#8217;s quite overwhelming for those who want to gain the fundamental knowledge fast and efficiently.</p><p>&#8212;</p><p>From first principles, data is just bytes: 0 and 1 written to your disk. When working with data, you do one of these, or a combination of them:</p><ul><li><p>Storing the data in 0 and 1.</p></li><li><p>Bringing those 0 and 1 into RAM for CPU processing.</p></li><li><p>Moving those 0 and 1 to other machines</p></li></ul><p>That&#8217;s it.</p><p>No matter how complex the pipeline, how big the data platform, or what the business requirements look like, any data physical actions can be observed with only these three.</p><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Thus, if one can gain knowledge of these three, I believe they would have 80% of the necessary data infra fundamentals; all other things can be learned from there.</mark></p><p>And, to make the learning more concrete, I chose three technologies/frameworks to learn:</p><ul><li><p>Parquet</p></li><li><p>Arrow</p></li><li><p>Spark</p></li></ul><p>In the rest of the article, I give you exactly what you should learn from Parquet, Arrow, and Spark, and how you can leverage them to scale your learning to nearly all other data systems. </p><blockquote><p><em>In the scope of this article, I only go through each one and list out which concepts/topics you should learn so you can build your learning based from those topics; in other words these concepts have the highest ROI: when you learn them, you can definitely learn nearly anything related to data infrastructure.</em></p></blockquote><div><hr></div><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=205485370&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=205485370"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div>
      <p>
          <a href="/__u/vutr.substack.com/p/learn-these-3-to-gain-80-of-the-technical">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[[FREE] Solve higher-impact problems]]></title><description><![CDATA[The mindset to grow and get promoted.]]></description><link>https://vutr.substack.com/p/free-do-work-that-matters</link><guid isPermaLink="false">https://vutr.substack.com/p/free-do-work-that-matters</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Thu, 16 Jul 2026 05:15:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!0GCH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207238522&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207238522"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!0GCH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!0GCH!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!0GCH!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!0GCH!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0GCH!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!0GCH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:54265,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/207238522?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!0GCH!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!0GCH!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!0GCH!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0GCH!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cd9b8fd-d876-4c5b-9731-14fd2e1ee448_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Intro</h1><p>I&#8217;ve had the chance to work with distinguished senior colleagues. They&#8217;re distinguished not because they know a lot of technical stuff (although technical knowledge is a factor).</p><p>They try to solve higher-impact problems.</p><blockquote><p><em>You won&#8217;t find any illustrations (except for the landing image) like in my previous articles; that is intentional. I want your 100% focus on the text because things I will share with you are the one I wished someone tell me sooner. </em></p><p><em>You might also notice that I've repeated ideas I've discussed in my previous articles. I believe important things should be repeated over and over again.</em></p></blockquote><div><hr></div><h1>Value</h1><p>Companies hire us (the DEs) to help build a robust data foundation so others can leverage that to extract business insights.</p><p>Although the details of job descriptions differ, the ultimate goal will always be the same: store, process, manage, and serve data efficiently &#8212; the data foundation.</p><p>Any company hires an employee, assuming he is good at &#8220;X,&#8221; so he can help the company with that. For data engineers, we are hired because we&#8217;re good at &#8220;data engineering,&#8221; <em><strong><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">and</mark></strong></em> the company believes we can use that to build their data foundation.</p><p>You&#8217;re not hired solely for your ability to write Spark jobs, debug Airflow errors, or model a star schema. You&#8217;re hired because the company believes you can leverage all those things to help them store, process, manage, and serve data.</p><p>Thus, every single task you do and every decision you make must deliver some business value (directly or indirectly).</p><p>Business value must be the number one priority.</p><p>To answer what value you could help create, you need to be aware of the true responsibility of a data engineer. Joe Reis<span> and </span>Matt Housley define this very well in the <a href="https://www.oreilly.com/library/view/fundamentals-of-data/9781098108298/">Fundamentals of Data Engineering: Plan and Build Robust Data Systems</a>:</p><blockquote><p><em>Data engineering is the development, implementation, and maintenance of systems and processes that take in raw data and produce high-quality, consistent information that supports downstream use cases, such as analysis and machine learning. Data engineering is the intersection of security, data management, DataOps, data architecture, orchestration, and software engineering.</em></p><p><em>A data engineer manages the data engineering lifecycle, beginning with getting data from source systems and ending with serving data for use cases, such as analysis or machine learning</em></p><p><em>&#8212; <a href="https://www.oreilly.com/search/?query=author%3A%22Joe+Reis%22&amp;sort=relevance&amp;highlight=true">Joe Reis</a>, <a href="https://www.oreilly.com/search/?query=author%3A%22Matt+Housley%22&amp;sort=relevance&amp;highlight=true">Matt Housley</a>.</em></p></blockquote><p>However, simply putting all that information into your mind is not enough. Observe what you&#8217;re doing and what others do in your company; try to figure out your responsibility yourself, or consult the manager or senior colleagues.</p><p>At the end of the day, your responsibilities come down to what <a href="https://www.oreilly.com/search/?query=author%3A%22Joe+Reis%22&amp;sort=relevance&amp;highlight=true">Joe Reis</a> and <a href="https://www.oreilly.com/search/?query=author%3A%22Matt+Housley%22&amp;sort=relevance&amp;highlight=true">Matt Housley</a> defined. However, figuring them out on your own makes you much more aware of them.</p><p>The more business-value-oriented you are, the more chances you have to grow and contribute. A signal that tells you you&#8217;re on the right path: you focus more on the &#8220;boring&#8220; things: data modeling, security, or governance<span>.</span></p><div><hr></div><h1>Higher-impact problems</h1><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207238522&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=207238522"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><p>When you understand that your responsibility and business value are the 1st priority, you will start reflecting on what you&#8217;re doing.</p><p>&#8212;</p><p>I used to measure my success by the number of tasks I finished. The more tasks I do in a day, the better I feel.</p><p>Finishing tasks matters.</p><p>It isn&#8217;t wrong; you&#8217;re even praised and paid for it.</p><p>But you have to slow down, observe, and start looking for work that matters&#8230; more.</p><p>&#8212;</p><p>When you start your career, the world is small.</p><p>An Airflow task error, a Python script that&#8217;s not working, or a slow Spark job.</p><p>You are standing on the ground, ensuring every single detail works as expected. </p><p>However, to grow and promote, you need to go &#8220;higher&#8221; to understand:</p><ul><li><p><strong>Why you&#8217;re doing this</strong>: Some tasks add value; others don&#8217;t.</p></li><li><p><strong>The bigger picture</strong>: you&#8217;re not just coding a pipeline that someone else designed forever. You have to step up to design, plan, and be responsible for work that matters more.</p></li></ul><p>When looking at the higher place, the problem isn&#8217;t always as straightforward as it appears in your Jira ticket. It will be more vague:</p><ul><li><p>Why don&#8217;t users trust our data?</p></li><li><p>Finance says revenue is $1M, while marketing says it&#8217;s $1.2M &#8212; both pulled from the data warehouse. Why is there a discrepancy?</p></li><li><p>Is there a way to improve the productivity of Spark and Airflow development on our team?</p></li></ul><p>It&#8217;s vaguer than &#8216;how to run your Spark job&#8217; because the problems occur at a larger scale. They no longer live only in your IDE; they involve your whole team, other teams, or even the entire company.</p><p>This explains why solving these problems creates more impact. And creating impact is good for your growth (and reputation)</p><p>When it involves more people, you have to communicate, and human language is not binary like your code; it&#8217;s fuzzy. That makes understanding and solving the problem even harder.</p><p>&#8212;</p><p>What I'm trying to say is that every task and every problem matters. Solving a Jira ticket is valuable, but some work matters more&#8212;the kind of work that has a much larger impact.</p><h1>Outro</h1><p>Here is the summary:</p><p>Having a <strong>mindset </strong>that prioritizes business value will <strong>motivate </strong>you to seek higher-impact problems.</p>]]></content:encoded></item><item><title><![CDATA[Docker for data engineer]]></title><description><![CDATA[Containerization &#8594; Reproducibility + Isolation]]></description><link>https://vutr.substack.com/p/docker-for-data-engineer</link><guid isPermaLink="false">https://vutr.substack.com/p/docker-for-data-engineer</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Tue, 14 Jul 2026 05:16:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zAK_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>I'm offering a limited-time <strong><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!zAK_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!zAK_!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!zAK_!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!zAK_!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!zAK_!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!zAK_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:485933,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/204773069?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!zAK_!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!zAK_!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!zAK_!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!zAK_!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30f1dc65-b0d3-4be1-8788-edfe1e1ee0a6_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Intro</h1><p>I&#8217;ve had the chance to learn so many things through my career. From data engineering stuff like BigQuery, Spark, Airflow, and Dagster, to actually developing a backend application or a CI/CD pipeline.</p><p>I feel lucky.</p><p>However, one piece of knowledge I truly appreciate having gained early.</p><p>It&#8217;s Docker&#8212;or, more generally, the ability to containerize any application.</p><p>To continue my process of unlearning (first with <a href="/__u/open.substack.com/pub/vutr/p/heres-everything-you-need-to-know?r=2rj6sg&amp;utm_campaign=post&amp;utm_medium=web">Parquet here</a>), I relearned Docker and am sharing what I discovered in this article.</p><p>The goal is not to cover every corner of Docker; instead, I aim to provide enough material to help you understand and apply what you learn here to real-world workloads.</p><blockquote><p><em><strong>Note</strong>: What I want to cover here is primarily containerization. However, there is currently no containerization technology more dominant than Docker, so most of this article still focuses on Docker. Whenever the opportunity arises, I'll zoom out and discuss containerization concepts more broadly.</em></p></blockquote><div><hr></div><h1>What is it?</h1><p>In the past, if a company wanted to run a new application, the IT department needed to buy a new server. Then, the developer would deploy the application on it.</p><p>However, the downside is that a server back then could only handle a single application; if another app required an isolated runtime, it must be run on a different server.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!bI00!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!bI00!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png 424w, /__u/substackcdn.com/image/fetch/$s_!bI00!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png 848w, /__u/substackcdn.com/image/fetch/$s_!bI00!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png 1272w, /__u/substackcdn.com/image/fetch/$s_!bI00!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!bI00!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png" width="422" height="342.95873015873013" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:512,&quot;width&quot;:630,&quot;resizeWidth&quot;:422,&quot;bytes&quot;:43321,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/204773069?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!bI00!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png 424w, /__u/substackcdn.com/image/fetch/$s_!bI00!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png 848w, /__u/substackcdn.com/image/fetch/$s_!bI00!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png 1272w, /__u/substackcdn.com/image/fetch/$s_!bI00!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95c6e836-fb10-49e3-bacf-9b0c869f5ffa_630x512.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Predicting the application&#8217;s utilization is indeed a challenge: if the server doesn&#8217;t give enough resources, you must buy more hardware; if the application doesn&#8217;t use all the resources, you accept the waste, as a server can only handle one isolated application at a time. </p><p>Virtual machines fixed this.</p><p>With a hypervisor, one physical server can host multiple applications, each in its own VM, securely and in isolation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!CCxe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2089277b-0a80-446c-8cae-ad09c684f179_910x708.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!CCxe!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2089277b-0a80-446c-8cae-ad09c684f179_910x708.png 424w, /__u/substackcdn.com/image/fetch/$s_!CCxe!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2089277b-0a80-446c-8cae-ad09c684f179_910x708.png 848w, /__u/substackcdn.com/image/fetch/$s_!CCxe!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2089277b-0a80-446c-8cae-ad09c684f179_910x708.png 1272w, /__u/substackcdn.com/image/fetch/$s_!CCxe!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2089277b-0a80-446c-8cae-ad09c684f179_910x708.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!CCxe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2089277b-0a80-446c-8cae-ad09c684f179_910x708.png" width="588" height="457.4769230769231" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2089277b-0a80-446c-8cae-ad09c684f179_910x708.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:708,&quot;width&quot;:910,&quot;resizeWidth&quot;:588,&quot;bytes&quot;:116853,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/204773069?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2089277b-0a80-446c-8cae-ad09c684f179_910x708.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!CCxe!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2089277b-0a80-446c-8cae-ad09c684f179_910x708.png 424w, /__u/substackcdn.com/image/fetch/$s_!CCxe!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2089277b-0a80-446c-8cae-ad09c684f179_910x708.png 848w, /__u/substackcdn.com/image/fetch/$s_!CCxe!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2089277b-0a80-446c-8cae-ad09c684f179_910x708.png 1272w, /__u/substackcdn.com/image/fetch/$s_!CCxe!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2089277b-0a80-446c-8cae-ad09c684f179_910x708.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It was a big deal. (You could imagine)</p><p>However, VMs have overhead.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Kt9G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Kt9G!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png 424w, /__u/substackcdn.com/image/fetch/$s_!Kt9G!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png 848w, /__u/substackcdn.com/image/fetch/$s_!Kt9G!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Kt9G!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Kt9G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png" width="595" height="346.53846153846155" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:848,&quot;width&quot;:1456,&quot;resizeWidth&quot;:595,&quot;bytes&quot;:171678,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/204773069?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Kt9G!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png 424w, /__u/substackcdn.com/image/fetch/$s_!Kt9G!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png 848w, /__u/substackcdn.com/image/fetch/$s_!Kt9G!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Kt9G!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb667a06d-ac42-4af3-8e5f-aa47e71f322b_1532x892.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Every VM needs its own full operating system, and that OS consumes CPU and RAM that could have been used for your application. The OS needs patching, monitoring, and sometimes a license fee.</p><p>Then, a container is introduced to solve the problem. </p><p>From the outside, a container looks like a VM. Your application still runs in isolation from everything else.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!xpZ8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!xpZ8!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png 424w, /__u/substackcdn.com/image/fetch/$s_!xpZ8!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png 848w, /__u/substackcdn.com/image/fetch/$s_!xpZ8!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png 1272w, /__u/substackcdn.com/image/fetch/$s_!xpZ8!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!xpZ8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png" width="588" height="534.1374045801526" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:714,&quot;width&quot;:786,&quot;resizeWidth&quot;:588,&quot;bytes&quot;:78723,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/204773069?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!xpZ8!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png 424w, /__u/substackcdn.com/image/fetch/$s_!xpZ8!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png 848w, /__u/substackcdn.com/image/fetch/$s_!xpZ8!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png 1272w, /__u/substackcdn.com/image/fetch/$s_!xpZ8!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63b22d17-de8c-46fd-9b3d-e5e06823c5e4_786x714.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The difference is <span>that it doesn&#8217;t bring its own OS; all containers on a machine share the host&#8217;s kernel. </span>No separate OS means no OS overhead: the application can use more RAM and CPU now, and the container's startup time will be faster than a VM's. </p><p>We can&#8217;t talk about containers without mentioning Docker.</p><p>Container technology existed long before Docker. However, it was complex and not so user-friendly at first.</p><p>It wasn&#8217;t until Docker came into town. <span>When you hear people mention &#8220;Docker&#8221;, there is a high chance they are referring to the Docker technology, not the company Docker, Inc.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!1JO0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!1JO0!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png 424w, /__u/substackcdn.com/image/fetch/$s_!1JO0!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png 848w, /__u/substackcdn.com/image/fetch/$s_!1JO0!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png 1272w, /__u/substackcdn.com/image/fetch/$s_!1JO0!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!1JO0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png" width="524" height="481.71757925072046" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:638,&quot;width&quot;:694,&quot;resizeWidth&quot;:524,&quot;bytes&quot;:73941,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/204773069?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!1JO0!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png 424w, /__u/substackcdn.com/image/fetch/$s_!1JO0!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png 848w, /__u/substackcdn.com/image/fetch/$s_!1JO0!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png 1272w, /__u/substackcdn.com/image/fetch/$s_!1JO0!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc57dc5f2-fec6-4a3c-8827-aa8b58a7d0b0_694x638.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>Docker is the software that creates, manages, and orchestrates containers. It&#8217;s built from various tools from the </span><a href="https://mobyproject.org/">Moby open-source project</a><span>. Docker allows users to focus on applications without worrying much about the underlying infrastructure. </span></p><p>For the rest of the article, I will use &#8220;Docker&#8220; to refer to the Docker software, not the Docker, Inc company.</p><p>Before diving into it, let&#8217;s clarify one thing: Why should data engineers learn Docker, or more generally, containerization?</p><h1>Why learn Docker?</h1><p>September 23rd, 2019. My first day at my first (data) job.</p><p>I had just graduated, and I walked in expecting to touch the cool stuff: Spark, Hadoop, Kafka, etc.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!L1lQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!L1lQ!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png 424w, /__u/substackcdn.com/image/fetch/$s_!L1lQ!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png 848w, /__u/substackcdn.com/image/fetch/$s_!L1lQ!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png 1272w, /__u/substackcdn.com/image/fetch/$s_!L1lQ!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!L1lQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png" width="538" height="223.16143497757847" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:370,&quot;width&quot;:892,&quot;resizeWidth&quot;:538,&quot;bytes&quot;:90197,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/204773069?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!L1lQ!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png 424w, /__u/substackcdn.com/image/fetch/$s_!L1lQ!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png 848w, /__u/substackcdn.com/image/fetch/$s_!L1lQ!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png 1272w, /__u/substackcdn.com/image/fetch/$s_!L1lQ!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4779c6e7-8250-4ecd-9ec9-08e984c388f6_892x370.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>But life is life; nothing as expected. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!i21p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!i21p!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png 424w, /__u/substackcdn.com/image/fetch/$s_!i21p!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png 848w, /__u/substackcdn.com/image/fetch/$s_!i21p!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png 1272w, /__u/substackcdn.com/image/fetch/$s_!i21p!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!i21p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png" width="534" height="251.85671641791043" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:316,&quot;width&quot;:670,&quot;resizeWidth&quot;:534,&quot;bytes&quot;:97480,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/204773069?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!i21p!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png 424w, /__u/substackcdn.com/image/fetch/$s_!i21p!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png 848w, /__u/substackcdn.com/image/fetch/$s_!i21p!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png 1272w, /__u/substackcdn.com/image/fetch/$s_!i21p!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c2fb19-ff04-4b06-b150-ef80e09acb2a_670x316.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>My first task was to do something I had never heard of: Docker. I struggled for two weeks. Now, looking back, I realize the main reason for the struggle was skipping the &#8220;why&#8221; and jumping straight into remembering the commands and getting things running.</p><p>Almost seven years later, I can say that Docker has quietly become one of the most important skills in my career. It does nothing to make my applications, queries, or data transformations faster, but it provides software characteristics that are just as important as performance: reproducibility and isolation.</p><p>Having these two means you can do a lot of things in data/software engineering:</p><div><hr></div><blockquote><p><em>I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=204773069&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=204773069"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p><em>Grab it now and become a paid member to get access to:</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote>
      <p>
          <a href="/__u/vutr.substack.com/p/docker-for-data-engineer">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[[FREE] How does Figma improve insight freshness by 10x?]]></title><description><![CDATA[Change data capture and more.]]></description><link>https://vutr.substack.com/p/free-how-does-figma-improve-insight</link><guid isPermaLink="false">https://vutr.substack.com/p/free-how-does-figma-improve-insight</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Thu, 09 Jul 2026 05:16:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!dzWS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=200848238&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=200848238"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!dzWS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!dzWS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!dzWS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!dzWS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!dzWS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!dzWS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:173043,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205736223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!dzWS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!dzWS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!dzWS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!dzWS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38401ac2-bb19-40a2-8b2b-968de4a874ba_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Intro</h1><p>It has been a long time since I analyzed data engineering use cases from big tech companies.</p><p>Last week, I came across an article from Figma about how they updated their data pipeline to improve data freshness. The blog includes many interesting technical details we can learn from.</p><p>So, here we are. In the rest of the article, you will read my notes and observations after reading <span>Figma's blog post,&nbsp;</span><a href="https://www.figma.com/blog/figmas-data-pipeline-upgrade/">"From multi-day latency to near real-time insights: Figma&#8217;s data pipeline upgrade</a><span>."</span></p><blockquote><p>Disclaimer, all the technical details are come from this blog post; I only deliver my understand as well as the analyzes and the observations.</p></blockquote><div><hr></div><h1>About Figma</h1><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ud_m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c67c845-4210-461e-8554-507b5eed3140_208x204.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ud_m!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c67c845-4210-461e-8554-507b5eed3140_208x204.png 424w, /__u/substackcdn.com/image/fetch/$s_!ud_m!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c67c845-4210-461e-8554-507b5eed3140_208x204.png 848w, /__u/substackcdn.com/image/fetch/$s_!ud_m!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c67c845-4210-461e-8554-507b5eed3140_208x204.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ud_m!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c67c845-4210-461e-8554-507b5eed3140_208x204.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ud_m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c67c845-4210-461e-8554-507b5eed3140_208x204.png" width="208" height="204" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c67c845-4210-461e-8554-507b5eed3140_208x204.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:204,&quot;width&quot;:208,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:23321,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205736223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c67c845-4210-461e-8554-507b5eed3140_208x204.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ud_m!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c67c845-4210-461e-8554-507b5eed3140_208x204.png 424w, /__u/substackcdn.com/image/fetch/$s_!ud_m!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c67c845-4210-461e-8554-507b5eed3140_208x204.png 848w, /__u/substackcdn.com/image/fetch/$s_!ud_m!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c67c845-4210-461e-8554-507b5eed3140_208x204.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ud_m!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c67c845-4210-461e-8554-507b5eed3140_208x204.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Figma is a design and collaboration platform primarily used for creating websites, mobile apps, and user interfaces. </p><p>In short, when you need to design a front-end UI, Figma is always a top choice; millions of users have trusted the platform. </p><p>And you know what? Large user bases usually come with massive amounts of data and a high demand for using that data to better serve users.</p><div><hr></div><h1>Problem</h1><p>To perform analytical workloads and extract insights, Figma must find a way to sync data from OLTP databases to OLAP databases. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!tV_W!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!tV_W!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png 424w, /__u/substackcdn.com/image/fetch/$s_!tV_W!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png 848w, /__u/substackcdn.com/image/fetch/$s_!tV_W!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png 1272w, /__u/substackcdn.com/image/fetch/$s_!tV_W!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!tV_W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png" width="620" height="394.6666666666667" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:592,&quot;width&quot;:930,&quot;resizeWidth&quot;:620,&quot;bytes&quot;:87199,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205736223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!tV_W!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png 424w, /__u/substackcdn.com/image/fetch/$s_!tV_W!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png 848w, /__u/substackcdn.com/image/fetch/$s_!tV_W!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png 1272w, /__u/substackcdn.com/image/fetch/$s_!tV_W!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06afc173-b0a0-46b2-b60d-c95080b3d8f4_930x592.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Their legacy synchronization process, built in 2020, simply exports data from the OLTP databases (RDS PostgreSQL) via a cron job to S3; the data is then imported into Snowflake.</p><p>However, this approach has a downside; the higher the data volume, the longer the process. Exporting with SELECT * will be slower as the table grows.</p><p>By 2023, the synchronization process took Figma roughly 6 hours to complete. The delay in synchronization means the delay in business insight delivery.</p><div><hr></div><h1>Incremental synchronization</h1><p>Fully exporting the table is not a sustainable way. </p><p>Incremental synchronization is. And you might have your guess now.</p><p>It&#8217;s Change Data Capture (CDC).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!y8sG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!y8sG!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png 424w, /__u/substackcdn.com/image/fetch/$s_!y8sG!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png 848w, /__u/substackcdn.com/image/fetch/$s_!y8sG!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png 1272w, /__u/substackcdn.com/image/fetch/$s_!y8sG!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!y8sG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png" width="1434" height="502" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:502,&quot;width&quot;:1434,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:59642,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205736223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!y8sG!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png 424w, /__u/substackcdn.com/image/fetch/$s_!y8sG!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png 848w, /__u/substackcdn.com/image/fetch/$s_!y8sG!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png 1272w, /__u/substackcdn.com/image/fetch/$s_!y8sG!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c3604f-7e0d-4ba7-a31a-336d652ff2f2_1434x502.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When mentioning CDC, the most common and efficient approach is log-based CDC.</p><p>The method operates by reading changes directly from the database&#8217;s transaction &#8220;log&#8221;. It is implemented differently depending on the DBMS. However, the high-level idea is quite the same.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!0QlN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!0QlN!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png 424w, /__u/substackcdn.com/image/fetch/$s_!0QlN!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png 848w, /__u/substackcdn.com/image/fetch/$s_!0QlN!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0QlN!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!0QlN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png" width="1016" height="696" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:696,&quot;width&quot;:1016,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:105450,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205736223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!0QlN!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png 424w, /__u/substackcdn.com/image/fetch/$s_!0QlN!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png 848w, /__u/substackcdn.com/image/fetch/$s_!0QlN!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0QlN!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb89e986d-2a9b-4dea-a240-361dcaea7208_1016x696.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The &#8220;log&#8220; serves as an ordered, durable, and complete record of every committed transaction. A CDC tool with a log-based reader taps into this stream of log records, parses them, and propagates them to downstream systems.</p><p>The log-based approach provides many advantages:</p><ul><li><p><strong><span>Minimal Performance Impact</span></strong><span>: Because the process reads from log files rather than executing queries against tables, log-based CDC enables continuous change capture with minimal performance overhead.</span></p></li><li><p><strong>Completeness</strong><span>: The &#8220;log&#8221; is the ultimate source of truth for all data modifications. Log-based CDC can therefore capture all types of changes.</span></p></li><li><p><strong>Low Latency</strong><span>: By reading changes as they are committed to the log, this method provides near-real-time updates to consuming systems.</span></p></li></ul><p>The most obvious downside of this method is the complexity; a lot of components to manage: the message system, the message consumer, and the data merger. The more tables that need CDC, the more management overhead there is.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!wWzm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb16dfd49-286e-45c3-915c-987b1fd479dd_1092x318.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!wWzm!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb16dfd49-286e-45c3-915c-987b1fd479dd_1092x318.png 424w, /__u/substackcdn.com/image/fetch/$s_!wWzm!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb16dfd49-286e-45c3-915c-987b1fd479dd_1092x318.png 848w, /__u/substackcdn.com/image/fetch/$s_!wWzm!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb16dfd49-286e-45c3-915c-987b1fd479dd_1092x318.png 1272w, /__u/substackcdn.com/image/fetch/$s_!wWzm!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb16dfd49-286e-45c3-915c-987b1fd479dd_1092x318.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!wWzm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb16dfd49-286e-45c3-915c-987b1fd479dd_1092x318.png" width="1092" height="318" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b16dfd49-286e-45c3-915c-987b1fd479dd_1092x318.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:318,&quot;width&quot;:1092,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!wWzm!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb16dfd49-286e-45c3-915c-987b1fd479dd_1092x318.png 424w, /__u/substackcdn.com/image/fetch/$s_!wWzm!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb16dfd49-286e-45c3-915c-987b1fd479dd_1092x318.png 848w, /__u/substackcdn.com/image/fetch/$s_!wWzm!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb16dfd49-286e-45c3-915c-987b1fd479dd_1092x318.png 1272w, /__u/substackcdn.com/image/fetch/$s_!wWzm!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb16dfd49-286e-45c3-915c-987b1fd479dd_1092x318.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In addition, it often requires specific database configurations, such as enabling logical replication in PostgreSQL. It may also require elevated system permissions to grant the CDC process access to the transaction log files, which can be a challenge in strictly controlled environments.</p><p>Back to the Figma case, they decided to go with the CDC approach, but to handle the company's data scale, they chose to build the whole solution themselves rather than buy from a vendor to achieve flexibility and scalability while saving costs.</p><div><hr></div><blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=205736223&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=205736223"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div><hr></div><h1>The new pipeline</h1><p>One thing to note is that, to enable CDC, you must first have the current state of the table, the snapshot; from there, changes come as the log message will be merged with the initial snapshot to capture the change from the source table.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!osok!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!osok!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png 424w, /__u/substackcdn.com/image/fetch/$s_!osok!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png 848w, /__u/substackcdn.com/image/fetch/$s_!osok!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png 1272w, /__u/substackcdn.com/image/fetch/$s_!osok!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!osok!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png" width="1354" height="786" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:786,&quot;width&quot;:1354,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:210127,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205736223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!osok!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png 424w, /__u/substackcdn.com/image/fetch/$s_!osok!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png 848w, /__u/substackcdn.com/image/fetch/$s_!osok!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png 1272w, /__u/substackcdn.com/image/fetch/$s_!osok!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2faac71-e3fa-40e6-8090-484abfc77306_1354x786.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>For the initial snapshot, Figma simply leverages RDS to export to S3.</p><p>For the CDC setup, they leverage Kafka Connect, Snowflake Connector, and Amazon Managed Streaming for Apache Kafka (MSK).</p><p>To merge delta changes, Figma built custom Snowflake stored procedures.</p><p>For any new table that requires synchronization, the following things happen:</p><ul><li><p>A new table in Postgres is automatically captured by the Figma CDC automated service; the change stream is then published to Kafka&#8217;s per-table topics.</p></li><li><p>The table&#8217;s latest snapshot will be exported to S3.</p></li><li><p>Then they import the data to a Snowflake table. </p></li><li><p>Snowflake Sink Connector will consume data from the associated Kafka topic and write it to a CDC table.</p></li><li><p>Periodically, the merge store procedure runs to merge data from the base table and the CDC table. </p></li></ul><p>And that&#8217;s not all; to ensure robustness, Figma must validate the data.</p><p>For each onboarding CDC table, Figma will clone its source table and compare it against the source table. The goal is to ensure they have the exact data. The compared output is then integrated into Figma&#8217;s monitoring and alert system.</p><p>Besides scalability, data integrity is definitely Figma&#8217;s ultimate goal.</p><div><hr></div><h1>Automation</h1><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!rrre!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!rrre!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png 424w, /__u/substackcdn.com/image/fetch/$s_!rrre!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png 848w, /__u/substackcdn.com/image/fetch/$s_!rrre!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png 1272w, /__u/substackcdn.com/image/fetch/$s_!rrre!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!rrre!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png" width="310" height="320.98425196850394" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:526,&quot;width&quot;:508,&quot;resizeWidth&quot;:310,&quot;bytes&quot;:54352,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205736223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!rrre!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png 424w, /__u/substackcdn.com/image/fetch/$s_!rrre!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png 848w, /__u/substackcdn.com/image/fetch/$s_!rrre!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png 1272w, /__u/substackcdn.com/image/fetch/$s_!rrre!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44ba038f-7b61-4c55-a44e-0b682438d6ed_508x526.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>To scale, the onboarding and validation process must be automated.</p><p>For this purpose, Figma uses AWS Step Functions.</p><p>In Step Functions, there is a concept <span>called workflows, which facilitate automated</span> processes or orchestrate microservices.</p><p>To automate CDC processes, Figma develops two levels of automation, each with an associated set of workflows:</p><ul><li><p>First-level: this includes workflows they can trigger manually. Those workflows execute bootstrap or validation processes by providing only the table name. No manual intervention except when there are alerts: a software bug or the validation fails.</p></li><li><p>Second-level: this includes workflows designed to trigger first-level automations based on specific conditions and schedules. After the first level is complete, the second level checks the current states to determine whether it needs to trigger another first-level automation. For example, a workflow that periodically checks for new tables to perform onboarding. </p></li></ul><p>To test these automations, Figma re-onboards all tables in the staging environment every week for simulation and to detect any issues. They actually identified an issue that could cause 20 minutes of downtime if it reaches production.  </p><div><hr></div><blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=205736223&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=205736223"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div><hr></div><h1>Result</h1><p>By moving to incremental synchronization, Figma sees a lot of improvements:</p><ul><li><p><strong>Data freshness</strong>: data used to be 30 hours old or more; now it is reduced to 3 hours or could be lower based on user freshness configuration.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!t_cP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!t_cP!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png 424w, /__u/substackcdn.com/image/fetch/$s_!t_cP!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png 848w, /__u/substackcdn.com/image/fetch/$s_!t_cP!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png 1272w, /__u/substackcdn.com/image/fetch/$s_!t_cP!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!t_cP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png" width="196" height="294.4" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:736,&quot;width&quot;:490,&quot;resizeWidth&quot;:196,&quot;bytes&quot;:47428,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205736223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!t_cP!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png 424w, /__u/substackcdn.com/image/fetch/$s_!t_cP!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png 848w, /__u/substackcdn.com/image/fetch/$s_!t_cP!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png 1272w, /__u/substackcdn.com/image/fetch/$s_!t_cP!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1763209a-063c-4a52-a4f1-82b5b5a964f1_490x736.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p><em>You might wonder; because change stream arrive near real-time, why it take 3 hours, the answer lie in the merge process. Figma set the default default merge frequency to every three hours. User can override the frequency, the more frequent the merge process, the more compute cost.</em></p></blockquote><ul><li><p><strong>Scalability</strong>: no more periodic full exports, which means Figma can comfortably handle large tables, even if some are ten times larger than those used in the legacy synchronization process. </p></li><li><p><strong>Productivity</strong>: insights can now be extracted sooner; CDC processes are now automated and abstracted by the CDC team. </p></li></ul><div><hr></div><h1>Outro</h1><p>In this article, we see how Figma improves data freshness by implementing an incremental approach using CDC to sync data, rather than the full-table export used in the past. </p><p>The lesson here is that, at a small scale, full exporting works well, even the ideal choice given its simplicity. However, when the data grows, full exports are painful.</p><p>Incremental synchronization is inevitable. It surely helps with the data scale and freshness. However, it comes with complexity.</p><p>As you can see, Figma invested heavily in onboarding and validation processes and in abstracting and automating them via AWS Step Functions.</p><p>At the end of the day, any technical decision has its trade-offs.</p><p>Thank you for reading this far. See you in my next article.</p><div><hr></div><h1>Reference</h1><p><em>[1] Yichao Zhao, <a href="https://www.figma.com/blog/figmas-data-pipeline-upgrade/">From multi-day latency to near real-time insights: Figma&#8217;s data pipeline upgrade</a> (2025)</em></p>]]></content:encoded></item><item><title><![CDATA[Here's everything you need to know about Parquet in 2026.]]></title><description><![CDATA[I spent 10 hours re-learning Parquet.]]></description><link>https://vutr.substack.com/p/heres-everything-you-need-to-know</link><guid isPermaLink="false">https://vutr.substack.com/p/heres-everything-you-need-to-know</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Wed, 08 Jul 2026 05:16:21 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!3GyS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=203693922&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=203693922"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!3GyS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!3GyS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!3GyS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!3GyS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!3GyS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!3GyS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:386741,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/203693922?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!3GyS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!3GyS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!3GyS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!3GyS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bb6088d-40a8-4b94-934c-8af750e6ffc8_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Parquet&#8217;s internal</figcaption></figure></div><div><hr></div><h1>Intro</h1><p>I caught this quote not long ago:</p><blockquote><p><em>It is impossible for a man to learn what he thinks he already knows. &#8212; <strong><a href="https://www.goodreads.com/author/show/13852.Epictetus">Epictetus</a></strong></em></p></blockquote><p>That quote has been living rent-free in my mind for days.</p><p>It was totally wrong to me at first.</p><p>On a Saturday morning, I decided to reflect on my journey, from having been a data engineer for 6 years to being the author of this newsletter for 3 years. </p><p>I&#8217;ve gradually come to understand the meaning behind that quote. </p><p>I&#8217;ve spent a lot of time researching and learning about data engineering. Over time, I started taking my knowledge for granted. I developed the illusion that I knew everything, making me arrogant and less receptive to new ideas (&#8220;I already know that&#8221;/&#8220;It&#8217;s just a new way to talk about an old idea&#8220;)</p><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&#8220;Sh*t, that&#8217;s bad; that will make me stop learning someday&#8220;</mark></p><p>&#8212;</p><p>Lately, I&#8217;ve been practicing unlearning something I know (or thought I knew). That process is harder than it sounds: <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forget everything you know about something and take the most naive look at it, again</mark>. </p><p>&#8212;</p><p>One of the first things I pick up is the one I've talked about endlessly in this newsletter: the Parquet file format.</p><p>That&#8217;s why I&#8217;m writing this article.</p><div><hr></div><h1>Columnar storage</h1><p>In 2026, the understanding of &#8220;columnar storage&#8221; is not the same as it was in 2019. </p><p>Back then, when the term was mentioned, many people thought that each column&#8217;s data was stored separately (including me). </p><p>That&#8217;s true, but only for some cases.</p><p>Recently, thanks to many high-quality blog posts, video sharing (and AI), columnar storage has been increasingly well understood. </p><p>When a file format says it stores data in columnar fashion, you must dive deeper to see how the &#8220;columnar&#8220; is actually implemented.</p><p>&#8212;</p><p>We know that, in most cases, row-wise format is good for OLTP and bad for OLAP.</p><p>And, column-wise is good for OLAP and bad for OLTP.</p><p>This is because the two serve different kinds of workload:</p><ul><li><p><strong>Point query vs. history scan</strong>: A backend database (e.g., PostgreSQL) usually serves queries that require <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only a few records at a time</mark>. A data warehouse service (e.g., BigQuery) usually serves queries that require <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">scanning historical data</mark> with billions of rows.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!r7Wb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!r7Wb!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png 424w, /__u/substackcdn.com/image/fetch/$s_!r7Wb!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png 848w, /__u/substackcdn.com/image/fetch/$s_!r7Wb!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png 1272w, /__u/substackcdn.com/image/fetch/$s_!r7Wb!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!r7Wb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png" width="328" height="209.31578947368422" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:388,&quot;width&quot;:608,&quot;resizeWidth&quot;:328,&quot;bytes&quot;:26856,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/203693922?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!r7Wb!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png 424w, /__u/substackcdn.com/image/fetch/$s_!r7Wb!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png 848w, /__u/substackcdn.com/image/fetch/$s_!r7Wb!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png 1272w, /__u/substackcdn.com/image/fetch/$s_!r7Wb!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7662c242-fd95-460f-ac37-fa9ddf45bf85_608x388.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p><strong>Whole row vs. some columns:&nbsp;</strong><span>In an OLTP system, a query usually needs to retrieve the </span><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"><span>whole row to get all the information</span></mark><span>.</span> In an OLAP system, when <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">GROUP BY is used on some columns</mark>, bringing all columns into memory is unnecessary.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!XC0_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!XC0_!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png 424w, /__u/substackcdn.com/image/fetch/$s_!XC0_!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png 848w, /__u/substackcdn.com/image/fetch/$s_!XC0_!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png 1272w, /__u/substackcdn.com/image/fetch/$s_!XC0_!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!XC0_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png" width="451" height="200.7007672634271" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:348,&quot;width&quot;:782,&quot;resizeWidth&quot;:451,&quot;bytes&quot;:34690,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/203693922?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!XC0_!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png 424w, /__u/substackcdn.com/image/fetch/$s_!XC0_!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png 848w, /__u/substackcdn.com/image/fetch/$s_!XC0_!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png 1272w, /__u/substackcdn.com/image/fetch/$s_!XC0_!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b8a6220-3412-4a61-840a-920fc725dac1_782x348.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p><strong>Fast write vs batch load</strong>: OLTP requires fast data writes to reflect changes in the new world <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">as quickly as possible</mark>, since these OLTP databases are the state for many services that contribute to business flow.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!r0bU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!r0bU!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png 424w, /__u/substackcdn.com/image/fetch/$s_!r0bU!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png 848w, /__u/substackcdn.com/image/fetch/$s_!r0bU!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png 1272w, /__u/substackcdn.com/image/fetch/$s_!r0bU!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!r0bU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png" width="467" height="162.43478260869566" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:256,&quot;width&quot;:736,&quot;resizeWidth&quot;:467,&quot;bytes&quot;:17621,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/203693922?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!r0bU!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png 424w, /__u/substackcdn.com/image/fetch/$s_!r0bU!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png 848w, /__u/substackcdn.com/image/fetch/$s_!r0bU!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png 1272w, /__u/substackcdn.com/image/fetch/$s_!r0bU!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F984b7399-7e47-4cc1-b0ba-177ea3fcadd7_736x256.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p>For example, when a user subscribes to Netflix, the backend must persist that record so that when the user refreshes the UI, they immediately see they can access all the movies. </p></li><li><p>On the other hand, the dominant use case in data warehouses <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">is batch loading; the cadence can be hourly, daily, or weekly</mark>. </p></li></ul></li><li><p><strong>Latest state vs. history data</strong>: People usually care about the <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">latest state of the record in the OLTP world</mark>: latest balance, latest order, latest address. In OLAP, to gain insight, <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">the latest state alone is not enough; historical data must be retained</mark> for days, months, or years; storage space will be much larger; data must be encoded/compressed to prevent your storage bill from exploding.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!u-of!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!u-of!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png 424w, /__u/substackcdn.com/image/fetch/$s_!u-of!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png 848w, /__u/substackcdn.com/image/fetch/$s_!u-of!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png 1272w, /__u/substackcdn.com/image/fetch/$s_!u-of!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!u-of!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png" width="400" height="231.4540059347181" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:674,&quot;resizeWidth&quot;:400,&quot;bytes&quot;:26592,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/203693922?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!u-of!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png 424w, /__u/substackcdn.com/image/fetch/$s_!u-of!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png 848w, /__u/substackcdn.com/image/fetch/$s_!u-of!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png 1272w, /__u/substackcdn.com/image/fetch/$s_!u-of!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac1bbdb4-25bd-45d7-a3dd-b8d0b2da39c3_674x390.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li></ul><p>&#8212;</p><p>OLTP databases with row-wise formats <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">store data from the same row close together</mark>. This means that if we have 5 records, record A is stored first, then record B, then record C, and so on.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!gJWO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!gJWO!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png 424w, /__u/substackcdn.com/image/fetch/$s_!gJWO!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png 848w, /__u/substackcdn.com/image/fetch/$s_!gJWO!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png 1272w, /__u/substackcdn.com/image/fetch/$s_!gJWO!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!gJWO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png" width="1456" height="691" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:691,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:159538,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/203693922?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!gJWO!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png 424w, /__u/substackcdn.com/image/fetch/$s_!gJWO!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png 848w, /__u/substackcdn.com/image/fetch/$s_!gJWO!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png 1272w, /__u/substackcdn.com/image/fetch/$s_!gJWO!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa10e0a1e-077e-4da2-b187-a90b43e44fc0_1648x782.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">This works well when the system accesses the entire record most of the time</mark>. With the help of indexing (e.g., BTree), the system can quickly locate a record; then, it simply loads the entire record into memory for consumption.</p><p>Organizing records right after one also <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">makes writing fast</mark>. The system first locates an available slot for new data, then writes the entire record continuously without jumping around. </p><p>Thus, you know why the row-wise format fits OLTP workload.</p><p>&#8212;</p><p>However, the row-wise format doesn&#8217;t work well with OLAP.</p><p>The whole record and fast write benefits are not attractive here; when doing aggregation that needs 3 columns on billions of rows, with a row-wise format, the system must bring all column data into memory to extract 3 columns; <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">with a table of 100 columns, you waste bandwidth loading 97 columns</mark>. When you multiply that by a billion rows, the waste and overhead are huge. </p><p>&#8212;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!jf5-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3157653-87f8-4990-898c-d48a7cd07314_1352x700.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!jf5-!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3157653-87f8-4990-898c-d48a7cd07314_1352x700.png 424w, /__u/substackcdn.com/image/fetch/$s_!jf5-!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3157653-87f8-4990-898c-d48a7cd07314_1352x700.png 848w, /__u/substackcdn.com/image/fetch/$s_!jf5-!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3157653-87f8-4990-898c-d48a7cd07314_1352x700.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jf5-!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3157653-87f8-4990-898c-d48a7cd07314_1352x700.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!jf5-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3157653-87f8-4990-898c-d48a7cd07314_1352x700.png" width="1352" height="700" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d3157653-87f8-4990-898c-d48a7cd07314_1352x700.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:700,&quot;width&quot;:1352,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:135778,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/203693922?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3157653-87f8-4990-898c-d48a7cd07314_1352x700.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!jf5-!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3157653-87f8-4990-898c-d48a7cd07314_1352x700.png 424w, /__u/substackcdn.com/image/fetch/$s_!jf5-!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3157653-87f8-4990-898c-d48a7cd07314_1352x700.png 848w, /__u/substackcdn.com/image/fetch/$s_!jf5-!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3157653-87f8-4990-898c-d48a7cd07314_1352x700.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jf5-!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd3157653-87f8-4990-898c-d48a7cd07314_1352x700.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Then people started thinking about storing data in a columnar format: data from each column is stored continuously and separately. This reduces I/O costs, as you can load only 3-column data now, instead of the whole record as with row-wise loading. Also, <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">data from the same column tends to be homogeneous and repetitive, which makes it more efficient to encode and compress.</mark></p><p>&#8212;</p><p>However, storing data in that way has some downsides. </p><p>The most obvious is that the data writes require touching multiple column segments; writing 100 columns requires the system to <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">jump around 100 places to write all the data for a single record</mark>.</p><p>In addition, when queries involve multiple columns, the system must reconstruct the records from separate segments. <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">The cost of this reconstruction increases with the number of columns</mark> involved in the query.</p><p>&#8212;</p><p>The hybrid format steals the best from both worlds.</p><p>The format first <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">splits the data horizontally into portions</mark>, each containing a subset of rows. <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">In each portion, data for each column is stored next to each other</mark>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!fkuO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!fkuO!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png 424w, /__u/substackcdn.com/image/fetch/$s_!fkuO!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png 848w, /__u/substackcdn.com/image/fetch/$s_!fkuO!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png 1272w, /__u/substackcdn.com/image/fetch/$s_!fkuO!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!fkuO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png" width="1334" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1334,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:161122,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/203693922?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!fkuO!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png 424w, /__u/substackcdn.com/image/fetch/$s_!fkuO!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png 848w, /__u/substackcdn.com/image/fetch/$s_!fkuO!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png 1272w, /__u/substackcdn.com/image/fetch/$s_!fkuO!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F137c67f4-0627-4df7-a9a3-a0e8ff9b34d1_1334x794.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This format still provides the benefit of the columnar format, while keeping data from the same row close together; it is, of course, not as close as in the row-wise format, but the row&#8217;s data is now kept in the same portion, <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">reducing the cost of writing data and reconciling a record, as data from the same record is distributed only within the horizontal portion</mark>.</p><p>&#8212;</p><p>When a format claims to be columnar, it is, 80% of the time, a hybrid format. From the internal format of DuckDB, Snowflake, BigQuery, ORC, and the one we discuss in this article: Parquet.</p><p>A small number of formats, such as ClickHouse or Redshift's internal format, are purely columnar. </p><blockquote><p><em>In the rest of this article, I will use the hybrid and columnar formats interchangeably.</em></p></blockquote><p>&#8212;</p><p>Parquet first groups data into &#8220;<mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">row groups</mark>,&#8221; each containing a subset of rows.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!6MN_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!6MN_!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png 424w, /__u/substackcdn.com/image/fetch/$s_!6MN_!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png 848w, /__u/substackcdn.com/image/fetch/$s_!6MN_!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png 1272w, /__u/substackcdn.com/image/fetch/$s_!6MN_!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!6MN_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png" width="1456" height="643" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:643,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:154886,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/203693922?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!6MN_!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png 424w, /__u/substackcdn.com/image/fetch/$s_!6MN_!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png 848w, /__u/substackcdn.com/image/fetch/$s_!6MN_!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png 1272w, /__u/substackcdn.com/image/fetch/$s_!6MN_!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15523f64-6912-45c2-bbb3-151ea9284a65_1458x644.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Within each row group, <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">values from a column are stored together</mark>. Each row group&#8217;s column is called the column chunk. <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">A chunk has a set of pages.</mark></p><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">A page is the smallest data unit in Parquet, used for encoding and compression</mark>. There are several types of pages, including data pages (which contain the actual data) or dictionary pages (which contain dictionary-encoded values). </p><div><hr></div><blockquote><p><em>Reminder: I&#8217;m offering a limited-time <strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">50% discount</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"> on the annual plan</mark>:</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=203693922&quot;,&quot;text&quot;:&quot;50% OFF FOREVER&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=b1c9d853&amp;utm_content=203693922"><span>50% OFF FOREVER</span></a></p><p><em><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Once you claim it, the discount will be applied </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">forever</mark></strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">.</mark></em></p><p>Now, with <mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">only </mark><strong><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">$5/month</mark>,</strong> you will have access to:</p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues</em></p></blockquote>
      <p>
          <a href="/__u/vutr.substack.com/p/heres-everything-you-need-to-know">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[[FREE] How does Uber deal with Spark Out-Of-Memory (OOM)?]]></title><description><![CDATA[By retrying, but in a smarter way]]></description><link>https://vutr.substack.com/p/free-how-does-uber-deal-with-spark</link><guid isPermaLink="false">https://vutr.substack.com/p/free-how-does-uber-deal-with-spark</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Mon, 06 Jul 2026 05:15:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!tqEb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=200848238&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=200848238"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!tqEb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!tqEb!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!tqEb!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!tqEb!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!tqEb!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!tqEb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:190034,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205126811?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!tqEb!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!tqEb!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!tqEb!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!tqEb!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F941a1621-81f2-4714-bf7e-b7f08d39b335_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Intro</h1><p>Uber, famous for their high-volume data processing, encounters the same Spark Out-Of-Memory (OOM) errors that many of us face in production.</p><p>I got a chance to read an article they shared about how they deal with it.</p><p>It&#8217;s very interesting, and I believe you will enjoy it as well. </p><p>So, here we are.</p><p>What you're gonna read next is what Spark OOM is, why it happens, and how Uber deals with it. </p><p>I won&#8217;t spend too much time explaining how Spark works in this article; for that purpose, you can visit my previous article here: </p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;739cc50b-4c37-49c4-ae2e-5fd79d994821&quot;,&quot;caption&quot;:&quot;With only $7/month (billed annually), you can access all the materials you need to grow from junior &#8594; senior DE.&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;showDescription&quot;:true,&quot;showImage&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;If you're learning Apache Spark, this article is for you&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:167177248,&quot;name&quot;:&quot;Vu Trinh&quot;,&quot;bio&quot;:&quot;Data Engineer &#183; Trusted by 18,000+ engineers &#183; I write what it takes to become a production-ready data engineer &#8594; vutr.substack.com&quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!UWAa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4805f673-db97-4f7c-85c4-44b345a8de80_256x256.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-06-26T03:15:30.062Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!R2LW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd8884c0-bf56-4bcc-b3a1-6bb9398be232_2000x1429.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://vutr.substack.com/p/if-youre-learning-apache-spark-this&quot;,&quot;section_name&quot;:&quot;Dimensions.&quot;,&quot;video_upload_id&quot;:null,&quot;id&quot;:166248471,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:58,&quot;comment_count&quot;:5,&quot;publication_id&quot;:1930705,&quot;publication_name&quot;:&quot;VuTrinh.&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!2JXp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb91e59e-4df2-4ac8-b3b4-1f4e830f7b42_256x256.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="pullquote"><blockquote><p><em><strong>Disclaimer</strong>: the technical details on how Uber solve the OOM problem come entirely from their blog airticle: <a href="https://www.uber.com/us/en/blog/dynamic-executor-core-resizing-in-spark/">Dynamic Executor Core Resizing in Spark</a> (2023)</em> </p></blockquote></div><h1>How Spark works?</h1><p>If you want to run Spark, you must have a cluster of machines that provide the resources for the Spark cluster.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!t1Fv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!t1Fv!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png 424w, /__u/substackcdn.com/image/fetch/$s_!t1Fv!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png 848w, /__u/substackcdn.com/image/fetch/$s_!t1Fv!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png 1272w, /__u/substackcdn.com/image/fetch/$s_!t1Fv!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!t1Fv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png" width="1456" height="764" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:764,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:156996,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200072168?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!t1Fv!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png 424w, /__u/substackcdn.com/image/fetch/$s_!t1Fv!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png 848w, /__u/substackcdn.com/image/fetch/$s_!t1Fv!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png 1272w, /__u/substackcdn.com/image/fetch/$s_!t1Fv!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F294bf882-ac59-4dba-b4b9-445d988be2a1_1612x846.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A Spark cluster is a set of JVM processes, including a Driver and Executors. Those processes run on the cluster of machines (with communication with the Cluster Manager).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!4mrr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76d9018-c55b-487c-832f-2526669cf89e_1824x952.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!4mrr!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76d9018-c55b-487c-832f-2526669cf89e_1824x952.png 424w, /__u/substackcdn.com/image/fetch/$s_!4mrr!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76d9018-c55b-487c-832f-2526669cf89e_1824x952.png 848w, /__u/substackcdn.com/image/fetch/$s_!4mrr!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76d9018-c55b-487c-832f-2526669cf89e_1824x952.png 1272w, /__u/substackcdn.com/image/fetch/$s_!4mrr!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76d9018-c55b-487c-832f-2526669cf89e_1824x952.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!4mrr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76d9018-c55b-487c-832f-2526669cf89e_1824x952.png" width="1456" height="760" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a76d9018-c55b-487c-832f-2526669cf89e_1824x952.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:760,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:314813,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200072168?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76d9018-c55b-487c-832f-2526669cf89e_1824x952.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!4mrr!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76d9018-c55b-487c-832f-2526669cf89e_1824x952.png 424w, /__u/substackcdn.com/image/fetch/$s_!4mrr!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76d9018-c55b-487c-832f-2526669cf89e_1824x952.png 848w, /__u/substackcdn.com/image/fetch/$s_!4mrr!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76d9018-c55b-487c-832f-2526669cf89e_1824x952.png 1272w, /__u/substackcdn.com/image/fetch/$s_!4mrr!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76d9018-c55b-487c-832f-2526669cf89e_1824x952.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Every Spark cluster is associated with a Spark application.</p><p>Below the application is the Spark job. A job represents a series of transformations applied to data: the entire workflow from start to finish. The series of transformations (e.g, filter, map&#8230;) can be triggered only by an action (e.g., show, count,&#8230;).  We can say that a job is associated with an action. An application can have multiple jobs.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!D37O!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!D37O!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png 424w, /__u/substackcdn.com/image/fetch/$s_!D37O!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png 848w, /__u/substackcdn.com/image/fetch/$s_!D37O!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png 1272w, /__u/substackcdn.com/image/fetch/$s_!D37O!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!D37O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png" width="1364" height="710" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:710,&quot;width&quot;:1364,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:207107,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200072168?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!D37O!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png 424w, /__u/substackcdn.com/image/fetch/$s_!D37O!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png 848w, /__u/substackcdn.com/image/fetch/$s_!D37O!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png 1272w, /__u/substackcdn.com/image/fetch/$s_!D37O!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4b9de28-cc3e-4de4-8001-0422ad99c09a_1364x710.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A job is split into different stages when a transformation requires shuffling data across partitions. (e.g., groupBy, join). A stage is a job segment executed without data shuffling. </p><p>A stage has a set of tasks. A task is the smallest unit of execution within Spark. Each stage is divided into multiple tasks, each handling a partition, a portion of data from an external source or from the upstream stage. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!B0KW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!B0KW!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png 424w, /__u/substackcdn.com/image/fetch/$s_!B0KW!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png 848w, /__u/substackcdn.com/image/fetch/$s_!B0KW!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png 1272w, /__u/substackcdn.com/image/fetch/$s_!B0KW!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!B0KW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png" width="332" height="306.28169014084506" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:786,&quot;width&quot;:852,&quot;resizeWidth&quot;:332,&quot;bytes&quot;:118609,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200072168?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!B0KW!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png 424w, /__u/substackcdn.com/image/fetch/$s_!B0KW!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png 848w, /__u/substackcdn.com/image/fetch/$s_!B0KW!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png 1272w, /__u/substackcdn.com/image/fetch/$s_!B0KW!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F638b2e1a-21a5-4082-a4a8-c287e1b97c02_852x786.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">At a given stage, tasks can run in parallel; the parallelism depends on the executor&#8217;s CPUs. You can understand that tasks are handled in parallel in an executor using the multithreading paradigm. </mark>By default, a task is handled by an executor core (controlled by the &#8220;spark.task.cpus&#8221; setting); if the executor has 4 cores, 4 tasks can run in parallel within the executor.</p><div><hr></div><blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=205126811&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=205126811"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div><hr></div><h1>Why do OOM errors happen?</h1><p>However, the executor memory cannot be clearly separated like the cores; you might be aware of this: in multi-thread processing, all threads share the memory. With task-processing in an executor, all tasks share the executor&#8217;s processing memory.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!M5q0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba3810c-e852-4560-abdc-844063215625_860x768.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!M5q0!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba3810c-e852-4560-abdc-844063215625_860x768.png 424w, /__u/substackcdn.com/image/fetch/$s_!M5q0!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba3810c-e852-4560-abdc-844063215625_860x768.png 848w, /__u/substackcdn.com/image/fetch/$s_!M5q0!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba3810c-e852-4560-abdc-844063215625_860x768.png 1272w, /__u/substackcdn.com/image/fetch/$s_!M5q0!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba3810c-e852-4560-abdc-844063215625_860x768.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!M5q0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba3810c-e852-4560-abdc-844063215625_860x768.png" width="347" height="309.8790697674419" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9ba3810c-e852-4560-abdc-844063215625_860x768.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:860,&quot;resizeWidth&quot;:347,&quot;bytes&quot;:117898,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200072168?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba3810c-e852-4560-abdc-844063215625_860x768.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!M5q0!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba3810c-e852-4560-abdc-844063215625_860x768.png 424w, /__u/substackcdn.com/image/fetch/$s_!M5q0!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba3810c-e852-4560-abdc-844063215625_860x768.png 848w, /__u/substackcdn.com/image/fetch/$s_!M5q0!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba3810c-e852-4560-abdc-844063215625_860x768.png 1272w, /__u/substackcdn.com/image/fetch/$s_!M5q0!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba3810c-e852-4560-abdc-844063215625_860x768.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Assuming an executor with 4 cores and 8 GB of RAM available for processing and storing data, the executor can handle 4 tasks in parallel, and each task is expected to use up to 2 GB of RAM.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!sISY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!sISY!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png 424w, /__u/substackcdn.com/image/fetch/$s_!sISY!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png 848w, /__u/substackcdn.com/image/fetch/$s_!sISY!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png 1272w, /__u/substackcdn.com/image/fetch/$s_!sISY!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!sISY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png" width="630" height="402.5382932166302" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:584,&quot;width&quot;:914,&quot;resizeWidth&quot;:630,&quot;bytes&quot;:95671,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200072168?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!sISY!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png 424w, /__u/substackcdn.com/image/fetch/$s_!sISY!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png 848w, /__u/substackcdn.com/image/fetch/$s_!sISY!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png 1272w, /__u/substackcdn.com/image/fetch/$s_!sISY!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F274a59b4-e8ce-4133-b4b1-311e25c48f2c_914x584.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If a task needs 5GB of RAM to handle, it causes an OOM.</p><p>Thus, there are two main reasons why OOM errors happen:</p><ul><li><p><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">A task requires more memory to handle a partition.</mark></p></li><li><p><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">The memory portion of a single task shrinks.</mark></p></li></ul><p>For the first one, many factors could cause this: a task is assigned a skewed partition, the input data volume increases, an operation, such as aggregation, requires memory to hold aggregated values, and it is somehow exploited. </p><p>For the latter, the most common root cause is increasing the parallelism of an executor but keeping the memory the same (<mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">increase the spark.executor.cores but not change the spark.executor.memory</mark>)</p><p>An annoying thing is that the OOM might not be deterministic. Back to the example above, a task that handles 5GB of data causes OOM when running alongside three other 3 tasks that only need at most 2GB of memory.</p><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">There is a case when the OOM won&#8217;t happen: when the heavy task runs alone or with at most a single normal task at the same time in the executor:</mark></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!yxK7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!yxK7!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png 424w, /__u/substackcdn.com/image/fetch/$s_!yxK7!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png 848w, /__u/substackcdn.com/image/fetch/$s_!yxK7!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png 1272w, /__u/substackcdn.com/image/fetch/$s_!yxK7!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!yxK7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png" width="539" height="361.63675213675214" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:628,&quot;width&quot;:936,&quot;resizeWidth&quot;:539,&quot;bytes&quot;:73483,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200072168?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!yxK7!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png 424w, /__u/substackcdn.com/image/fetch/$s_!yxK7!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png 848w, /__u/substackcdn.com/image/fetch/$s_!yxK7!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png 1272w, /__u/substackcdn.com/image/fetch/$s_!yxK7!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d68365-ce40-4f6b-bd0f-8edbb38aecb2_936x628.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>If the heavy task runs alone, all 8GB of memory is available for it, and it only needs 5GB to do well.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!IRYG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!IRYG!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png 424w, /__u/substackcdn.com/image/fetch/$s_!IRYG!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png 848w, /__u/substackcdn.com/image/fetch/$s_!IRYG!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png 1272w, /__u/substackcdn.com/image/fetch/$s_!IRYG!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!IRYG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png" width="542" height="374.7746170678337" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:632,&quot;width&quot;:914,&quot;resizeWidth&quot;:542,&quot;bytes&quot;:88852,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200072168?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!IRYG!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png 424w, /__u/substackcdn.com/image/fetch/$s_!IRYG!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png 848w, /__u/substackcdn.com/image/fetch/$s_!IRYG!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png 1272w, /__u/substackcdn.com/image/fetch/$s_!IRYG!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb8544d9-1477-4269-8454-eb0a35daf9ac_914x632.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>If the heavy task runs with only one normal task, both only require 7GB of data, still below the 8GB cap. </p></li></ul><p>If the Spark cluster has two executors, each has 4 cores, this means 8 tasks can run at the same time.</p><p>If the stage&#8217;s total tasks are not divided by 8, for example, 19 or 20, there is a point in time where the total 3 or 4 tasks are run at the same time; each executor could handle 1 or 2 tasks at a time.</p><p><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">If the heavy task somehow ends up in these runs, OOM won&#8217;t occur.</mark></p><div><hr></div><h1>Spark Scheduler behavior</h1><p>You might wonder, &#8220;Why doesn&#8217;t the Spark scheduler check the partition&#8217;s size to allocate it more cleverly, e.g., run the heavy task alone? &#8220;</p><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">This is because the scheduler wasn&#8217;t designed like that. It is built to maximize the Spark cluster resource utilization.</mark></p><p>When a ready-to-run task set is available, the scheduler examines available task slots (executors&#8217; cores) and fills them as quickly as possible, without using the partition&#8217;s size information. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!QIIE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!QIIE!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png 424w, /__u/substackcdn.com/image/fetch/$s_!QIIE!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png 848w, /__u/substackcdn.com/image/fetch/$s_!QIIE!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png 1272w, /__u/substackcdn.com/image/fetch/$s_!QIIE!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!QIIE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png" width="380" height="490.05464480874315" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:944,&quot;width&quot;:732,&quot;resizeWidth&quot;:380,&quot;bytes&quot;:73968,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200072168?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!QIIE!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png 424w, /__u/substackcdn.com/image/fetch/$s_!QIIE!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png 848w, /__u/substackcdn.com/image/fetch/$s_!QIIE!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png 1272w, /__u/substackcdn.com/image/fetch/$s_!QIIE!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4113ef49-442d-4484-bc55-1f93e83ee780_732x944.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Back to the above example with an executor with 4 cores and 8GB of memory. The scheduler sees 4 open slots and assigns 4 tasks. 3 tasks are normal, one of them has a skewed partition and needs 5GB on its own.</p><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">The scheduler&#8217;s assumption about resource usage is fine when all tasks require the same CPU and memory. </mark>However, when a small percentage of tasks require 3x or 5x as much memory as the rest, the assumption no longer holds.</p><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Neither the scheduler nor the executor knows about this beforehand.</mark> So all 4 tasks start running together, sharing the 8GB memory pool. The heavy task keeps asking for more. At some point, the pool runs out. The task failed first, then the executor.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!yM1e!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!yM1e!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png 424w, /__u/substackcdn.com/image/fetch/$s_!yM1e!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png 848w, /__u/substackcdn.com/image/fetch/$s_!yM1e!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png 1272w, /__u/substackcdn.com/image/fetch/$s_!yM1e!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!yM1e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png" width="1456" height="529" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:529,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:142298,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200072168?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!yM1e!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png 424w, /__u/substackcdn.com/image/fetch/$s_!yM1e!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png 848w, /__u/substackcdn.com/image/fetch/$s_!yM1e!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png 1272w, /__u/substackcdn.com/image/fetch/$s_!yM1e!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b93436-6fab-4291-9e41-2eef3aaa2328_1536x558.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">When a task fails, if the number of failures is still within the threshold (spark.task.maxFailures; default: 4), the scheduler resets the task&#8217;s state and places it in the pending queue.</mark> Later, the failed task is executed again, but the problem is not resolved if it&#8217;s still run with other tasks. If you are lucky, the task is re-run when the number of tasks is exhausted.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!MNka!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!MNka!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png 424w, /__u/substackcdn.com/image/fetch/$s_!MNka!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png 848w, /__u/substackcdn.com/image/fetch/$s_!MNka!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png 1272w, /__u/substackcdn.com/image/fetch/$s_!MNka!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!MNka!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png" width="1456" height="558" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:558,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:154233,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200072168?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!MNka!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png 424w, /__u/substackcdn.com/image/fetch/$s_!MNka!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png 848w, /__u/substackcdn.com/image/fetch/$s_!MNka!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png 1272w, /__u/substackcdn.com/image/fetch/$s_!MNka!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64c2ffc9-b498-4085-a5b1-efd11e88b93a_1572x602.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>As I mentioned above, if you have two executors with 4 cores each, 8 tasks can run in parallel. If the total number of tasks is not divisible by 8, such as 19 or 20, some of the last tasks will run with only 3 or 4 tasks at a time instead of 8. This means that if you retry the task, there&#8217;s a high chance it will succeed.</p><p>This is why the same job can pass on Monday and fail on Thursday. A different scheduling order will give a different outcome.</p><p>That&#8217;s the root of why Spark OOM errors sometimes feel unpredictable.</p><div><hr></div><h1>How does Uber deal with OOM?</h1><p>After understanding the nature of the OOM error and the scheduler behavior, let&#8217;s find out how Uber deals with it.</p><p>Uber tries to bring predictability to the table here. </p><p>They adjust the <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">scheduler so it now tracks the tasks run on an executor</mark>. The target is to identify the memory-intensive tasks, the ones that cause OOM.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!6M7W!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!6M7W!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png 424w, /__u/substackcdn.com/image/fetch/$s_!6M7W!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png 848w, /__u/substackcdn.com/image/fetch/$s_!6M7W!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png 1272w, /__u/substackcdn.com/image/fetch/$s_!6M7W!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!6M7W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png" width="1360" height="722" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:722,&quot;width&quot;:1360,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:177216,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205126811?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!6M7W!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png 424w, /__u/substackcdn.com/image/fetch/$s_!6M7W!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png 848w, /__u/substackcdn.com/image/fetch/$s_!6M7W!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png 1272w, /__u/substackcdn.com/image/fetch/$s_!6M7W!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4cf2d6a-6017-404a-b1ff-ef1f8ce7e3e5_1360x722.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">To make things simple, Uber marks all tasks that run on the failed executor as memory-intensive (although one of those tasks is the root cause)</mark></p><p>With the target tasks in place, things are straightforward from here.</p><p>As discussed in the previous section, OOM occurs because the assumption that all tasks in an executor require the same amount of CPU and RAM no longer holds.</p><p>An executor with 4 cores and 8GB of RAM.</p><p>Three require 2GB of RAM.</p><p>One requires 5GB of RAM.</p><p>The whole executor will go down.</p><p>Dynamic Executor Core Resizing marks all these 4 tasks memory-intensive, then simply retry, with a twist here: <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">each task will have the resources of the full executor</mark></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!aemp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!aemp!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png 424w, /__u/substackcdn.com/image/fetch/$s_!aemp!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png 848w, /__u/substackcdn.com/image/fetch/$s_!aemp!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png 1272w, /__u/substackcdn.com/image/fetch/$s_!aemp!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!aemp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png" width="504" height="530.0129032258064" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:978,&quot;width&quot;:930,&quot;resizeWidth&quot;:504,&quot;bytes&quot;:172472,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205126811?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!aemp!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png 424w, /__u/substackcdn.com/image/fetch/$s_!aemp!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png 848w, /__u/substackcdn.com/image/fetch/$s_!aemp!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png 1272w, /__u/substackcdn.com/image/fetch/$s_!aemp!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bed3b79-b5de-4a2f-b19b-f4c1f62c8191_930x978.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The three tasks that require 2GB of RAM each (of course) run fine on the 4-core, 8GB-RAM executor.</p><p>For the big one that requires 5GB of RAM, because it doesn&#8217;t need to share the executor&#8217;s resources with others now, it can have 5GB of RAM as it wishes.</p><p>Uber trades off a bit of resource utilization here in exchange for reliability: <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">the feature doesn&#8217;t require human intervention to adjust the executor&#8217;s resources after an OOM occurs; the scheduler will automatically retry in a &#8220;smarter&#8221; way.</mark></p><p>This helps Uber avoid relying on luck when retrying to get over the OOM; the task that caused the OOM is rerun on the executor alone, so Uber forces it now.</p><p>In return, the executor&#8217;s resource utilization is lower in Spark&#8217;s original design: back to the example above, <mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">when a task requiring 2GB of RAM runs alone on the executor, the remaining 3 cores and 6GB of RAM sit idle.</mark></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!CQ9c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!CQ9c!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png 424w, /__u/substackcdn.com/image/fetch/$s_!CQ9c!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png 848w, /__u/substackcdn.com/image/fetch/$s_!CQ9c!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png 1272w, /__u/substackcdn.com/image/fetch/$s_!CQ9c!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!CQ9c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png" width="1038" height="512" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/afd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:512,&quot;width&quot;:1038,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:95359,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/205126811?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!CQ9c!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png 424w, /__u/substackcdn.com/image/fetch/$s_!CQ9c!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png 848w, /__u/substackcdn.com/image/fetch/$s_!CQ9c!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png 1272w, /__u/substackcdn.com/image/fetch/$s_!CQ9c!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafd4c118-3b9d-4d60-92b2-9897ff0f1a47_1038x512.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Not leveraging all of the executor's resources at a time could mean the end-to-end duration of a Spark job increases.</p><p>One thing to note here is that although memory-intensive tasks now get the full executor, they can still fail; in the example above, if the &#8220;big&#8221; task requires 10 GB instead of 5GB of RAM, the executor&#8217;s resources are still not enough.</p><p>At least Uber has identified the &#8220;big&#8221; task here and can apply optimizations, such as salting.</p><div><hr></div><h1>Outro</h1><p>In this article, I share my understanding of what a Spark OOM error is, why it happens, and, finally, how Uber deals with it using a simple engineering approach while providing much greater reliability.</p><p>Thank you for reading this far.</p><p>See you in my next article.</p><div><hr></div><h1>Reference</h1><p><em>[1] Kalyan Sivakumar, <a href="https://www.uber.com/us/en/blog/dynamic-executor-core-resizing-in-spark/">Dynamic Executor Core Resizing in Spark</a> (2023)</em> </p>]]></content:encoded></item><item><title><![CDATA[Discussion: What are your challenges when learning data engineering?]]></title><description><![CDATA[Too may things? "AI can do everything, so I don't learn" or "I don't have big data"]]></description><link>https://vutr.substack.com/p/discussion-what-are-your-challenges</link><guid isPermaLink="false">https://vutr.substack.com/p/discussion-what-are-your-challenges</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Sat, 04 Jul 2026 10:19:57 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!2JXp!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb91e59e-4df2-4ac8-b3b4-1f4e830f7b42_256x256.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi guys, </p><p>As you might know, besides writing articles, I also spent time creating tools to make learning data engineering more cost-efficient and fun:</p><ul><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><blockquote><p><em>btw, you need to be paid subscriper to access these tools.</em></p></blockquote><p>I created these tools based on my own observations.</p><p>However, I realized the motivation behind them should come from you guys: the readers of this newsletter :d</p><p>So, I want to hear about your challenges.</p><p>Feel free to comment on anything that's preventing you from learning data engineering effectively. Here are a few examples to get you thinking:</p><ul><li><p>I don&#8217;t have &#8220;big&#8221; data</p></li><li><p>Too many things to learn</p></li><li><p>The platform X is too expensive</p></li><li><p>AI can do anything; it demotivates me</p></li><li><p>Fake data doesn&#8217;t reflect real-world scenarios</p></li><li><p>&#8230;</p></li></ul><p>Your sharing will help me sharpen the ideas for my next tools.</p><p>I don&#8217;t promise to solve all your problems with a ton of tools here, but at least I can ensure the next ones could actually solve real problems. </p><p>Have a nice weekend.</p><p>Vu Trinh</p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Polars at a high level]]></title><description><![CDATA[An OLAP query engine with DataFrame API]]></description><link>https://vutr.substack.com/p/polars-at-a-high-level</link><guid isPermaLink="false">https://vutr.substack.com/p/polars-at-a-high-level</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Tue, 30 Jun 2026 05:15:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!7R9g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=200848238&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=200848238"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!7R9g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!7R9g!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!7R9g!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!7R9g!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!7R9g!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!7R9g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:121159,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202698885?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!7R9g!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!7R9g!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!7R9g!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!7R9g!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F374b2d03-4299-405c-af2e-b994f3366663_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="pullquote"><p><em>If you'd like more articles on Polars, please give a like or comment to let me know.</em> </p></div><h1>Intro</h1><p>When it comes to the single-node processing engine, there are two strong candidates here: DuckDB and Polars. </p><p>Last time, <a href="/__u/vutr.substack.com/p/duckdb-at-a-high-level?r=2rj6sg">we learned about DuckDB</a>, and I think we should also bring Polars into the discussion to gain a more comprehensive understanding of these two popular single-node data processing systems.</p><p>In this article, we examine what Polars is, its motivation, design decisions, and use cases.</p><blockquote><p><em><strong>Note</strong>: Although Polars support distributed processing, this article only discusses on its original form: a single-node data processing engine.</em></p></blockquote><div><hr></div><h1>Motivation</h1><p>In 2020, <a href="https://www.linkedin.com/in/ritchievink/">Ritchie Vink</a> was stuck at home because of the COVID pandemic. He spent time on some Rust pet projects. A few were done. But he had an itch. He observed that Rust still lacked a proper DataFrame library (as in Python with Pandas). So he tried something small: a simple Rust crate that does that. (In Rust, a crate is a unit of compilation)</p><p>From there, things got out of hand (in a positive way).</p><p>Less than a year later, Polars 0.6.5 was already beating Spark and pandas by 4 to 6x on the <a href="https://github.com/h2oai/db-benchmark">H2O.ai groupby and join benchmarks</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!0-3F!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!0-3F!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png 424w, /__u/substackcdn.com/image/fetch/$s_!0-3F!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png 848w, /__u/substackcdn.com/image/fetch/$s_!0-3F!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0-3F!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!0-3F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png" width="441" height="515.3258426966293" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:890,&quot;resizeWidth&quot;:441,&quot;bytes&quot;:63797,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202698885?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!0-3F!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png 424w, /__u/substackcdn.com/image/fetch/$s_!0-3F!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png 848w, /__u/substackcdn.com/image/fetch/$s_!0-3F!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0-3F!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609ab278-d739-45ed-aa2b-a921466ceb8b_890x1040.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The motivation for Polars also stemmed from the hardware: Vendors kept adding cores, but tools like NumPy and Pandas still had to be single-threaded (because of Python&#8217;s design). <a href="https://youtu.be/iwGIuGk5nCE?t=197">Ritchie observed</a> that his own laptop had 12 cores and that Pandas was using less than 10% of the available compute.</p><p>Then Polars stopped being a side project.</p><p>In 2023, Vink and <a href="https://www.linkedin.com/in/chiel-peters-29ab3a7b/">Chiel Peters</a>, colleagues for five years by then, incorporated Polars and <a href="https://xomnia.com/post/ritchie-vink-writes-polars-one-of-the-fastest-dataframe-libraries-in-python-and-rust/">raised $4M.</a> At the time, Polars had around 6 million total downloads and 20K GitHub stars. And when I checked the download statistics for the last 30 days, <a href="https://pypistats.org/packages/polars">it's nearly 60 million</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!46Ku!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!46Ku!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png 424w, /__u/substackcdn.com/image/fetch/$s_!46Ku!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png 848w, /__u/substackcdn.com/image/fetch/$s_!46Ku!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png 1272w, /__u/substackcdn.com/image/fetch/$s_!46Ku!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!46Ku!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png" width="1456" height="625" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:625,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:169817,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202698885?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!46Ku!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png 424w, /__u/substackcdn.com/image/fetch/$s_!46Ku!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png 848w, /__u/substackcdn.com/image/fetch/$s_!46Ku!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png 1272w, /__u/substackcdn.com/image/fetch/$s_!46Ku!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1073f8e-9939-45d6-a7df-3b692bdaa84e_2254x968.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://pypistats.org/packages/polars">Source</a></figcaption></figure></div><p>That&#8217;s how Polars was created: an initial pet project to combine the famous data manipulation interface (DataFrame), the high-performance language (Rust), and the implementation of decades of database research: logical plans, cost-based rewriting, predicate pushdown, plus all other things. </p><p>That is indeed the product-market fit in which data professionals rely heavily on the DataFrame API, but the performance of Pandas and NumPy remains a serious bottleneck. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!uC4W!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!uC4W!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png 424w, /__u/substackcdn.com/image/fetch/$s_!uC4W!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png 848w, /__u/substackcdn.com/image/fetch/$s_!uC4W!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png 1272w, /__u/substackcdn.com/image/fetch/$s_!uC4W!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!uC4W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png" width="476" height="296.963963963964" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:554,&quot;width&quot;:888,&quot;resizeWidth&quot;:476,&quot;bytes&quot;:116236,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202698885?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!uC4W!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png 424w, /__u/substackcdn.com/image/fetch/$s_!uC4W!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png 848w, /__u/substackcdn.com/image/fetch/$s_!uC4W!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png 1272w, /__u/substackcdn.com/image/fetch/$s_!uC4W!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c309d85-74f6-4111-bf9f-76cbb7d02cb9_888x554.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>How It Actually Works</h1><blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=202698885&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=202698885"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote>
      <p>
          <a href="/__u/vutr.substack.com/p/polars-at-a-high-level">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[I spent 12 Hours rebuilding my Junior year project: Part 2 - The Transformation Layer]]></title><description><![CDATA[A Guess post from Minh Pham. A weekend project to boost your data engineer career.]]></description><link>https://vutr.substack.com/p/i-spent-12-hours-rebuilding-my-junior-26f</link><guid isPermaLink="false">https://vutr.substack.com/p/i-spent-12-hours-rebuilding-my-junior-26f</guid><dc:creator><![CDATA[Mark Pham]]></dc:creator><pubDate>Thu, 25 Jun 2026 05:15:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!N0KN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=202667495&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=202667495"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!N0KN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!N0KN!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!N0KN!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!N0KN!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!N0KN!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!N0KN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:290013,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!N0KN!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!N0KN!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!N0KN!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!N0KN!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8669e81-3a66-4495-81ae-d10888cae228_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Intro</h1><p>This is a guest post from <a href="https://www.linkedin.com/in/minhbphamm/">Minh Pham</a>, the hardest-working and most enthusiastic data engineer I&#8217;ve ever known. Minh will share his learning on data engineering best practices via a multi-part hands-on project. This is the second part, which is about the transformation layer. </p><blockquote><p><em>For the first part, you can read <a href="/__u/open.substack.com/pub/vutr/p/i-spent-12-hours-rebuilding-my-junior?r=2rj6sg&amp;utm_campaign=post&amp;utm_medium=web">here</a>.</em></p></blockquote><p>If you enjoy it, please react to the article or share it so we know you like it. Plus, Minh is more motivated to write the next part. As you might know, writing an article is hard, but writing an article to guide a hands-on project is 10x harder, as you have to prepare for a lot of things. </p><p>&#8212;</p><p>This is the second part of my series in which I build end-to-end data pipelines, following best practices I learned at Insurify. In <span>part 1</span>, we built the ingestion pipeline - scraping airline reviews, staging them in S3, and loading them into Snowflake.</p><p>Now we pick up where that left off: transforming raw data into analytical models, setting up proper access controls for a small team, and building a CI/CD pipeline that rebuilds only what changed.</p><div><hr></div><h1>The Transformation Pipeline</h1><p>Overall architecture details can be found <a href="https://github.com/MarkPhamm/skytrax_reviews_transformation/blob/main/README.md">here</a>.</p><p><strong>Tech stacks:</strong></p><ul><li><p><code>dbt</code> (dbt-snowflake): Transformation layer - Kimball star schema</p></li><li><p><code>Snowflake</code>: Data warehouse - all RBAC managed by Terraform</p></li><li><p><code>Terraform:</code> Infrastructure as Code - Snowflake + AWS resources</p></li><li><p><code>GitHub Actions: CI/CD</code> - slim CI on PRs, defer/favor-state CD on merge</p></li><li><p><code>AWS S3</code>: Artifact storage - manifests, run results, dbt docs</p></li><li><p><code>AWS CloudFront</code>: CDN for hosting dbt docs</p></li><li><p>AWS IAM OIDC: Keyless authentication for GitHub Actions</p></li><li><p><code>SQLFluff</code>: SQL linting - lowercased keywords, trailing commas, explicit aliases</p></li><li><p><code>Apache Airflow</code> (Astronomer, cosmos): Orchestration</p></li></ul><p><strong>Data Model</strong></p><p>I want to create a simple star schema model that has a <code>fct_reviews</code> table alongside multiple dimensions to support slicing and dicing. I also follow the Kimball process when creating this data model</p><ul><li><p>Define the business process: analyzing customer reviews</p></li><li><p>Define the grain: each review a user submitted</p></li><li><p>Define the dimensions: Aircraft, customer, airline, date, location</p></li><li><p>Define the facts: review_id, is_verified, seat_type,&#8230;..</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!5E7_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!5E7_!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp 424w, /__u/substackcdn.com/image/fetch/$s_!5E7_!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp 848w, /__u/substackcdn.com/image/fetch/$s_!5E7_!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp 1272w, /__u/substackcdn.com/image/fetch/$s_!5E7_!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!5E7_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp" width="885" height="759" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:759,&quot;width&quot;:885,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:48670,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!5E7_!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp 424w, /__u/substackcdn.com/image/fetch/$s_!5E7_!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp 848w, /__u/substackcdn.com/image/fetch/$s_!5E7_!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp 1272w, /__u/substackcdn.com/image/fetch/$s_!5E7_!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4453a2be-d1c2-4923-880f-bbd9557fae87_885x759.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>Prerequisite</h1><p>I would expect you to have completed Part 1, so you have a Snowflake account with raw data loaded. You&#8217;ll also need:</p><ul><li><p>An AWS account (free tier is more than enough)</p></li><li><p>The <code>terraform-admin</code> AWS CLI profile from Part 1</p></li><li><p>Python 3.12+</p></li><li><p>Git</p></li><li><p>Docker (for local Airflow)</p></li></ul><p>If you haven&#8217;t set up AWS or Terraform, follow the guides in <a href="/__u/vutr.substack.com/p/i-spent-12-hours-rebuilding-my-junior?r=2rj6sg&amp;utm_campaign=post&amp;utm_medium=web&amp;triedRedirect=true">Part</a> 1, Steps 3-4.</p><h1>Step 1: Clone the repo and set up your environment</h1><p>The repo link is <a href="https://github.com/MarkPhamm/skytrax_reviews_transformation">here</a>: Clone it and set up a Python virtual environment:</p><pre><code><code>git clone &lt;https://github.com/MarkPhamm/skytrax_reviews_transformation.git&gt;
cd skytrax_reviews_transformation

python -m venv dbt_venv
source dbt_venv/bin/activate
pip install -r requirements-dev.txt
</code></code></pre><p><code>requirements-dev.txt</code> includes <code>dbt-snowflake</code>, <code>sqlfluff</code>, <code>pandas</code>, and other dev tools. The production CI only uses <code>requirements.txt</code> (dbt + sqlfluff).</p><div><hr></div><blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=202667495&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=202667495"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div><hr></div><h1>Step 2: Set up <span>Snowflake Infrastructure</span> with Terraform</h1><p>Before we can run dbt, we need to create the Snowflake database, schemas, roles, users, and warehouses. Everything is defined in terraform/snowflake/main.tf. I actually find this easier than just running the <code>create</code> command in the UI. As more and more analysts enroll in the project, I would just need to change my Terraform file and run <code>terraform apply.</code></p><h2>What Terraform creates for us</h2><p>The Snowflake Terraform code is split across 7 files, each handling one concern:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;7f859fb7-44f0-45ed-b68b-d49377941278&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">terraform/snowflake/
&#9500;&#9472;&#9472; providers.tf     # How Terraform connects to Snowflake
&#9500;&#9472;&#9472; variables.tf     # Input definitions (passwords, account info, defaults)
&#9500;&#9472;&#9472; main.tf          # Shared locals (warehouse sizes, schema maps)
&#9500;&#9472;&#9472; warehouses.tf    # Compute warehouses (XSMALL &#8594; XLARGE)
&#9500;&#9472;&#9472; databases.tf     # Database + all schemas
&#9500;&#9472;&#9472; roles.tf         # Roles + role hierarchy
&#9500;&#9472;&#9472; grants.tf        # All privilege grants + ownership transfers
&#9500;&#9472;&#9472; users.tf         # Users + role-to-user assignments
&#9500;&#9472;&#9472; outputs.tf       # Values printed after apply (for CI/CD config)
&#9492;&#9472;&#9472; terraform.tfvars # Actual secret values (never committed)</code></pre></div><h3><code>providers.tf</code> - Snowflake connection</h3><p>Tells Terraform how to authenticate with Snowflake. It uses <code>ACCOUNTADMIN</code> because it needs full power to create roles, users, and grants. All credentials come from variables (defined in <code>variables.tf</code>, values in <code>terraform.tfvars</code>) so nothing sensitive is hardcoded.</p><h3><code>variables.tf</code> - Input definitions</h3><p>Declares every input Terraform needs: Snowflake org/account, admin credentials, user passwords, database name, and warehouse auto-suspend timeout. Passwords are marked <code>sensitive = true</code> so Terraform redacts them from all output. Variables with a <code>default</code> (like <code>database_name = "SKYTRAX_REVIEWS_DB"</code>) are optional - the rest are required and must be provided in <code>terraform.tfvars</code>.</p><h3><code>main.tf</code> - Shared locals</h3><p>Contains <code>locals</code> blocks - internal variables reused across other files. Three maps:</p><ul><li><p><code>warehouse_sizes</code> - list of warehouse sizes to loop over (<code>XSMALL</code> through <code>XLARGE</code>)</p></li><li><p><code>prod_schemas</code> - the 5 production schemas that the transformer role needs access to</p></li><li><p><code>dev_schemas</code> - per-developer schemas (adding a new analyst here automatically grants them permissions via the loops in <code>grants.tf</code>)</p></li></ul><h3><code>warehouses.tf</code> - Compute warehouses</h3><p>Creates 5 warehouses of increasing size using a <code>for_each</code> loop over <code>warehouse_sizes</code>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!qOWu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!qOWu!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png 424w, /__u/substackcdn.com/image/fetch/$s_!qOWu!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png 848w, /__u/substackcdn.com/image/fetch/$s_!qOWu!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png 1272w, /__u/substackcdn.com/image/fetch/$s_!qOWu!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!qOWu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png" width="888" height="376" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:376,&quot;width&quot;:888,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:66657,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!qOWu!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png 424w, /__u/substackcdn.com/image/fetch/$s_!qOWu!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png 848w, /__u/substackcdn.com/image/fetch/$s_!qOWu!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png 1272w, /__u/substackcdn.com/image/fetch/$s_!qOWu!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe2269a4a-7f50-4b29-8772-df9edbcc1201_888x376.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>All warehouses have <code>auto_suspend = 60</code> (shuts down after 60 seconds of inactivity) and <code>auto_resume = true</code> (wakes up when a query hits it). This keeps costs near zero when nobody is running queries.</p><h3><code>databases.tf</code> - Database and schemas</h3><p>Creates the database <code>SKYTRAX_REVIEWS_DB</code> and 9 schemas inside it:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Mw0I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Mw0I!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png 424w, /__u/substackcdn.com/image/fetch/$s_!Mw0I!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png 848w, /__u/substackcdn.com/image/fetch/$s_!Mw0I!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Mw0I!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Mw0I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png" width="626" height="686" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:686,&quot;width&quot;:626,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:101968,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Mw0I!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png 424w, /__u/substackcdn.com/image/fetch/$s_!Mw0I!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png 848w, /__u/substackcdn.com/image/fetch/$s_!Mw0I!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Mw0I!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F272a90bb-b0a3-4a4e-9c6c-f9ce631d7ea7_626x686.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Why separate schemas for each environment? At Insurify, we follow the same pattern. Production models go to <code>SOURCE</code>/<code>INTERMEDIATE</code>/<code>MARTS</code>, CI runs write to <code>STAGING</code> (flat, gets wiped after each PR), and each developer gets their own <code>DEV_*</code> schema so they can run dbt locally without stepping on each other&#8217;s toes.</p><h3><code>roles.tf</code> - Roles and hierarchy</h3><p>Creates three project-scoped roles and wires them into a hierarchy:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;164e2b6e-77f5-430e-928d-88a1f5a61e60&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">ACCOUNTADMIN
  &#9492;&#9472;&#9472; SYSADMIN
        &#9492;&#9472;&#9472; SKYTRAX_ADMIN (full control over project database)
              &#9500;&#9472;&#9472; SKYTRAX_TRANSFORMER (read/write on production schemas)
              &#9492;&#9472;&#9472; SKYTRAX_ANALYST (read-only on MARTS + write on own dev schema)</code></pre></div><p>The TRANSFORMER role is what dbt uses in CI/CD and production; it can create/replace tables and views across all production schemas. The ANALYST role is for humans - they can only read from MARTS and write to their own dev schema. Wiring SKYTRAX_ADMIN up to SYSADMIN follows Snowflake best practices, so all custom roles are accessible from the top.</p><h3><code>grants.tf</code> - Privileges and ownership</h3><p>The largest file - handles all permission grants. It uses <code>for_each</code> loops over <code>local.prod_schemas</code> and <code>local.dev_schemas</code>, so adding a new schema to those maps in <code>main.tf</code> automatically propagates permissions. The grants break down into:</p><ul><li><p><strong>Warehouse grants</strong> - TRANSFORMER gets USAGE + OPERATE, ANALYST gets USAGE only, ADMIN gets full control</p></li><li><p><strong>Database grants</strong> - TRANSFORMER gets USAGE + CREATE SCHEMA, ANALYST gets USAGE only, ADMIN gets all privileges</p></li><li><p><strong>Schema grants</strong> - TRANSFORMER gets USAGE + CREATE TABLE/VIEW on all production schemas; ANALYST gets USAGE on MARTS only + full read/write on dev schemas</p></li><li><p><strong>Future grants</strong> - Automatically apply permissions to any tables/views created in the future (critical for dbt, which creates new objects on every run)</p></li><li><p><strong>Ownership grants</strong> - Transfers ownership of all current and future tables/views in production schemas to TRANSFORMER. This is needed because dbt uses <code>CREATE OR REPLACE</code>, which requires ownership</p></li></ul><h3><code>users.tf</code> - Users and role assignments</h3><p>Creates 5 users and assigns each one a role:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!to0Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!to0Z!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png 424w, /__u/substackcdn.com/image/fetch/$s_!to0Z!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png 848w, /__u/substackcdn.com/image/fetch/$s_!to0Z!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png 1272w, /__u/substackcdn.com/image/fetch/$s_!to0Z!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!to0Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png" width="926" height="342" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:342,&quot;width&quot;:926,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:70383,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!to0Z!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png 424w, /__u/substackcdn.com/image/fetch/$s_!to0Z!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png 848w, /__u/substackcdn.com/image/fetch/$s_!to0Z!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png 1272w, /__u/substackcdn.com/image/fetch/$s_!to0Z!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bb7d333-448c-48ab-bf8e-856591779afd_926x342.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Each user gets a default warehouse (<code>XSMALL</code>), default role, and default namespace (database.schema). The two service accounts (<code>PROD_DBT</code> and <code>DBT_CICD</code>) both use the TRANSFORMER role but are kept separate so you can audit who did what and revoke one without affecting the other. <code>PROD_DBT</code> is for the Airflow scheduler running daily production builds. <code>DBT_CICD</code> is for GitHub Actions - it runs in the <code>STAGING</code> schema during PRs and deploys to production schemas on merge.</p><h3><code>outputs.tf</code> - Post-apply values</h3><p>Prints useful values after <code>terraform apply</code> - database name, warehouse names, usernames, role names, and schema names. These are handy for configuring dbt profiles, CI/CD pipelines, and BI tool connections.</p><h2>Configure your variables</h2><pre><code><code>cp terraform/snowflake/terraform.tfvars.example terraform/snowflake/terraform.tfvars</code></code></pre><p>Edit terraform/snowflake/terraform.tfvars:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;7313190f-54e5-4e5b-9a78-98577f99f816&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">snowflake_organization_name = "MYORG"
snowflake_account_name      = "MYACCOUNT"
snowflake_admin_user        = "your_username"
snowflake_admin_password    = "your_password"

prod_dbt_password        = "choose_a_password"
cicd_user_password       = "choose_a_password"
gina_analyst_password    = "choose_a_password"
vicient_analyst_password = "choose_a_password"</code></pre></div><p>You can find your org and account from your Snowflake URL: https://MYORG-MYACCOUNT.snowflakecomputing.com.</p><h2>Plan and Apply</h2><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;18085074-d6c8-4968-baf7-76e74feb9ecc&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">cd terraform/snowflake
terraform init
terraform plan
terraform apply</code></pre></div><p>Type yes when prompted</p><h2>Verify in Snowflake</h2><p>Log in to the Snowflake UI and verify:</p><ul><li><p>You should see <code>SKYTRAX_REVIEWS_DB</code> with all the schemas</p></li><li><p>Under Admin &#8594; Users &amp; Roles, you should see the 4 new users and 3 new roles</p></li><li><p>Under Admin &#8594; Warehouses, you should see the 5 compute warehouses</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!fQUz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!fQUz!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png 424w, /__u/substackcdn.com/image/fetch/$s_!fQUz!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png 848w, /__u/substackcdn.com/image/fetch/$s_!fQUz!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png 1272w, /__u/substackcdn.com/image/fetch/$s_!fQUz!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!fQUz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png" width="1456" height="751" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:751,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:339688,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!fQUz!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png 424w, /__u/substackcdn.com/image/fetch/$s_!fQUz!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png 848w, /__u/substackcdn.com/image/fetch/$s_!fQUz!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png 1272w, /__u/substackcdn.com/image/fetch/$s_!fQUz!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0cfa0311-8d34-4a3a-80ee-a67ee9c81f06_1594x822.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Step 3: Set up <span>AWS Infrastructure with </span>Terraform</h1><p>The AWS module creates resources for CI/CD artifact storage and dbt docs hosting. Everything lives in terraform/aws/.</p><h2>What Terraform creates for us</h2><p>The AWS Terraform code is split across 7 files, each handling one concern:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;d7ec79a2-2231-4e11-80f1-6a3424ca45e5&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">terraform/aws/
&#9500;&#9472;&#9472; providers.tf     # How Terraform connects to AWS
&#9500;&#9472;&#9472; variables.tf     # Input definitions (region, project name, bucket name, GitHub repo)
&#9500;&#9472;&#9472; main.tf          # Shared data sources (AWS account ID)
&#9500;&#9472;&#9472; s3.tf            # S3 bucket for dbt artifacts
&#9500;&#9472;&#9472; cloudfront.tf    # CloudFront CDN for dbt docs hosting
&#9500;&#9472;&#9472; iam.tf           # GitHub Actions OIDC provider + IAM role
&#9500;&#9472;&#9472; outputs.tf       # Values printed after apply (for GitHub Secrets)
&#9492;&#9472;&#9472; terraform.tfvars # Actual values (never committed)</code></pre></div><p>Let me walk through what each file creates.</p><h3><code>providers.tf</code> - AWS connection</h3><p>Tells Terraform how to authenticate with AWS. It uses the <code>terraform-admin</code> CLI profile (set up in Part 1) and tags every resource with <code>Project</code>, <code>Environment</code>, and <code>ManagedBy</code> so you can track costs and ownership.</p><h3><code>variables.tf</code> - Input definitions</h3><p>Declares every input Terraform needs: AWS region (defaults to <code>us-east-1</code>), environment name, project name prefix, S3 bucket name, and the GitHub repository (in <code>owner/repo</code> format) for OIDC scoping. Only <code>artifacts_bucket_name</code> and <code>github_repository</code> are required - the rest have sensible defaults.</p><h3><code>main.tf</code> - Shared data sources</h3><p>A small file that looks up the current AWS account ID via <code>data "aws_caller_identity"</code>. This avoids hardcoding your account ID anywhere - other files reference it as <code>data.aws_caller_identity.current.account_id</code>.</p><h3><code>s3.tf</code> - S3 bucket for dbt artifacts</h3><p>Creates the S3 bucket that stores three types of artifacts: <strong>S3 Bucket</strong> (<code>skytrax-reviews-dbt-artifacts-&lt;account_id&gt;</code>) - Stores three types of artifacts:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!0bXz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!0bXz!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png 424w, /__u/substackcdn.com/image/fetch/$s_!0bXz!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png 848w, /__u/substackcdn.com/image/fetch/$s_!0bXz!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0bXz!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!0bXz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png" width="810" height="206" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:206,&quot;width&quot;:810,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:65382,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!0bXz!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png 424w, /__u/substackcdn.com/image/fetch/$s_!0bXz!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png 848w, /__u/substackcdn.com/image/fetch/$s_!0bXz!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0bXz!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6af27f3-7bab-461f-bdf2-93cdeacba067_810x206.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;207a3e56-7ceb-4222-9a74-e1866ec6baf2&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">s3://skytrax-reviews-dbt-artifacts-&lt;account_id&gt;/
&#9500;&#9472;&#9472; manifests/manifest.json       # Production state for defer/favor-state
&#9500;&#9472;&#9472; run_results/run_results.json  # Last deploy results
&#9492;&#9472;&#9472; docs/                         # dbt docs site (HTML + JSON)
    &#9500;&#9472;&#9472; index.html
    &#9500;&#9472;&#9472; catalog.json
    &#9492;&#9472;&#9472; manifest.json</code></pre></div><h3>cloudfront.tf - CDN for dbt docs</h3><p>Serves dbt docs globally via CloudFront CDN. Contains three resources:</p><ul><li><p><strong>Origin Access Control (OAC)</strong> - allows CloudFront to read from S3 without making the bucket public. CloudFront signs every request to S3 using SigV4, so the bucket stays private.</p></li><li><p><strong>CloudFront Distribution</strong> - the CDN itself. Points to the <code>docs/</code> prefix in the S3 bucket, serves <code>index.html</code> as the default root object, caches for 5 minutes (<code>default_ttl = 300</code>), and redirects HTTP to HTTPS.</p></li><li><p><strong>S3 Bucket Policy</strong> - two policy statements: one allows CloudFront to read any object via OAC, and one allows public read on the <code>manifests/*</code> prefix (so developers can <code>curl</code> the production manifest for local defer builds).</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!NH6a!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!NH6a!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png 424w, /__u/substackcdn.com/image/fetch/$s_!NH6a!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png 848w, /__u/substackcdn.com/image/fetch/$s_!NH6a!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png 1272w, /__u/substackcdn.com/image/fetch/$s_!NH6a!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!NH6a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png" width="1456" height="252" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:252,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:234576,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!NH6a!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png 424w, /__u/substackcdn.com/image/fetch/$s_!NH6a!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png 848w, /__u/substackcdn.com/image/fetch/$s_!NH6a!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png 1272w, /__u/substackcdn.com/image/fetch/$s_!NH6a!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fe731ae-fc53-4c6e-8e5b-dc9db49e653f_2390x414.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Why CloudFront instead of EC2? I actually built the EC2 + nginx approach first (the code is still in <strong>disabled/ec2.tf.disabled</strong> and <strong>disabled/vpc.tf.disabled</strong>).</p><p>It worked, but it cost ~$8/month, required OS patching, needed a cron job to sync from S3, and required a whole VPC setup (subnet, internet gateway, route table, security group).</p><p>CloudFront is $0 on the free tier, fully managed, instant updates, and needs only 3 Terraform resources. The EC2 approach was more educational, but for a static site like dbt docs, CloudFront is the right tool.</p><h3><code>iam.tf</code> - GitHub Actions OIDC and IAM role</h3><p>This is the key security piece. Instead of storing long-lived AWS access keys in GitHub Secrets (which can leak and need rotation), we use OpenID Connect (OIDC) so GitHub Actions can assume an IAM role directly. The file creates three resources:</p><ul><li><p><strong>OIDC Identity Provider</strong> - registers GitHub&#8217;s OIDC issuer (<code>token.actions.githubusercontent.com</code>) with AWS. The <code>client_id_list</code> is set to <code>sts.amazonaws.com</code> (the audience claim), and the <code>thumbprint_list</code> is GitHub&#8217;s stable TLS certificate fingerprint. This is a one-time setup per AWS account.</p></li><li><p><strong>IAM Role</strong> (<code>skytrax-reviews-github-actions-role</code>) - the role GitHub Actions assumes. Its trust policy uses a <code>StringLike</code> condition on the <code>sub</code> claim scoped to <code>repo:&lt;owner&gt;/&lt;repo&gt;:*</code>, so only workflows from your specific repo can assume it. No other repo can use this role.</p></li><li><p><strong>IAM Role Policy</strong> - grants three permissions: <code>s3:GetObject/PutObject/DeleteObject</code> on the artifacts bucket (for uploading manifests, run results, and docs), <code>s3:ListBucket</code> (for sync operations), and <code>cloudfront:CreateInvalidation</code> (for busting the docs cache after deploy)</p></li></ul><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;89beb2cb-ee09-4ae9-aa13-8f0467f31367&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">GitHub Actions Runner
  &#9474;
  &#9500;&#9472; 1. Request OIDC token from GitHub's token endpoint
  &#9474;     (includes repo, branch, and event in "sub" claim)
  &#9474;
  &#9500;&#9472; 2. Call aws-actions/configure-aws-credentials
  &#9474;     (passes OIDC token + role ARN to AWS STS)
  &#9474;
  &#9500;&#9472; 3. AWS STS validates token against registered OIDC provider
  &#9474;     - Checks audience = "sts.amazonaws.com"
  &#9474;     - Checks subject matches "repo:MarkPhamm/skytrax_reviews_transformation:*"
  &#9474;
  &#9492;&#9472; 4. STS returns temporary credentials (15 min default)
        (workflow can now call S3 and CloudFront APIs)</code></pre></div><h3><code>outputs.tf</code> - Post-apply values</h3><p>Prints the values you&#8217;ll need for GitHub Secrets configuration: the S3 bucket name, CloudFront distribution ID and domain name, the GitHub Actions IAM role ARN, and the OIDC provider ARN.</p><h2>Configure your variables</h2><pre><code><code>cp terraform/aws/terraform.tfvars.example terraform/aws/terraform.tfvars</code></code></pre><p>Edit terraform/aws/terraform.tfvars:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;8bdbe5c6-e6d0-4153-841d-aef943815b6f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">artifacts_bucket_name = "skytrax-reviews-dbt-artifacts"
github_repository     = "MarkPhamm/skytrax_reviews_transformation"</code></pre></div><p>The bucket name will automatically be suffixed with your AWS account ID.</p><h2>Plan and Apply</h2><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;f41af30e-2c5b-4fbb-86f0-e44ed10be4da&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">cd terraform/aws
terraform init
terraform plan
terraform apply</code></pre></div><p>After it finishes, Terraform outputs the values you'll need for GitHub Secrets:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;51f7cac8-a217-4572-b903-c6b2abf951b4&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Outputs:

github_actions_role_arn       = "arn:aws:iam::XXXXXXXXXXXX:role/skytrax-reviews-github-actions-role"
artifacts_bucket_name         = "skytrax-reviews-dbt-artifacts-XXXXXXXXXXXX"
cloudfront_distribution_id    = "XXXXXXXXXXXX"
cloudfront_domain_name        = "XXXXXXXXXXXX"</code></pre></div><p>Save these - we'll need them in Step 5.</p><div><hr></div><h1>Step 4: Run dbt locally</h1><p>Now the Snowflake infrastructure is ready. Let&#8217;s connect dbt to it and run our models.</p><h2>Set environment variables</h2><p>Set these based on your Snowflake user. Each developer gets their own dev schema:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;4695c353-76eb-4093-8235-57d994040935&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">export SNOWFLAKE_ACCOUNT=your_snowflake_account
export SNOWFLAKE_USER=your_user
export SNOWFLAKE_PASSWORD=your_password
export SNOWFLAKE_ROLE=SKYTRAX_ANALYST
export SNOWFLAKE_SCHEMA=DEV_your_name  # e.g., DEV_MARK</code></pre></div><p>Add these to your ~/.zshrc or a .envrc so you don&#8217;t have to set them every session.</p><h2>Verify connection and run models</h2><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;d19ac4d2-9483-420a-9c83-aa97ebcbede5&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">cd dbt
dbt deps --profiles-dir ./     # install dbt packages (dbt_utils, dbt_expectations)
dbt debug --profiles-dir ./     # verify Snowflake connection
dbt run --profiles-dir ./       # run all models (writes to your dev schema)
dbt test --profiles-dir ./      # run data quality tests</code></pre></div><p>The profiles.yml lives inside the dbt/ directory and uses environment variables for all credentials - no hardcoded secrets.</p><h2>Understanding the data model</h2><p>The transformation follows a classic <strong>staging &#8594; intermediate &#8594; marts</strong> pattern:</p><p><strong>Staging</strong> (<code>stg__skytrax_reviews</code>) - A 1:1 view on top of the raw source table. Adds a <code>review_id</code> via <code>row_number()</code>. Minimal transformation, just mirrors the source.</p><p><strong>Intermediate</strong> (<code>int_reviews_cleaned</code>) - This is where the business logic lives. Null handling with <code>coalesce(..., 'unknown')</code>, column renaming (<code>verify</code> &#8594; <code>is_verified</code>, <code>aircraft</code> &#8594; <code>aircraft_model</code>, <code>review</code> &#8594; <code>review_text</code>), and type standardization.</p><p><strong>Marts</strong> - The star schema following Kimball methodology:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!veAS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!veAS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png 424w, /__u/substackcdn.com/image/fetch/$s_!veAS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png 848w, /__u/substackcdn.com/image/fetch/$s_!veAS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png 1272w, /__u/substackcdn.com/image/fetch/$s_!veAS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!veAS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png" width="772" height="556" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:556,&quot;width&quot;:772,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:92255,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!veAS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png 424w, /__u/substackcdn.com/image/fetch/$s_!veAS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png 848w, /__u/substackcdn.com/image/fetch/$s_!veAS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png 1272w, /__u/substackcdn.com/image/fetch/$s_!veAS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f445d-2119-4809-a4d8-6a4392af86b6_772x556.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>All dimensions use dbt_utils.generate_surrogate_key for deterministic surrogate keys. The fact table joins to all 5 dimensions - with role-playing dimensions for dates (submitted vs. flown) and locations (origin, destination, transit). It also calculates average_rating across all non-null rating columns and a rating_band (bad/medium/good).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!7hp1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!7hp1!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png 424w, /__u/substackcdn.com/image/fetch/$s_!7hp1!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png 848w, /__u/substackcdn.com/image/fetch/$s_!7hp1!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png 1272w, /__u/substackcdn.com/image/fetch/$s_!7hp1!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!7hp1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png" width="1456" height="486" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:486,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:336777,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!7hp1!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png 424w, /__u/substackcdn.com/image/fetch/$s_!7hp1!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png 848w, /__u/substackcdn.com/image/fetch/$s_!7hp1!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png 1272w, /__u/substackcdn.com/image/fetch/$s_!7hp1!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ab72736-7f4b-4904-b7bb-0cedcc5d9fca_2360x788.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Local defer builds (against production)</h2><p>Once there's a production manifest in S3 (of which there&#8217;s not yet), you can run only your changed models locally while referencing production for everything else:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;c828d79d-334f-4965-812b-2e8381655603&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">mkdir -p dbt/prod_state
curl -o dbt/prod_state/manifest.json \\
  &lt;https://skytrax-reviews-dbt-artifacts-203110101827.s3.amazonaws.com/manifests/manifest.json&gt;

cd dbt
dbt run \\
  --select state:modified+ \\
  --defer \\
  --favor-state \\
  --state prod_state \\
  --profiles-dir ./</code></pre></div><p>This is the same pattern the CD pipeline uses - only rebuild what you changed, reference production for everything else. The manifest is publicly readable from S3 (the bucket policy allows <code>s3:GetObject</code> on the <code>manifests/*</code> prefix).</p><p>However, at this time, since we haven&#8217;t even set up the CI/CD pipelines just yet, there would be no artifacts, nor would an S3 bucket exist. In this case, you can just cd into the dbt dir and run <code>dbt_run</code>, which will run all your models locally and output to your dev_schema.</p><div><hr></div><h1>Step 5: Set up CI/CD with GitHub Actions</h1><p>This is where everything comes together. We have two workflows:</p><ul><li><p><code>deploy_main.yml</code> - Continuous Deployment on merge to <code>main</code></p></li><li><p><code>pr_checks.yml</code> - Continuous Integration on pull requests</p></li></ul><h2>Configure GitHub Secrets</h2><p>Go to your GitHub repo &#8594; Settings &#8594; Secrets and variables &#8594; Actions. Add these secrets:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!WZTt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95637a9f-5c2a-4858-ae15-00111217899f_964x810.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!WZTt!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95637a9f-5c2a-4858-ae15-00111217899f_964x810.png 424w, /__u/substackcdn.com/image/fetch/$s_!WZTt!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95637a9f-5c2a-4858-ae15-00111217899f_964x810.png 848w, /__u/substackcdn.com/image/fetch/$s_!WZTt!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95637a9f-5c2a-4858-ae15-00111217899f_964x810.png 1272w, /__u/substackcdn.com/image/fetch/$s_!WZTt!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95637a9f-5c2a-4858-ae15-00111217899f_964x810.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!WZTt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95637a9f-5c2a-4858-ae15-00111217899f_964x810.png" width="964" height="810" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95637a9f-5c2a-4858-ae15-00111217899f_964x810.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:810,&quot;width&quot;:964,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:155860,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95637a9f-5c2a-4858-ae15-00111217899f_964x810.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!WZTt!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95637a9f-5c2a-4858-ae15-00111217899f_964x810.png 424w, /__u/substackcdn.com/image/fetch/$s_!WZTt!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95637a9f-5c2a-4858-ae15-00111217899f_964x810.png 848w, /__u/substackcdn.com/image/fetch/$s_!WZTt!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95637a9f-5c2a-4858-ae15-00111217899f_964x810.png 1272w, /__u/substackcdn.com/image/fetch/$s_!WZTt!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95637a9f-5c2a-4858-ae15-00111217899f_964x810.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!ELVJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!ELVJ!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png 424w, /__u/substackcdn.com/image/fetch/$s_!ELVJ!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png 848w, /__u/substackcdn.com/image/fetch/$s_!ELVJ!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ELVJ!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!ELVJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png" width="866" height="1078" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1078,&quot;width&quot;:866,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:354000,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/202667495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!ELVJ!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png 424w, /__u/substackcdn.com/image/fetch/$s_!ELVJ!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png 848w, /__u/substackcdn.com/image/fetch/$s_!ELVJ!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png 1272w, /__u/substackcdn.com/image/fetch/$s_!ELVJ!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af6b3ee-7658-49b1-8ba5-4495713b0516_866x1078.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>dbt-ci-init/action.yml - reusable in both CI and CD</h2><p><code>action.yml</code> is a shared function that both workflows call to avoid repeating the same setup 7+ times. Every job in <code>pr_checks.yml</code>and <code>deploy_main.yml</code> runs on a fresh VM &#8212; nothing is pre-installed. So every job needs to:</p><ol><li><p>Install Python</p></li><li><p>Create a venv and pip install dependencies</p></li><li><p>Run dbt deps</p></li><li><p>(Optionally) download artifacts from a previous job</p></li></ol><p>Instead of copy-pasting those 15+ lines into every single job, you write it once in <code>action.yml</code> and call it with one line:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;b7cc2c11-a117-423b-a2e9-8648e7349021&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">name: ci-init
uses: ./.github/actions/dbt-ci-init</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;yaml&quot;,&quot;nodeId&quot;:&quot;d976c45b-0b5e-48bc-85ae-484a5d98f989&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-yaml"># =============================================================================
# dbt CI Init -- Reusable Composite Action
# =============================================================================
# This is a shared "function" that every job calls to avoid repeating
# Python/venv/dbt-deps setup 7+ times across the workflow.
# Callers invoke it with:  uses: ./.github/actions/dbt-ci-init
# =============================================================================

name: "dbt CI Init"
description: "Checkout, Python venv, dbt deps, and optional artifact downloads."

# ---------------------------------------------------------------------------
# Inputs (parameters callers can pass in -- all optional with defaults)
# ---------------------------------------------------------------------------
inputs:
  python_version:
    description: "Python version for the venv"
    default: "3.12"
    required: false
  download_base_manifest:
    description: "Download base_manifest artifact to ./base_state"
    default: "false"
    required: false
  download_changed_models:
    description: "Download changed_models artifact"
    default: "false"
    required: false
  download_prod_manifest:
    description: "Download prod_manifest artifact to ./prod_state (for dbt clone)"
    default: "false"
    required: false

# ---------------------------------------------------------------------------
# Steps -- runs directly in the caller's job (composite, not Docker)
# ---------------------------------------------------------------------------
runs:
  using: "composite"
  steps:
    # Install Python (needed because dbt is a Python tool).
    - name: Setup Python
      uses: actions/setup-python@v5
      with:
        python-version: ${{ inputs.python_version }}

    # Create a virtual environment and install all Python packages from requirements.txt
    # (dbt-snowflake, sqlfluff, etc.). shell: bash is required in composite actions.
    - name: Create venv and install dependencies
      shell: bash
      run: |
        python -m venv dbt_venv
        source dbt_venv/bin/activate
        pip install --upgrade pip
        pip install -r requirements.txt

    # Install dbt packages declared in packages.yml (e.g. dbt_utils).
    # --profiles-dir ./ tells dbt to find profiles.yml in the dbt/ directory, not ~/.dbt/.
    - name: dbt deps
      shell: bash
      working-directory: ./dbt
      run: |
        source ../dbt_venv/bin/activate
        dbt deps --profiles-dir ./

    # --- Conditional artifact downloads ---
    # Artifacts are files uploaded by Job 1 (setup_env) and downloaded by later jobs.
    # Each job runs on a fresh VM, so artifacts are how jobs share data.

    # Download the list of changed model names (text file from Job 1).
    - name: Download changed_models artifact
      if: inputs.download_changed_models == 'true'
      uses: actions/download-artifact@v4
      with:
        name: changed_models

    # Download the merge-base manifest for state:modified comparison.
    - name: Download base_manifest artifact
      if: inputs.download_base_manifest == 'true'
      uses: actions/download-artifact@v4
      with:
        name: base_manifest
        path: dbt/base_state

    # Download the production manifest so dbt clone knows where prod tables live.
    - name: Download prod_manifest artifact
      if: inputs.download_prod_manifest == 'true'
      uses: actions/download-artifact@v4
      with:
        name: prod_manifest
        path: dbt/prod_state</code></pre></div><h2>CI</h2><blockquote><p><em>Link to the CI pipeline <a href="https://github.com/MarkPhamm/skytrax_reviews_transformation/blob/main/.github/workflows/pr_checks.yml">here</a>.</em></p></blockquote><p>When you open a PR against main, pr_checks.yml runs. This is slim CI - it only lints, compiles, runs, and tests the models you actually changed. This is intentional, cause when dbt model scales with a long-running model, the CI process can significantly lower development time. The CI process will have its dedicated dbt-project.yml</p><p>The CI pipeline has 7 sequential jobs:</p><ul><li><p><strong>Setup &amp; Detect Changes</strong>: It computes the merge-base SHA between your PR branch and main, checks out the base code, runs dbt parse on both, and uses dbt ls --state base_state --select state:modified state:new to find which models changed. The merge-base approach is important - it compares your PR against the point where your branch diverged from main, not against the latest main. This avoids false positives from other PRs that merged while you were working.</p><ul><li><p>It also detects macro changes - if a macro file changed but no models were detected as modified, it selects all models (since macro changes can affect any dependent model).</p></li></ul></li><li><p><strong>Lint SQL</strong> - Runs sqlfluff lint on only the changed .sql files. Uses git diff --name-only against the merge-base to find them. Our linting rules (configured in setup.cfg) enforce lowercased SQL, trailing commas, explicit column aliases, and shorthand casting (:: instead of CAST()).</p></li><li><p><strong>Compile Changed Models</strong> - Runs dbt compile on only the changed models. This catches Jinja errors, missing refs, and syntax issues without hitting Snowflake.</p></li><li><p><strong>Run Changed Models</strong> - Actually executes the changed models against Snowflake in the STAGING schema. Before running, it uses dbt clone to create zero-copy clones of production tables in the staging schema, so that unchanged upstream models remain available without rebuilding.</p></li><li><p><strong>Test Changed Models</strong> - Runs dbt tests on the changed models in the STAGING schema.</p></li></ul><ul><li><p><strong>Run Downstream Models</strong> - Runs all models downstream of the changed ones (using the model_name+ selector), excluding the changed models themselves (already run in Job 4).</p></li><li><p><strong><span>Test Downstream Models</span></strong> - Tests all downstream models to make sure your changes didn't break anything further down the DAG.</p></li></ul><h2>CD</h2><blockquote><p>Link to the pipeline <a href="https://github.com/MarkPhamm/skytrax_reviews_transformation/blob/main/.github/workflows/deploy_main.yml">here</a>.</p></blockquote><p>When you merge a PR to main, the CD pipeline kicks off. Here&#8217;s the flow:</p><ul><li><p>Check out code + configure AWS via OIDC and install dbt, run dbt debug to verify Snowflake connection</p></li><li><p>Download production manifest from S3 (if exists)</p></li><li><p>Run</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;b0165369-80e5-44c2-b647-ce085d53406a&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">dbt build --select state:modified+ --defer --favor-state --state prod_state</code></pre></div></li><li><p>dbt docs are generated &#8594; uploaded to S3 &#8594; invalidate CloudFront cache</p></li><li><p>Upload manifest + run_results to S3 for next deploy</p></li><li><p>Send email notification (success or failure) - for monitoring CD process</p></li></ul><p>The key insight is <strong>incremental deploys</strong>. Instead of rebuilding all models on every merge, we only rebuild what changed using <code>state:modified+</code> and their downstream dependencies. <code>--defer</code> means unchanged models reference existing production tables. <code>--favor-state</code> means when resolving deferred refs, prefer the production state. This saves significant Snowflake compute credits.</p><p>If this is the very first deploy (no prior manifest in S3), it falls back to a full <code>dbt run</code> + <code>dbt test</code>.</p><p>The workflow also has <strong>concurrency control</strong> - only one deploy runs at a time. If a second push happens while a deploy is running, it queues instead of cancelling. This prevents race conditions on the production manifest.</p><h2>How the manifest flow works</h2><p>This is the part that confused me before building it. Here's the full lifecycle:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;d9ee494b-75a8-4420-8923-b374c61cfdcf&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">First deploy (no manifest):
  &#8594; dbt run (full build) &#8594; dbt test
  &#8594; Upload manifest.json to S3

Second deploy onward:
  &#8594; Download manifest.json from S3
  &#8594; dbt build --select state:modified+ --defer --favor-state --state prod_state
  &#8594; Upload new manifest.json to S3

CI on PR:
  &#8594; Build merge-base manifest locally (dbt parse on main's code)
  &#8594; dbt ls --state base_state --select state:modified
  &#8594; Only lint/compile/run/test changed models</code></pre></div><p>Each deploy uploads its manifest, so the next deploy can diff against it. The CI pipeline doesn't touch S3 at all - it builds its own baseline manifest from the merge-base code. This means CI is completely independent of production deploys.</p><div><hr></div><h1>Step 6: dbt Docs Hosting</h1><p>dbt docs are auto-generated and hosted on CloudFront. Every merge to <code>main</code> triggers:</p><ol><li><p><code>dbt docs generate</code> - produces <code>index.html</code>, <code>catalog.json</code>, <code>manifest.json</code></p></li><li><p><code>aws s3 sync</code> - uploads to <code>s3://bucket/docs/</code></p></li><li><p><code>aws cloudfront create-invalidation</code> - busts the cache</p></li></ol><p>In my case, the docs are at: <a href="https://d38l3fc9bckvbz.cloudfront.net/#!/overview">https://d38l3fc9bckvbz.cloudfront.net</a></p><p>The bucket is private - CloudFront accesses it via Origin Access Control (OAC). This means nobody can bypass CloudFront and hit S3 directly (except for the <code>manifests/*</code> prefix, which is public so developers can <code>curl</code> the production manifest for local defer builds).</p><div><hr></div><h1>Step 7: Set up Local Airflow (Optional)</h1><p>If you want to schedule dbt runs with Airflow, the <code>dbt-dags/</code> directory contains an Astronomer project using the <code>cosmos</code> provider.</p><pre><code><code>cd dbt-dags
astro dev start
</code></code></pre><p>The Airflow UI is at http://localhost:8083. The <code>skytrax_dbt_transformation</code> DAG runs all dbt models as the <code>PROD_DBT</code> user via the <code>cosmos</code> provider - it automatically converts your dbt project into Airflow tasks.</p><p>You&#8217;ll need to set up a Snowflake connection in <code>dbt-dags/.env</code> via <code>AIRFLOW_CONN_SNOWFLAKE_DEFAULT</code> (same format as Part 1&#8217;s Airflow setup).</p><div><hr></div><h1>Outro</h1><p>That&#8217;s it! You now have a fully working transformation pipeline:</p><ul><li><p><strong>Star schema</strong> with 5 dimensions and 1 fact table, following Kimball methodology</p></li><li><p><strong>Slim CI</strong> that only lints, compiles, runs, and tests changed models on PRs</p></li><li><p><strong>Incremental CD</strong> that only rebuilds modified models and their downstream dependencies</p></li><li><p><strong>Keyless auth</strong> via OIDC - no static AWS credentials anywhere</p></li><li><p><strong>Full IaC</strong> - every Snowflake and AWS resource managed by Terraform</p></li><li><p><strong>Per-user dev schemas</strong> for safe local development</p></li><li><p><strong>Auto-hosted dbt docs</strong> on CloudFront, updated on every deploy</p></li></ul><p>If you followed along from Part 1, you&#8217;ve built a complete data pipeline - from scraping raw data off the web, through S3 staging and Snowflake loading, all the way to a production-grade star schema with proper CI/CD and infrastructure as code. Everything is code, everything is reproducible, everything is version-controlled.</p><p>The repo is here: <a href="https://github.com/MarkPhamm/skytrax_reviews_transformation">https://github.com/MarkPhamm/skytrax_reviews_transformation</a>. Feel free to clone it, break it, and make it your own.</p>]]></content:encoded></item><item><title><![CDATA[DuckDB at a high level]]></title><description><![CDATA[The motivation, what make it fast, how it is used in production and more.]]></description><link>https://vutr.substack.com/p/duckdb-at-a-high-level</link><guid isPermaLink="false">https://vutr.substack.com/p/duckdb-at-a-high-level</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Tue, 23 Jun 2026 05:16:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!nwm8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=201853360&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=201853360"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div class="pullquote"><p><em>If you'd like more articles on DuckDB, please give a like or comment to let me know.</em> </p></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!nwm8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!nwm8!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!nwm8!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!nwm8!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nwm8!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!nwm8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:98668,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/201853360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!nwm8!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!nwm8!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!nwm8!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!nwm8!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbb3a1ef-a2bb-442f-99a4-2253e1e67e10_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Intro</h1><p>About 20 years ago, people thought we needed a lot of machines and complex programming abstraction to process and analyze data. Everyone wants MapReduce.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!HzID!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd73afb-303a-424b-8897-dc2ca46df49d_726x612.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!HzID!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd73afb-303a-424b-8897-dc2ca46df49d_726x612.png 424w, /__u/substackcdn.com/image/fetch/$s_!HzID!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd73afb-303a-424b-8897-dc2ca46df49d_726x612.png 848w, /__u/substackcdn.com/image/fetch/$s_!HzID!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd73afb-303a-424b-8897-dc2ca46df49d_726x612.png 1272w, /__u/substackcdn.com/image/fetch/$s_!HzID!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd73afb-303a-424b-8897-dc2ca46df49d_726x612.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!HzID!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd73afb-303a-424b-8897-dc2ca46df49d_726x612.png" width="335" height="282.39669421487605" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/abd73afb-303a-424b-8897-dc2ca46df49d_726x612.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:612,&quot;width&quot;:726,&quot;resizeWidth&quot;:335,&quot;bytes&quot;:210075,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/201853360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd73afb-303a-424b-8897-dc2ca46df49d_726x612.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!HzID!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd73afb-303a-424b-8897-dc2ca46df49d_726x612.png 424w, /__u/substackcdn.com/image/fetch/$s_!HzID!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd73afb-303a-424b-8897-dc2ca46df49d_726x612.png 848w, /__u/substackcdn.com/image/fetch/$s_!HzID!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd73afb-303a-424b-8897-dc2ca46df49d_726x612.png 1272w, /__u/substackcdn.com/image/fetch/$s_!HzID!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabd73afb-303a-424b-8897-dc2ca46df49d_726x612.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>About 10 years ago, people still thought we needed a lot of machines to process and analyze data; however, the programming abstraction must be simpler. Everyone wants Spark. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!HhoS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!HhoS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png 424w, /__u/substackcdn.com/image/fetch/$s_!HhoS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png 848w, /__u/substackcdn.com/image/fetch/$s_!HhoS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png 1272w, /__u/substackcdn.com/image/fetch/$s_!HhoS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!HhoS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png" width="230" height="233.89830508474577" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:360,&quot;width&quot;:354,&quot;resizeWidth&quot;:230,&quot;bytes&quot;:10888,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/201853360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!HhoS!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png 424w, /__u/substackcdn.com/image/fetch/$s_!HhoS!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png 848w, /__u/substackcdn.com/image/fetch/$s_!HhoS!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png 1272w, /__u/substackcdn.com/image/fetch/$s_!HhoS!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b4bafa0-16f3-4aef-8414-a2589c27242f_354x360.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>Recently, people haven&#8217;t thought that way anymore.</p><p>We can now process and analyze data with only a single machine and a simpler programming abstraction.</p><p>Single-node processing tools, such as DuckDB (SQL) and Polar (DataFrame API), are receiving increasing attention.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!YQt0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe07905ff-516c-4704-8350-c420ba1abe84_1006x476.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!YQt0!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe07905ff-516c-4704-8350-c420ba1abe84_1006x476.png 424w, /__u/substackcdn.com/image/fetch/$s_!YQt0!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe07905ff-516c-4704-8350-c420ba1abe84_1006x476.png 848w, /__u/substackcdn.com/image/fetch/$s_!YQt0!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe07905ff-516c-4704-8350-c420ba1abe84_1006x476.png 1272w, /__u/substackcdn.com/image/fetch/$s_!YQt0!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe07905ff-516c-4704-8350-c420ba1abe84_1006x476.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!YQt0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe07905ff-516c-4704-8350-c420ba1abe84_1006x476.png" width="409" height="193.52286282306164" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e07905ff-516c-4704-8350-c420ba1abe84_1006x476.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:476,&quot;width&quot;:1006,&quot;resizeWidth&quot;:409,&quot;bytes&quot;:46824,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/201853360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe07905ff-516c-4704-8350-c420ba1abe84_1006x476.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!YQt0!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe07905ff-516c-4704-8350-c420ba1abe84_1006x476.png 424w, /__u/substackcdn.com/image/fetch/$s_!YQt0!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe07905ff-516c-4704-8350-c420ba1abe84_1006x476.png 848w, /__u/substackcdn.com/image/fetch/$s_!YQt0!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe07905ff-516c-4704-8350-c420ba1abe84_1006x476.png 1272w, /__u/substackcdn.com/image/fetch/$s_!YQt0!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe07905ff-516c-4704-8350-c420ba1abe84_1006x476.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>I believe that when a medium-sized company starts building its data infrastructure, Spark is no longer the only option on its list, given that DuckDB and Polar can handle hundreds of GB of data with unfair simplicity.</p><p>&#8212;</p><p>I analyzed the rise of the <a href="/__u/vutr.substack.com/p/why-single-node-engine-like-duckdb?utm_source=publication-search">single-node processing tools</a> in the past. What I&#8217;m trying to do in this article is discuss <strong>DuckDB</strong>, a unique OLAP system introduced in 2019 that is gradually changing our thinking about &#8220;big data&#8221;.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!YR2q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!YR2q!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png 424w, /__u/substackcdn.com/image/fetch/$s_!YR2q!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png 848w, /__u/substackcdn.com/image/fetch/$s_!YR2q!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png 1272w, /__u/substackcdn.com/image/fetch/$s_!YR2q!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!YR2q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png" width="218" height="212" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:212,&quot;width&quot;:218,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13841,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/201853360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!YR2q!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png 424w, /__u/substackcdn.com/image/fetch/$s_!YR2q!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png 848w, /__u/substackcdn.com/image/fetch/$s_!YR2q!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png 1272w, /__u/substackcdn.com/image/fetch/$s_!YR2q!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d7ea737-1788-41f7-a45f-12609433a43d_218x212.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><blockquote><p><em><strong>Note</strong>: This article is <strong>NOT</strong> <strong>sponsored</strong> by DuckDB. What you're gonna read is based purely on my own research and understanding.</em> </p></blockquote><div><hr></div><h1>The motivation</h1><p>DuckDB is quite unique, not only in the OLAP world but in the database world in general. </p><p>Most databases are designed on a client-server model, where the client (you) and the server (the database) are usually on separate compute instances. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!A3Tl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!A3Tl!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png 424w, /__u/substackcdn.com/image/fetch/$s_!A3Tl!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png 848w, /__u/substackcdn.com/image/fetch/$s_!A3Tl!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png 1272w, /__u/substackcdn.com/image/fetch/$s_!A3Tl!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!A3Tl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png" width="331" height="260.6532438478747" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:704,&quot;width&quot;:894,&quot;resizeWidth&quot;:331,&quot;bytes&quot;:65129,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/201853360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!A3Tl!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png 424w, /__u/substackcdn.com/image/fetch/$s_!A3Tl!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png 848w, /__u/substackcdn.com/image/fetch/$s_!A3Tl!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png 1272w, /__u/substackcdn.com/image/fetch/$s_!A3Tl!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe9290-676b-4ceb-bb3d-25b98c0b56c0_894x704.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>DuckDB isn&#8217;t like that. It aligns with the philosophy of simplicity and embedded operation, drawing inspiration from the famous SQLite (from the OLTP world).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!jQkN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!jQkN!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png 424w, /__u/substackcdn.com/image/fetch/$s_!jQkN!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png 848w, /__u/substackcdn.com/image/fetch/$s_!jQkN!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jQkN!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!jQkN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png" width="443" height="316.5548902195609" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:716,&quot;width&quot;:1002,&quot;resizeWidth&quot;:443,&quot;bytes&quot;:80030,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/201853360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!jQkN!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png 424w, /__u/substackcdn.com/image/fetch/$s_!jQkN!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png 848w, /__u/substackcdn.com/image/fetch/$s_!jQkN!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jQkN!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3985874b-1c84-4214-97ff-a4c8c1121de0_1002x716.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>From the user&#8217;s point of view, DuckDB is simply an SQL interface running alongside other applications on your laptop, integrating the (powerful) analytical functionality into the host process.</p><p>In other words, when you install DuckDB on your laptop, it runs as a process, just like other applications, such as Chrome or Visual Studio Code.</p><p>&#8212;</p><p><a href="https://mytherin.github.io/">Mark Raasveldt</a>, co-founder of DuckDB Labs, spent his PhD solving a problem.</p><p>At a database architecture research group, surrounded by people whose entire job title started with the word &#8220;data,&#8221; and who still avoided database systems entirely.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!TwCa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!TwCa!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png 424w, /__u/substackcdn.com/image/fetch/$s_!TwCa!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png 848w, /__u/substackcdn.com/image/fetch/$s_!TwCa!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TwCa!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!TwCa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png" width="461" height="204.3296943231441" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:406,&quot;width&quot;:916,&quot;resizeWidth&quot;:461,&quot;bytes&quot;:62144,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/201853360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!TwCa!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png 424w, /__u/substackcdn.com/image/fetch/$s_!TwCa!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png 848w, /__u/substackcdn.com/image/fetch/$s_!TwCa!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png 1272w, /__u/substackcdn.com/image/fetch/$s_!TwCa!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba6240ad-87cc-43e0-941b-a9c99523ff1e_916x406.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Terabytes of CSVs sitting on disk, but they prefer scripting languages like Python or R rather than traditional databases. Mark didn&#8217;t stand it. A piece of technology with 50 years of engineering behind it: query optimizers, compression, concurrency control, all the stuff people spend entire careers on, and the people whose job is literally "data" want nothing to do with it.</p><p>The challenges are:</p><ul><li><p>Setting up a client-server database (even something as lightweight as Postgres) is quite overhead, especially with ones that only want to work with data (e.g., data scientists).</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!0u90!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!0u90!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png 424w, /__u/substackcdn.com/image/fetch/$s_!0u90!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png 848w, /__u/substackcdn.com/image/fetch/$s_!0u90!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0u90!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!0u90!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png" width="425" height="212.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:780,&quot;resizeWidth&quot;:425,&quot;bytes&quot;:18644,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/201853360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!0u90!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png 424w, /__u/substackcdn.com/image/fetch/$s_!0u90!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png 848w, /__u/substackcdn.com/image/fetch/$s_!0u90!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png 1272w, /__u/substackcdn.com/image/fetch/$s_!0u90!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffeaaed3-2adb-485f-8b92-a3d7465ca06b_780x390.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p>Getting data in and out of the database is costly. To process data, they must ingest it into the database. To route the data to other systems, they have to extract it from the database (e.g., port the data to Pandas). However, moving (a decent amount of) data effectively is always a challenge. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Wcp0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Wcp0!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png 424w, /__u/substackcdn.com/image/fetch/$s_!Wcp0!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png 848w, /__u/substackcdn.com/image/fetch/$s_!Wcp0!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Wcp0!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Wcp0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png" width="418" height="232.22222222222223" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:702,&quot;resizeWidth&quot;:418,&quot;bytes&quot;:28112,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/201853360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Wcp0!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png 424w, /__u/substackcdn.com/image/fetch/$s_!Wcp0!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png 848w, /__u/substackcdn.com/image/fetch/$s_!Wcp0!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Wcp0!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb83a2d5-f3f1-46eb-ad1f-0fdc41256a4f_702x390.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p>And, the dependencies are worth mentioning here. If you pack your analytical logic in a Jupyter notebook or a shared script, a client-server database introduces external state. Now your &#8220;self-contained&#8221; snippet of code depends on a server (database) running somewhere else.</p></li></ul><p>SQLite solved some of this; it&#8217;s embedded, no server, just a library you import. But SQLite is an OLTP. Single-threaded, built for point lookups and small writes.</p><p>So product-market fit might look like this: something with SQLite&#8217;s <em>embedded</em> philosophy, but built for analytics from the ground up: columnar, vectorized, parallel, easy data integration.</p><p>That&#8217;s the motivation behind DuckDB. </p><div><hr></div><h1>Architecture</h1><blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+ </strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=201853360&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=201853360"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div><hr></div>
      <p>
          <a href="/__u/vutr.substack.com/p/duckdb-at-a-high-level">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[9 software engineering skills a DE should have and how to learn them effectively.]]></title><description><![CDATA[Make your work more reliable]]></description><link>https://vutr.substack.com/p/9-software-engineering-skills-a-de</link><guid isPermaLink="false">https://vutr.substack.com/p/9-software-engineering-skills-a-de</guid><dc:creator><![CDATA[Vu Trinh]]></dc:creator><pubDate>Tue, 16 Jun 2026 05:16:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!f2YV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+</strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=200848238&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=200848238"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!f2YV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!f2YV!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!f2YV!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!f2YV!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!f2YV!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!f2YV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png" width="1456" height="1040" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1040,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:651834,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200848238?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!f2YV!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png 424w, /__u/substackcdn.com/image/fetch/$s_!f2YV!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png 848w, /__u/substackcdn.com/image/fetch/$s_!f2YV!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png 1272w, /__u/substackcdn.com/image/fetch/$s_!f2YV!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bb42302-88ea-4d9c-97b9-04c51027458e_2000x1429.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h1>Intro</h1><p>In recent years, people have called for applying software engineering best practices to data engineering. From CI/CD and testing to environment separation and observability.</p><p>The motivation is understandable: if software engineering best practices could ensure software quality, we hope they could do the same for data quality. </p><p>I think that&#8217;s a great idea. </p><p>But now, we have to expand our technical breadth even more. That journey might be confusing.</p><p>To clear the mist, I wrote this article to list skills/areas of software engineering that a data engineer must equip themselves with, along with an approach to learning them effectively. Hope this makes your roadmap a bit clearer.</p><p>Before jumping into those skills, let's first understand what software engineering is. </p><blockquote><p><em>This article is written purely based on my experience and observations. If you find I miss anything, feel free to let me know.</em></p></blockquote><div><hr></div><h1>What is software engineering?</h1><p>I have a confession.</p><p>For the first few years of my career as a data engineer, I thought software engineering just meant creating working code.</p><p>And there's nothing more to say about it; I was wrong. That thought makes me focus only on the writing code aspect and ignore everything else.  </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!f6OL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!f6OL!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png 424w, /__u/substackcdn.com/image/fetch/$s_!f6OL!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png 848w, /__u/substackcdn.com/image/fetch/$s_!f6OL!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png 1272w, /__u/substackcdn.com/image/fetch/$s_!f6OL!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!f6OL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png" width="1248" height="414" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:414,&quot;width&quot;:1248,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51615,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200848238?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!f6OL!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png 424w, /__u/substackcdn.com/image/fetch/$s_!f6OL!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png 848w, /__u/substackcdn.com/image/fetch/$s_!f6OL!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png 1272w, /__u/substackcdn.com/image/fetch/$s_!f6OL!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F587c2410-a14a-42e5-bd02-c8e9fc5cfeb5_1248x414.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Software engineering is the discipline of building systems that keep working.</mark> Even when requirements change, when bugs arise, and when the guy who originally created them has left the company. Software engineering makes us think about maintainability, reliability, testability, productivity, and scalability. </p><p>For data engineers, seeing software engineering as more than coding is crucial. It is no exaggeration to say that software engineering practice is 90% about what works reliably, especially in contexts where even a small mistake could make people lose trust in the data we provide. </p><p>The rest of this article covers the specific software engineering skills I believe we should all have. </p><div><hr></div><h1>Writing code that other people (and future you) can understand</h1><blockquote><p><em>I said coding is not software engineering, but listing it as the first thing to learn here. &#175;\_(&#12484;)_/&#175;</em></p></blockquote><p>(Saying this might get me into a lot of trouble &#8594;) Writing code is easy.</p><p>But writing understandable code is hard. It needs time.  </p><p>Writing understandable code means expressing your logic clearly enough that another engineer (or even you, six months from now) can understand, modify, and extend it without spending a whole day figuring out what the current code is doing. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!EK3M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!EK3M!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png 424w, /__u/substackcdn.com/image/fetch/$s_!EK3M!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png 848w, /__u/substackcdn.com/image/fetch/$s_!EK3M!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png 1272w, /__u/substackcdn.com/image/fetch/$s_!EK3M!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!EK3M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png" width="469" height="185.79229122055673" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:370,&quot;width&quot;:934,&quot;resizeWidth&quot;:469,&quot;bytes&quot;:68647,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200848238?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="/__u/substackcdn.com/image/fetch/$s_!EK3M!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png 424w, /__u/substackcdn.com/image/fetch/$s_!EK3M!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png 848w, /__u/substackcdn.com/image/fetch/$s_!EK3M!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png 1272w, /__u/substackcdn.com/image/fetch/$s_!EK3M!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a701cd4-03f3-4ec3-a1d7-ab4f756f0588_934x370.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>I don&#8217;t think I need to discuss much about why we must write understandable code here; a very high chance that you&#8217;ve already faced a situation where you inherit someone&#8217;s code and a week later you still don&#8217;t fully understand it, or have the courage to adjust something with 100% sure it won&#8217;t break. </p><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Writing understandable code makes you a less selfish person.</mark></p><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Also, it makes you become better at writing code.</mark> To do it, you must first clear your thought process, which will make you better at reasoning and expressing things. </p><p>&#8212;</p><h2>How to learn?</h2><p>And to achieve it, start simple. Give variables meaningful names, create functions that do one thing and modules that have a clear purpose, and add comments where code is not enough. Then, pay attention to design patterns (<a href="https://python-patterns.guide/">Python-general</a> or <a href="https://www.startdataengineering.com/post/code-patterns/">data-pipeline-specific</a>) and follow up your programming language best practices or your company&#8217;s practices.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!suIq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!suIq!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png 424w, /__u/substackcdn.com/image/fetch/$s_!suIq!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png 848w, /__u/substackcdn.com/image/fetch/$s_!suIq!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png 1272w, /__u/substackcdn.com/image/fetch/$s_!suIq!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_webp, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!suIq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png" width="427" height="269.2367256637168" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/be4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:570,&quot;width&quot;:904,&quot;resizeWidth&quot;:427,&quot;bytes&quot;:81437,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://vutr.substack.com/i/200848238?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!suIq!, /__u/vutr.substack.com/w_424, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png 424w, /__u/substackcdn.com/image/fetch/$s_!suIq!, /__u/vutr.substack.com/w_848, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png 848w, /__u/substackcdn.com/image/fetch/$s_!suIq!, /__u/vutr.substack.com/w_1272, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png 1272w, /__u/substackcdn.com/image/fetch/$s_!suIq!, /__u/vutr.substack.com/w_1456, /__u/vutr.substack.com/c_limit, /__u/vutr.substack.com/f_auto, /__u/vutr.substack.com/q_auto:good, /__u/vutr.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe4347e9-6e2e-41a4-9404-363bece2a5eb_904x570.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">To me, the best way to learn is by participating in the coding review process on both sides: having your code reviewed and reviewing someone&#8217;s code. This allows you to get feedback from others while learning from how they write code. </mark></p><p>Another effective approach is to read open-source code, or even better, contribute to some open-source project. To enable collaboration, those projects must be understandable enough: you will learn a lot by the way they organize the code, naming the variable, expressing if-else, or handling edge cases.</p><p>Read it and &#8220;steal&#8220; some of their method, if you can, contribute to the project, and you will have a code review session from the project&#8217;s maintainers, who have a lot of experience in writing understandable code. </p><div><hr></div><h1>Version Control</h1><blockquote><p>It&#8217;s more than Git.</p></blockquote><div><hr></div><blockquote><p><em>With only <strong>$7/month (billed annually)</strong>, you can access all the materials you need to grow from junior &#8594; senior DE.</em></p><ul><li><p><em><strong>200+</strong>deep-dive data engineering articles</em></p></li><li><p><em><strong><a href="https://spark.vutrinh.net/problems">practice-spark</a></strong></em>: <strong>65 LeetCode-style problems</strong> to practice <strong>Spark SQL/DataFrame</strong></p></li><li><p><em><strong><a href="https://learn.vutrinh.net/#tool">learn-spark/dbt/airflow</a></strong>: <strong>CLI tools</strong> to master <strong>Spark/dbt/Airflow</strong></em></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=200848238&quot;,&quot;text&quot;:&quot;Upgrade with 7$/month&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="/__u/vutr.substack.com/subscribe?coupon=c08a9839&amp;utm_content=200848238"><span>Upgrade with 7$/month</span></a></p><ul><li><p><em>If you&#8217;re a student with an education email, use this <strong><a href="/__u/vutr.substack.com/subscribe?coupon=0b37c676">50% ANNUAL DISCOUNT</a></strong></em></p></li><li><p><em>If you&#8217;re a <strong>Vietnamese user</strong>, please DM me for an upgrade due to payment issues. As compensation for the inconvenience, you&#8217;ll get <strong>50% OFF</strong> the annual plan.</em></p></li></ul></blockquote><div><hr></div>
      <p>
          <a href="/__u/vutr.substack.com/p/9-software-engineering-skills-a-de">
              Read more
          </a>
      </p>
   ]]></content:encoded></item></channel></rss>