<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rizal Ardiyanto on Medium]]></title>
        <description><![CDATA[Stories by Rizal Ardiyanto on Medium]]></description>
        <link>https://medium.com/@rizal.ardiyanto?source=rss-2075f9a02a2c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*uF_x2LU405gNOodB</url>
            <title>Stories by Rizal Ardiyanto on Medium</title>
            <link>https://medium.com/@rizal.ardiyanto?source=rss-2075f9a02a2c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 17:31:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rizal.ardiyanto/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Panic to Pipeline: Surviving Midnight Crisis as a Data Engineer]]></title>
            <link>https://medium.com/dkatalis/from-panic-to-pipeline-surviving-midnight-crisis-as-a-data-engineer-b3793832d248?source=rss-2075f9a02a2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3793832d248</guid>
            <dc:creator><![CDATA[Rizal Ardiyanto]]></dc:creator>
            <pubDate>Thu, 05 Sep 2024 02:45:07 GMT</pubDate>
            <atom:updated>2024-09-09T06:16:35.175Z</atom:updated>
            <content:encoded><![CDATA[<h4>Lessons learned from a sudden discovery of missing data.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NUVSyOqlKnCmhn0rwNm-ww.png" /></figure><p>It was another night when my phone buzzed with a Slack call from my Boss. The message read: “Hey, the data in this table has been missing for two months. What’s going on?” Instantly, my heart was racing hard. Two months???</p><p>I jumped out of bed and fired up my laptop. Running a quick query on the table confirmed my worst fears. The last entry was from two months ago, and OMG, a significant chunk of data was missing.</p><p>Have you ever had one of these nights?</p><p>If you’re a Data Engineer, you’ll probably resonate with my story. I’m here to share what I went through and how I came out alive, somewhat peacefully. I was rushing, digging, and searching frantically; what the heck was wrong!!</p><p>I probably discovered the possible root cause of the issue: an archaic Airflow pipeline that no one knows about. It was one of those can-of-worms experiences I had long ago, something forgotten yet continuing to run quietly in the background. I tried rerunning the pipeline, hoping for a quick fix, but no luck. The task kept failing.</p><p>Diving into the error logs, I discovered the Airflow task was trying to connect to an IP address belonging to a foreign MySQL Database (not a URL or hostname).</p><p>At this point, I was panicking. I had no clue what was what and needed to find someone who knew about this ASAP. I reached out to any of my teammates, asking if anyone had any idea about this mysterious MySQL server. Finding the right person was not easy since it was so early in the day.</p><p>After what felt like an eternity (two whole days, actually), someone mentioned to me that the IT Infrastructure team would know this.</p><p>I hopped on a WhatsApp call with the infra guy, who was also still wide awake in the middle of the night, trying to fix things. It turned out that the IP address had been changed due to a recent disaster recovery (DR) exercise (that needs to turn on and off the application database).</p><p>He scrambled to locate the new IP address. Once we had it, I updated the Airflow connection to point to the new IP. And just like that, the pipeline worked again!</p><p>It was a painful process but a victory nonetheless.</p><h4><strong>The challenge continued</strong></h4><p>With the pipeline back online, the next challenge was to rerun all the failed jobs from the past two months. Fortunately, the data volume was relatively small (a few hundred records per day), so backfilling was a breeze. We could load all the missing data back into the table in less than two hours.</p><p>But the story didn’t end there. For two months, we had been reporting incomplete data to the regulators (I work for a Retail Bank). We now had to gather all impacted people, draft a formal memo, and plan for data remediation.</p><p>In the end, we had to submit some corrections to the Regulator. It wasn’t a big deal, but it did cost us some money (due to the correction report). It was frustrating, for sure, but in the grand scheme of things, it could have been much worse.</p><h4><strong>What can we learn?</strong></h4><p>This story was definitely NOT how you live peacefully as a Data Engineer, but there are some lessons that I hope we all can take<strong>:</strong></p><ul><li><strong>Do a full scan on legacy systems</strong>: Just because something is old doesn’t mean it is irrelevant. Regularly review and enhance these old pipelines.</li><li><strong>Documentation is a must</strong>: If there’s an important pipeline or connection (e.g., one consumed for regulatory reporting), make sure it’s documented. That way, if something breaks, you’re not starting from scratch.</li><li><strong>Stay connected</strong>: When things go south, it is all about who you know. Build good communication lines with teams from upstream (application) to downstream (business users)</li></ul><p>Finally, sometimes, the only way you learn about critical problems is through such incidents. So make sure you stay adaptable and are ready for anything!</p><p><em>Hey, you look familiar! Perhaps you are our next Katalis? Join the adaptive and innovative team in building the future of life-centric digital banking </em><a href="http://dkatalis.com/jobs"><strong><em>here</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3793832d248" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dkatalis/from-panic-to-pipeline-surviving-midnight-crisis-as-a-data-engineer-b3793832d248">From Panic to Pipeline: Surviving Midnight Crisis as a Data Engineer</a> was originally published in <a href="https://medium.com/dkatalis">DKatalis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[6 “Lesser Known” Best Practices in DBT (Data Build Tool)]]></title>
            <link>https://medium.com/dkatalis/6-lesser-known-best-practices-in-dbt-data-build-tool-f94687abf89d?source=rss-2075f9a02a2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f94687abf89d</guid>
            <category><![CDATA[analytics-engineering]]></category>
            <category><![CDATA[dbt]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Rizal Ardiyanto]]></dc:creator>
            <pubDate>Sat, 21 Oct 2023 08:19:18 GMT</pubDate>
            <atom:updated>2023-10-31T04:29:29.935Z</atom:updated>
            <content:encoded><![CDATA[<h4>Step up your DBT game with these tips!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gIYy-dgmBbC12aCVhyQXcA.png" /></figure><p>Data Build Tool (DBT) has emerged as a go-to framework for data engineers, analysts, and data scientists alike. Its open-source nature, flexibility, and support for source control have made it a strong addition in the modern data stacks.</p><p>If you are a serial user of DBT (Data Build Tool), you probably have already heard about these DBT practices. But, there are 6 lesser known practices when using DBT that I’m going to share:</p><h4>1. Adopt “Incremental” models for faster builds</h4><p>DBT&#39;s default mode of operation is to build all the models from scratch every time you execute a dbt run command.</p><p>This can be resource-intensive and time-consuming, especially as your project grows. To optimize it, consider adopting “incremental” models. With this DBT only processes the data that has changed since the last run.</p><p>To do this you can simply do the following:</p><pre>{{  config( materialized=&#39;incremental&#39;) }}<br><br>&lt; insert your dbt sql query here&gt;</pre><p>This will significantly reduce build times and save valuable computing resources.</p><h4>2. Use macros for code reusability</h4><p>DBT macros are reusable code snippets that can simplify your ETL pipelines.</p><p>By creating macros for common tasks, you can reduce redundancy in your project and make it more maintainable. For example, hypothetically if you frequently need to count rows of a certain table for a specific date, you can create a macro that encapsulates this logic (see below).</p><pre>{% macro get_table_row_count(table_name, selected_date) %}<br><br>SELECT row_count<br>FROM {{ table_name }}<br>WHERE business_date = &#39;{{ selected_date }}&#39;<br><br>{% endmacro %}</pre><p>Macros not only improve code quality but also save you time and effort.</p><h4>3. Explore custom materializations</h4><p>DBT supports various materialization types, including tables, views, and ephemeral models.</p><p>Custom materializations allow you to define how DBT should store and query your data models. While the default materialization type may suffice for most use cases, there are situations where custom materializations can offer significant advantages (e.g. you want to update ONLY the target table without inserting new data). Below is an example of a modified “incremental” materialization template, just to give you an idea.</p><pre>{% materialization modified_incremental, adapter=&#39;bigquery&#39; %}<br><br>{%- set existing_relation = load_relation(this) %}<br>{%- set tmp_relation = make_temp_relation(this) %}<br>{%- set raw_partition_by = config.get(&#39;partition_by&#39;, none) -%}<br>{%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}<br>{%- set cluster_by = config.get(&#39;cluster_by&#39;, none) -%}<br><br>{{- run_hooks(pre_hooks) -}}<br><br>{%- call statement(&#39;main&#39;) -%}<br>  {{ template_query }}<br>{% endcall %}<br><br>{{ run_hooks(post_hooks) }}<br><br>{% set target_relation = this.incorporate(type=&#39;table&#39;) %}<br>{% do persist_docs(target_relation, model) %}<br>{{ return({&#39;relations&#39;: [target_relation]}) }}<br><br>{% endmaterialization %}</pre><p>With custom materializations, you can fine-tune DBT to meet your project&#39;s unique requirements.</p><h4>4. Leverage custom DBT tests for data quality validation</h4><p>Anyone working with Data must have experienced some sort of trivial (or critical) data issues.</p><p>DBT provides a powerful testing framework that allows you to define and run tests on your data models. This feature is sometimes overlooked but can be a game-changer for ensuring the integrity of your data.</p><p>By writing custom tests, you can check for data consistency, accuracy, and completeness beyond the conventional NULL or accepted values checks.</p><pre>## Example of not null test for partitioned table with row_condition<br><br>tests:<br>- partitioned_not_null:<br>  partitioned_column: column1<br>  row_condition: ‘status NOT IN(‘ACTIVE’)’<br><br>## More complex custom test using dbt_expectations package<br><br>tests:<br>- dbt_expectations.expect_table_row_count_to_equal_other_table:<br>  compare_model: source(“main_table”, “column1”)<br>  row_condition: business_date = ‘{{ vars(‘this_date’) }}’<br>  compare_row_condition: &gt;<br>    business_date = ‘{{ this_date }}’<br>    AND column2 IN(<br>      select DISTINCT column2<br>      from {{ secondary_table }} a<br>      LEFT JOIN<br>        {{ third_table }} b<br>      ON a.column2 = b.column2<br>      where status = ‘ACTIVE’<br>    )</pre><p>By incorporating testing into your DBT workflow, you can catch data issues early in the development process, saving you time and headaches down the line.</p><h4>5. Document your project thoroughly</h4><p>Documentation is often underestimated in the world of data analytics, but it plays a crucial role in maintaining a healthy and growing DBT project.</p><p>Comprehensive documentation helps both current and new team members to understand the project’s structure, logic, and purpose. DBT provides tools for documenting your project, including the “dbt Docs” feature, which generates interactive documentation from your code and metadata.</p><p>Take your time to write clear descriptions for your models, columns, and tests.</p><h4>6. Implement Git best practices for version control</h4><p>This may not be entirely DBT, still a good one to hear out.</p><p>DBT projects are typically managed using Git, a distributed version control system. While Git is a powerful tool, it can become unwieldy without proper organization. To maintain a clean and efficient version control system, adhere to Git best practices, e.g. create branches for each new feature or bug fix, and use meaningful commit messages, establish a branching strategy that suits your team’s needs (i.e. Gitflow).</p><p>By following these Git best practices, you’ll ensure that your DBT project remains well-structured and easy to manage.</p><h4>Conclusion</h4><p>In conclusion, DBT is a powerful tool for managing data workflows.</p><p>By embracing incremental models, using macros, exploring custom materializations, testing for data quality, documenting your project thoroughly and following Git best practices, you can elevate your DBT skills and create more robust and efficient data pipelines.</p><p>Hopefully these lesser-known best practices will help you further in your DBT journey and unlock the true potential of your data. May you find these tips insightful!</p><p><em>Want more lesser known yet insightful tips right from the brilliant minds of our Katalis? </em><a href="https://medium.com/dkatalis"><strong>Follow us!</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f94687abf89d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dkatalis/6-lesser-known-best-practices-in-dbt-data-build-tool-f94687abf89d">6 “Lesser Known” Best Practices in DBT (Data Build Tool)</a> was originally published in <a href="https://medium.com/dkatalis">DKatalis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>