<?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 Luuk Mes on Medium]]></title>
        <description><![CDATA[Stories by Luuk Mes on Medium]]></description>
        <link>https://medium.com/@luuk-mes?source=rss-5618d5be5417------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*L3__vdhZu-wZ213YfwL4Bg.jpeg</url>
            <title>Stories by Luuk Mes on Medium</title>
            <link>https://medium.com/@luuk-mes?source=rss-5618d5be5417------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 04:04:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@luuk-mes/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[4 Different Data Stacks at 4 Different Companies]]></title>
            <link>https://blog.dataengineerthings.org/4-different-data-stacks-at-4-different-companies-0e97cf2eb835?source=rss-5618d5be5417------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e97cf2eb835</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Luuk Mes]]></dc:creator>
            <pubDate>Sat, 17 Feb 2024 19:47:33 GMT</pubDate>
            <atom:updated>2024-02-17T19:47:33.357Z</atom:updated>
            <content:encoded><![CDATA[<h4>Not all companies use the modern stack or require Spark.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T8wdcJel4TB_aCM7" /><figcaption>Business requirements are a rollercoaster. Photo by <a href="https://unsplash.com/@aaronburden?utm_source=medium&amp;utm_medium=referral">Aaron Burden</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Many Data Engineers think they must work at companies that run the classic “Modern Data Stack” or a Spark-heavy data shop.</p><p>However, your role is to drive data value to the company and build a strong data foundation that fits the stakeholders’ needs, instead of copying someone else’s data stack that doesn’t fit into your data problems.</p><p>Focus on which tools will be most applicable for the situations you currently have and likely will encounter in the future.</p><p>To shed light, I’ll show you the data stacks in the past companies I’ve worked for. All these companies had different requirements from quality to budgets to non-vendor locking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R5c_VdgnQyNqU7sFV0wr_w.png" /><figcaption>BI is ready to fight against AI in a boxing ring, generated with DALL-E, created by the author</figcaption></figure><h4><strong>BI vs AI</strong></h4><p>The data stack for a BI or AI project can look very different especially if you’re dealing with unstructured data.</p><p>BI is more likely to make use of big data warehouses such as BigQuery, where AI with computer vision will require a data lake for storing the images and a database for handling its metadata.</p><p>The solution doesn’t need to be a fancy BigQuery or Snowflake. As we’ll perform many updates on specific records (which images have been processed), a Postgres database can be a good fit thanks to its efficient row-based writes.</p><h4><strong>Consultancy Company #1: BI… BI… BI…</strong></h4><p>My first job as a Data Engineer was in a consultancy firm that was working with big Dutch brands, from car dealers to amusement parks to the biggest Dutch grocery stores and even big fast food chains.</p><p>The projects I was working on were storing data in BigQuery, which had to be refined for dashboard use cases.</p><p>For clients that were new to the cloud and didn’t give us a big budget, we made sure to make use of Google Cloud functions for pulling in data from DynamoDB and their APIs and storing the data inside Bigquery.</p><p>For clients that were a couple of steps further, we made use of Google Cloud Composer and were running jobs that either pulled data from APIs or loaded in files from Google Cloud Storage Buckets and pushed them to BigQuery.</p><p>This was an amazing beginner job that had a lower complexity type of work that helped me get better at SQL &amp; Python, while still delivering great value for the companies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ObreEV68_AP24px-jDNIJQ.png" /><figcaption>A man swiping clothes on an artificial reality version of a human being. Generated using DALL-E, created by the author.</figcaption></figure><h4>Consultancy Company #2: AI + BI</h4><p>Working on different projects at the same time is a great opportunity to expand your knowledge since you’ll not be locked down into a particular skill set and get to build broad skillsets that a Data Engineer might need.</p><p>Here I was working on two projects from scratch, neither had a single line of code ready.</p><p><strong>Project #1,</strong> where I was working 8 hours a week, was for bringing their multiple systems together to get a much better view of costs per plant (this was a big farmer company) and even to track the performance of the people in the field (if they overworked too much). They measured how many batches were completed each hour to gauge an average worker’s productivity. Based on this, employees with higher performance received larger bonuses.</p><p>In this project, I was the only one working on it and the source data was very inconsistent and often requires recalculations on their end and many backfills on my end. For this project, I made use of Prefect, and with Prefect’s hybrid version, the company was able to run backfills without me by simply specifying the dates they wanted to backfill and retrigger the flow. This made the company less reliant on my 8 working hours and gave me more time to work on refining the data with SQL.</p><p><strong>Project #2,</strong> where I was working 32 hours a week, was my first AI-related project. We had a team of computer vision engineers and I was the only data engineer building the data architecture within Azure to handle TBs of images. I wasn’t happy with the Azure App Services’s performance on handling API calls so instead we made use of Virtual Machines which could handle 3 times the load for the same price. To handle the images efficiently I made use of RabbitMQ which made it possible to process the images one by one in a very efficient way. I was able to adjust the worker size per queue, making sure to maximize the images that can go through different computer vision models.</p><p>Our model required the image to have 4 different files that were generated from open-source models such as <a href="https://github.com/xuebinqin/U-2-Net">u2net</a>, <a href="https://github.com/CMU-Perceptual-Computing-Lab/openpose">openpose</a>, and <a href="https://github.com/Gaoyiminggithub/Graphonomy">graphonomy</a>.</p><p>After each image was processed, the image’s <a href="https://pypi.org/project/ImageHash/">imagehash</a> was used to update its record in the database and set the column “processed_u2net” to “True”, which we then used to select only the pairs of clothes (front model image + the images of the clothes being worn) that were fully processed. After having them processed through all the models and having someone label the images by hand, we could make sure that 99%+ of the images were correct which improved training the models drastically.</p><p>The pipeline was able to handle hundreds of thousands of images per day and made it much easier to handle new raw images and use them quickly for training purposes.</p><p>My biggest learning from this project was thinking more in a Kappa architecture, whereas I used to only use the Lambda architecture before. Streaming pipelines showed great strength in handling all processing all these images like a stream of water being filtered and cleaned at different locations, before it’s once again merged together.</p><h4>Digital Marketing Tooling</h4><p>This company wanted to create its own ETL tool, similar to Fivetran or Funnel for internal uses to reduce digital marketing-related costs. The motivation was that the cost of pulling in data from Facebook ads was rapidly rising and the insights the company wanted were not always available in 3rd-party tools. It was more efficient for the company to create an application that could be used as a SaaS for their customers.</p><p>We had a third party who created the front end, and the team I led (with 3 junior data engineers) made the API connections. We hosted FastAPI in Google Cloud Run to handle incoming requests from the front end and stored intermediate data in Google Cloud Storage. Then, data were moved to other storage such as Bigquery, Google Sheets, and Azure Blob Storage.</p><p>I chose to go for a monolith git design so that the different microservices could make use of similar ‘helper’ / ‘utils’ functions. The code’s design mirrored this approach for easier maintenance, consistently utilizing config files for API options and enforcing a data schema to ensure data integrity and type validation.</p><p>I opted for Avro as the data format, partly because GCP recommended it for loading data into BigQuery. But in hindsight, if I could go back, I would go for Parquet instead since it is much better supported in toolings such as Pandas, Polars, Duckdb, and PySpark.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nluYedBX1ZZe-GbIT_ECRg.png" /><figcaption><a href="https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-avro#advantages_of_avro">GCP documentation</a> states Avro is the preferred format for loading data into BigQuery.</figcaption></figure><p>In this job, I learned a lot of best practices such as CI/CD, how to make coding environments faster with Makefiles, and how to help junior data engineers grow. I also learned that it’s much harder to change your data stack, like moving away from Avro to Parquet because it would require many code changes and re-teaching the juniors how to work with it.</p><blockquote>Clearly looking into the pros and cons and picking the best solution became more important than ever.</blockquote><h4>Health tech AI</h4><p>At my current job, a small start-up, we use hospital data to make predictions on the possibility of patients getting infections after surgeries. The biggest challenge that we have is that we’re processing data that’s 5–10 times larger than our resources, in some cases, we need to process 160GB+ files on 16GB or less RAM.</p><p>Instead of RAM, we require a lot of storage for disk spill to be available for Duckdb, Spark, or Pandas through Modin backed by Ray. We aren’t always able to upscale the resources because the VMs are on the customer&#39;s on-prem servers.</p><p>Another challenge is that our extraction layer has to connect to different sources. In some cases, we query the database ourselves; in others, we receive files in different structures. The content of the data often differs per customer and requires specific transformations to clean up. We need to convert this data, into the expected data contract that our product expects without it costing us too much time to program. At this stage we’re required to focus more on quick iterations on data quality and less on writing the pipeline that moves the data from A to B.</p><p>For these challenges, we have created a submodule that can use any utils code to do conversions. We keep it compatible with Pandas and Spark so that we can swap between the two depending on data sizes. This submodule is reusable for data from any hospital and runs with Mage.ai for orchestration purposes.</p><p>The customer-specific code is implemented in its own repository. It is mostly Python dict config-based (so that we can include functions). Here we write in the queries, if we connect with a DB or file, if we want to make use of Pandas or Spark, and if we have any specific functions that need to run before/after the data extraction.</p><h4>Conclusion</h4><p>There is a completely different toolkit required when looking at AI vs BI. AI works great with data lakes, whereas BI works much better on data warehouses or lakehouses. Now that doesn’t mean you can’t use either solution for both. But if your main focus is AI, it’s likely not worth building it from a BI perspective.</p><p>Not every company has unlimited resources and money, like the bigger companies. Sometimes, you are required to design solutions to deal with data many times the size of your resources. This is a challenging task, especially if you’re unable to get a big Spark Cluster that distributes the data over multiple servers, meaning you need to now do it on a single system with a lot of disk spill or I/O costs.</p><p>To get started on your journey, consultancies are an amazing opportunity. You’ll be able to work for many different clients, and not all of them are using the same data stack and likely have different business requirements, providing you the opportunity to learn many diverse skills.</p><blockquote>Take the best tool for your current, and future problems.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e97cf2eb835" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/4-different-data-stacks-at-4-different-companies-0e97cf2eb835">4 Different Data Stacks at 4 Different Companies</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Should Data Engineers Use Docker?]]></title>
            <link>https://blog.dataengineerthings.org/why-should-data-engineers-use-docker-81918fd7e90f?source=rss-5618d5be5417------2</link>
            <guid isPermaLink="false">https://medium.com/p/81918fd7e90f</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Luuk Mes]]></dc:creator>
            <pubDate>Sun, 24 Sep 2023 22:28:35 GMT</pubDate>
            <atom:updated>2023-09-26T18:40:34.784Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use Docker For 10X More Robust and Replicatable Data Pipelines!</h4><p>Have you ever written a data pipeline that had a bug inside of it, but when your colleague pulled the latest git branch she didn’t get the same bug?</p><p>All she’s saying is</p><blockquote>“It works on my machine”</blockquote><p>Welcome to the aspect of different environments, something that makes your life as a Data Engineer incredibly hard without it needing to be.</p><p>Different environments can be those of your colleague and you, but also between development and production. Making sure that all the environments are identical is something that can be hard to achieve.</p><p>Docker is precisely meant for these types of problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Se5cE7ERItdUp8Wlay8nNA.jpeg" /><figcaption>Image of a Docker logo</figcaption></figure><h3>What is Docker?</h3><p>Docker is a platform for developing, shipping, and running applications in containers. These containers package up an application with everything it needs to run, including libraries and system tools ensuring consistent behavior across different environments.</p><p>Here’s how it works:</p><ul><li>Docker uses images, which are lightweight, stand-alone, executable software packages. They contain everything an app needs to run such as code, runtime, system tools, and libraries.</li><li>To create a custom image you can make use of a Dockerfile, it’s a script meant to create a Docker image. It automates the steps for creating an image, like installing the required software and code for you to run.</li><li>To run the image Docker makes use of Docker containers which are the runtime instances of an image. These run in isolation from each other but share the host system’s OS kernel.</li><li>For containers to be able to run, it makes use of the Docker Engine. A daemon process manages Docker images, containers, networks, and storage volumes.</li></ul><h3>Why should you use Docker?</h3><p>Docker’s benefits extend deep into the realm of data engineering. Let’s focus on three critical areas where Docker shines for Data Engineers: Parallelism and Scaling, Microservices, and Consistency in ETL Pipelines.</p><h4>Parallelism and Scaling</h4><p>Data engineering often involves dealing with large datasets requiring heavy computational workloads. Docker’s containerized architecture is optimized for easy scaling. With orchestration tools like Kubernetes, you can automate containerized ETL tasks&#39; deployment, scaling, and management.</p><p>This allows for parallel processing of large datasets with frameworks like Spark, drastically reducing data processing time. Whether you need to distribute workloads across a cluster or execute multiple threads on a single machine, Docker facilitates these operations seamlessly.</p><h4>Microservices</h4><p>The microservices architecture has revolutionized how software applications are designed, developed, and deployed. Data engineering is no exception to this. With Docker, you can package each microservice in your data pipeline into a separate container with its specific environment and dependencies. This enables independent development and deployment of each microservice and enhances productivity.</p><p>For example, you can have a FastAPI application as a microservice dealing with logic such as transforming images, and have another microservice deal with where to place the images and metadata into a blob storage and database. Keeping the logic separated and orchestrated through Airflow or a message queue like Kafka is a great way of connecting to the different microservices.</p><h4>Consistency in ETL Pipelines</h4><p>The infamous ‘It works on my machine’ problem is a serious concern in data engineering. Docker addresses this by packaging your ETL application, along with all its dependencies, into a single container. This container can be versioned and shared, ensuring that every environment — be it development, staging, or production — is executing the exact same code with the same dependencies. This level of consistency is invaluable for troubleshooting, collaborative work, and for the overall reliability of your data pipelines.</p><p>It’s also a great way to run your code in another location without having access to a Git repository.</p><blockquote>Warning: Docker doesn’t hide the code, it’s still accessible for people that have access to the Docker container, once they are inside of the docker container they are able to look into all the files and read the code if required. Make sure that only authenticated people have access to the location that the Docker container is running from.</blockquote><h3>How to use Docker</h3><p>To use Docker, you first need to install it on your system. The fastest way is by using the <a href="https://www.docker.com/products/docker-desktop/">Docker Desktop application</a> installs the daemon and keeps track of all your images and active containers.</p><p>If you’re using an Ubuntu VM, you might not have access to a GUI, but only access to your terminal. In that case, follow the steps to install Docker through the terminal.</p><h4>Building Your First Image</h4><p>You can do this through the terminal using bash commands.</p><p>Let’s start with running the hello-world version docker run hello-world <br>Docker shows you that it’s trying to find an image namedhello-world:latest locally but because it can’t find the image it’ll pull it from <a href="https://hub.docker.com/_/hello-world">hub.docker.com</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zihGy_AhCoI_9VJMxY1_vw.png" /><figcaption>Terminal image of docker run hello-world</figcaption></figure><p>Whenever you pull an image, make sure that the image you’re pulling has either an emblem</p><ul><li>“Docker Official Image”</li><li>“Verified Publisher”</li><li>“Sponsored OSS” (Open Source Software)</li></ul><p>or you know and <strong>trust</strong> the publisher</p><p>Never pull an image if all your answers on those options are “No” or “I don’t know”. They can have security issues inside of them.</p><blockquote>Make sure to always trust the images you’re using.</blockquote><p><em>When in doubt, look the image up on hub.docker.com before pulling it.</em></p><h4>Building Your First Custom Image</h4><p>You can also build a custom Docker image you will need to create something called a “Dockerfile”. Docker uses this file to create an image that can be run inside a container.</p><p>For this use case, I will create a Dockerfile with Python 3.10 inside of it (the FROM keyword is linked to <a href="https://hub.docker.com/">hub.docker.com</a>) and install external dependencies through pip install.</p><p>The directory tree for this project will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*gc1y4IlwufrcffjeYWmTnw.png" /><figcaption>Image of directory tree using Docker for a Python Docker Image</figcaption></figure><p>The Dockerfile can only include files available in its directory or child directories, in the case below it uses everything inside of the directory tree to install inside of the Docker image</p><pre># Dockerfile<br>FROM python:3.10-slim-buster<br><br># Create home directory<br>WORKDIR /app<br><br># Copy requirements file <br>COPY requirements.txt requirements.txt<br><br># Install requirements<br>RUN pip install --no-cache-dir -r requirements.txt<br><br># Copy code directory<br>COPY src/ /app<br><br># By default open the terminal<br>CMD [&quot;python&quot;, &quot;main.py&quot;]</pre><p>To run this file, I need to be in the same directory as the file itself and run docker build . --tag data-pipeline and run it with docker run data-pipeline . The image will immediately away run python main.py because I ended with that inside of the Dockerfile, which can be great when running images in the cloud.</p><p>You can instead run your Flask or FastAPI server through this method.</p><p>Docker commands can quickly become complex when trying to add multiple</p><h3>Docker settings inside of a file?</h3><p>Docker commands can quickly become a mess once you’re trying to use several containers in the same network.</p><p>Instead, have your docker settings inside of a file you can do this by using a docker-compose.yml. This file holds all your Docker configurations and connects your containers to the same private network, meaning they’re able to talk to each other <strong>without</strong> opening the ports externally.</p><pre>version: &#39;3&#39;<br><br>services:<br>  postgres:<br>    image: postgres:latest<br>    volumes:<br>      - ./postgres-data:/var/lib/postgresql/data<br>      - ./init.sql:/docker-entrypoint-initdb.d/init.sql<br>    environment:<br>      POSTGRES_DB: clcg<br>      POSTGRES_USER: test<br>      POSTGRES_PASSWORD: test<br><br>  sftp:<br>    image: atmoz/sftp:latest<br>    volumes:<br>      - ./sftp-data:/home<br>    command: test:test:::e<br><br>  data-pipeline:<br>    build: .<br>    depends_on: <br>      - postgres<br>      - sftp<br></pre><p>In the above docker-compose.yml I set up a database, Sftp, and Python pipeline. All of them can communicate with one another since they’re in the same file.</p><p>The pipeline pulls data from Postgres and uploads it to the Sftp. This can be a perfect form of isolated testing your pipeline since you can fully replicate a production source/destination and run it inside of an automated test flow (often called CI/CD)</p><p>It’s also a great way to have a database run locally for each project, separated through docker containers.</p><p>When you want to connect to the database, you can simply run the service name postgres as its host. Docker-compose will take care of the internal routing.</p><h4>Docker volumes</h4><p>As seen in the example above, I’m using a volume. So what’s a volume and why am I using it for Postgres and the Sftp instances?</p><p>A volume is a connection between your local disk and the docker container. By default, the Docker can’t write to your local persisted disk. But with a volume, you can make sure to keep the information.</p><p>Volumes in a Docker-compose file work as follows &lt;local_disk_path&gt;:&lt;inside_docker_container_path&gt; , these volumes can be useful for either providing extra context to your container such as a start-up file (in Postgres’s case a init.sql file that might hold your database tables) or to persist data from the docker container onto your local disk, so that the next time I start up the docker container I don’t lose my data.</p><pre>postgres:<br>    image: postgres:latest<br>    volumes:<br>      # Stores the db on the local disk inside directory /postgres-data<br>      - ./postgres-data:/var/lib/postgresql/data<br>      # Uses local disk init.sql as startup file when a clean db gets created<br>      - ./init.sql:/docker-entrypoint-initdb.d/init.sql</pre><h3>Conclusion</h3><p>Docker might feel overwhelming, but once you get the basics down you’re already on the right path and can increase your applicable skills by a lot!</p><p>Docker is everywhere around you in the workplace, it’s a must-have skill for any Data Engineer to have.</p><p>From working on-prem and keeping environments the same to deploying to the cloud, it’s everywhere.</p><p>Docker-compose even handles internal forwarding, like if you have a service named postgres like in the previous example, instead of doing host = &quot;localhost:5432&quot; you can do host = &quot;postgres&quot; instead.</p><p>So, go out there, and play around with Docker! You’ll notice how great it is to use and how easy it is to work on top of it.</p><h3>Bonus: Vscode Dev Containers</h3><p>Even vscode uses Docker under the hood of their Dev Containers.</p><p>What are these Dev Containers I hear you say?</p><p>You can configure your vscode to run a workspace inside of a dev container that holds all the settings of your workspace. This also includes the programming language that’s being used.</p><p>Thus, you can run vscode with Rust without actually installing Rust on your operator system. You’re simply using a Docker image that has Rust inside of it.</p><p>For more information regarding Dev containers, I highly recommend their <a href="https://code.visualstudio.com/docs/devcontainers/containers">documentation</a> or <a href="https://www.youtube.com/watch?v=DxTEzywnBOc">this video</a> of Mehdio about Dev containers.</p><p>If you like my content and want to read more Data Engineering and Mage blogs, you can subscribe to a Medium Premium Account with my <a href="https://medium.com/@luuk-mes/membership">referral</a> link to support my work and be able to read all articles of other Medium writers as well.</p><p>In case you have any questions, feel free to reach out in the comments, I read and answer all of them!</p><p><a href="https://medium.com/@luuk-mes/membership">Join Medium with my referral link - Luuk Mes</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81918fd7e90f" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/why-should-data-engineers-use-docker-81918fd7e90f">Why Should Data Engineers Use Docker?</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Tips for Companies Starting Their Cloud Journey]]></title>
            <link>https://blog.dataengineerthings.org/5-tips-for-companies-starting-their-cloud-journey-fecfaed68fb9?source=rss-5618d5be5417------2</link>
            <guid isPermaLink="false">https://medium.com/p/fecfaed68fb9</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Luuk Mes]]></dc:creator>
            <pubDate>Wed, 23 Aug 2023 04:15:56 GMT</pubDate>
            <atom:updated>2023-08-23T04:15:56.243Z</atom:updated>
            <content:encoded><![CDATA[<h4>Decoding cloud costs for small to mid-sized companies: Learn how to avoid insane cloud bills</h4><p>We’ve all heard horror stories about AWS cloud costs that make you triple-check if you <em>really </em>did turn off your EC2, these cloud costs can be a real nightmare for smaller companies and scare them away from the cloud, even before they have started their journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*6ylCIkKApVA3bfjxzCRVjw.png" /><figcaption>Broke from the costs of an AWS EC2 VM (<a href="https://twitter.com/sociosploit/status/1513990326012325898">meme source</a>)</figcaption></figure><p>I’ve helped over 50 companies run their data infrastructure for less than 300 dollars a month on GCP. Some even pay as low as 75 dollars a month for receiving insights into their ~5TB of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QONWQmf0WbP2iqMSbU3pGQ.jpeg" /><figcaption>Backpacker starts his new journey, representing the small business starting their cloud journey (Made by the Author with Leonardo.ai)</figcaption></figure><h4>Start Small</h4><p>Not only big companies rely on their data for making decisions. Most companies want to say that they’re “data-driven” even though, it’s a reality that very few companies truly are.</p><p>Nonetheless, it’s very important for smaller-sized businesses to understand their data if they want to understand how they should scale their business.</p><p>Since on-premise resources are hard to manage and costly in man-hours having an IT department taking care of the on-premise resources, it is often much cheaper for them to leverage the cloud.</p><p>Start by bringing over data currently being pulled through a paid service or the most crucial to the business. This way, you instantly provide value from the first data being moved over.</p><p>Either it reduces the current costs or brings insights into the business.</p><p>This is a great way to make the organization get trust in the cloud provider and its possible costs.</p><h4>Don’t Overengineer</h4><p>Engineers love to create something complex, but do yourself a favor and don’t overengineer straight from the start.</p><p>If your company is unsure about the value that the data department brings and the possible costs that are lurking around in the cloud.</p><p>Make sure to keep the architecture simple, cheap, and efficient.</p><p>This means, don’t run an expensive Google Cloud Composer (managed Airflow) + a managed Kubernetes cluster purely because it’s “scalable”. It’ll only bring extra costs with it, without you being sure that it’ll be a long-lasting architecture.</p><p>Avoid “Gold plating” by only developing what’s truly needed for the business. At this stage, it’s all about the MVP and gaining trust, not about how perfect the systems that you’ve set up are. They can, and often do change over time. You’ll have time for them once the business is growing and more complicated questions come into place.</p><h4>Make Use of the Free Tier</h4><p>To keep the costs low, use the free tiers that cloud providers provide, such as in GCP’s case: Google Cloud Functions + Scheduler, or event triggers from Google Cloud Storage. Need something more customizable / rely on docker? Switch out Google Cloud Functions for Google Cloud Run! Both are in the free tier and can easily handle daily loads with marginal costs.</p><p>As a data warehouse, BigQuery is my favorite one and it also comes with a great free tier of 1 TB querying each month. Enough to keep your analytical dashboard costs to a minimum while providing great insights for the business.</p><p>BigQuery can connect to many of the popular dashboarding tools out there, Looker Studio (the newly revamped Data Studio) has great integration with BigQuery but if your company prefers to use PowerBI, then that’s not a problem at all!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*goukuZBz10ok5Z5S5WWibw.jpeg" /><figcaption>Showing a trash yard, be careful with collecting data before it becomes the same (Made by the Author using Leonardo.ai)</figcaption></figure><h4><strong>Data Collection</strong></h4><blockquote>“Data is like garbage. You’d better know what you are going to do with it before you collect it.” ~ Mark Twain</blockquote><p>It’s very important to understand which data you’re storing in your data warehouse. Data that’s just sitting there to gather dust is costing you $$$.</p><p>At one of the companies where I was building the BigQuery environment, I started looking at tables imported from Google Ads and some of the tables were costing a good 300 dollars a month purely based on storage costs.</p><p>When doing a deep dive into which tables were the most expensive and what they were used for, I learned that some of them could be completely removed and saved over 50% of the billing! The data inside of them was not able to join to other tables and the table by itself had no value to the business, just costing them money!!!</p><p>Be very conscious about which data you want to import. Only store data that’s actually meaningful to your business either in the short or long term.</p><p>But don’t store data for the “maybe” times, you can often pull the data when the requirements are more clear in the future.</p><p>The only times when you want to store data earlier than it is being used is when it’s about (streaming) events data. Those need to be set up ahead of time to gather enough data to become insightful.</p><p>But this data then has a clear goal and meaning, resulting in its usefulness.</p><h4>Data Lifecycle</h4><p>You pay for any data stored inside of a blob storage (AWS S3, Google Storage, Azure Blob Storage) or inside of a Data Warehouse.</p><p>It’s important to keep “useless” data at a minimum, any data that’s too old<strong> </strong>and<strong> </strong>easily obtainable through an API should be removed or at the bare minimum be archived to reduce its costs.</p><p>You can do this through something that’s called a Data Lifecycle that automatically cleans up data that&#39;s older than X days/months/years.</p><p>Depending on the type of data this often ranges from anything between a month and a couple of years. But make sure to set these settings to reduce the amount of costs!</p><h4>Conclusion</h4><p>If you’re a small company and interested in getting a clearer picture through your own data. Don’t be afraid of the cloud costs, use the tips I’ve provided to keep them at a bare minimum while still providing great insights for you.</p><p>Once you feel more comfortable and have used the insights gained from the data in a positive way, you can always improve data architecture.</p><p>In short.</p><p>Start small, think of something you want to understand clearer in the short term. Make sure to not overengineer your data architecture when you’re starting and getting the data into the cloud through the free tiers available.</p><p>This makes sure that the journey starts very cost-efficiently.</p><p>Have clear requirements so that you only store data that will truly drive business value so that all the data that exists in your data warehouse is bringing you more value than it costs.</p><p>If you already know ahead of time that some data will be irrelevant to you after X months, make sure to set up data lifecycles to reduce the costs. It’s very easy to forget about your data and see it pile up like a huge trash yard.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fecfaed68fb9" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/5-tips-for-companies-starting-their-cloud-journey-fecfaed68fb9">5 Tips for Companies Starting Their Cloud Journey</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero-Cost Cloud Solutions for Your Personal Projects]]></title>
            <link>https://blog.dataengineerthings.org/zero-cost-cloud-solutions-for-your-personal-projects-127f5b53b6b0?source=rss-5618d5be5417------2</link>
            <guid isPermaLink="false">https://medium.com/p/127f5b53b6b0</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Luuk Mes]]></dc:creator>
            <pubDate>Sat, 05 Aug 2023 06:18:09 GMT</pubDate>
            <atom:updated>2024-04-16T08:02:33.105Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Step-By-Step Guide to Setting Up, Automating, and Running Your Own Projects in the Cloud Without a Price Tag</h4><p>Running your personal projects for free in the cloud, who doesn’t want that?! Most programmers enjoy working on some side projects to learn new tech, or simply for fun.</p><p>I personally made several ETL pipelines to retrieve game stats from League of Legends. Often running it on a regular interval is the challenging part if you want it to run entirely for free.</p><p>In this blog, I’ll walk you through how I made my pipeline run within GitHub Actions and stores its data in Google BigQuery.</p><p>Google has a pretty good free tier, but running your docker containers in Google Cloud Run comes with a small cost because the Artifact Registry isn’t included in the free tier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hWoI7R9NIVfLijlo" /><figcaption>Photo by <a href="https://unsplash.com/@andrewtneel?utm_source=medium&amp;utm_medium=referral">Andrew Neel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Setting up GCP</h3><p>To make sure that you can follow the whole tutorial and can send data from GitHub Actions to BigQuery, we first need a GCP account.</p><h4>Creating an Account</h4><p>First, you’ll need a GCP account. After you’re logged in to GCP, you’ll see the dashboard below. I like to use the search bar to get anywhere in GCP but feel free to use the left menu bar as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rOhJW3Ii-sm_P6IPNbDXJw.png" /><figcaption>GCP Dashboard overview of clcg-dataengineering</figcaption></figure><h4>Configure BigQuery</h4><p>The next steps are:</p><ol><li>Activate the <a href="https://console.cloud.google.com/marketplace/product/google/bigquery.googleapis.com">BigQuery API</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GPTyDFRAaby_d6QmeVZYrw.png" /><figcaption>BigQuery API</figcaption></figure><p>2. Create a Dataset inside of BigQuery</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*aNSsRqNtrwQFoWyC3ZlBpg.png" /><figcaption>Follow the steps to create a dataset inside of BigQuery</figcaption></figure><p>Pick a “Region” instead of Multi-region to keep costs lower, since I’m located in the EU, I’ll be choosing “europe-west1”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zc_z1rEgevx6HWYOrRFvJQ.png" /><figcaption>Dataset settings</figcaption></figure><h4>Configure a Service Account</h4><p>For your application to interact with BigQuery outside of GCP, the easiest way to retrieve controlled access is through a service account, you can create a key that you then can put into GitHub as a secret.</p><p>You can find <a href="https://console.cloud.google.com/iam-admin/serviceaccounts">Service Accounts</a> under the IAM and Admin panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4H7TAAvfCKKQ4ZE33X1D0Q.png" /><figcaption>GCP Service accounts UI</figcaption></figure><p>Fill in your name, I’m going with “github-actions” since that’s what I’ll be using it for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ev4DnpPJLWyhp1BsmGzPlw.png" /><figcaption>Service account details GCP</figcaption></figure><p>After creating your service account, make sure to click on it to get to the Service Account interface where you can create a new key. Make sure you create it as JSON and download it locally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v6TIhLkg9dSqrtEhFDZrWg.png" /><figcaption>Creating a service account key GCP</figcaption></figure><p>It’ll look like this:</p><pre>{<br>  &quot;type&quot;: &quot;service_account&quot;,<br>  &quot;project_id&quot;: &quot;clcg-dataengineering&quot;,<br>  &quot;private_key_id&quot;: &quot;ce920911fbXXXXX9433b27ad848a558&quot;,<br>  &quot;private_key&quot;: &quot;-----BEGIN PRIVATE KEY-----\nMIIEvAXXXXX==\n-----END PRIVATE KEY-----\n&quot;,<br>  &quot;client_email&quot;: &quot;github-actions@clcg-dataengineering.iam.gserviceaccount.com&quot;,<br>  &quot;client_id&quot;: &quot;11290483XXXX470686&quot;,<br>  &quot;auth_uri&quot;: &quot;https://accounts.google.com/o/oauth2/auth&quot;,<br>  &quot;token_uri&quot;: &quot;https://oauth2.googleapis.com/token&quot;,<br>  &quot;auth_provider_x509_cert_url&quot;: &quot;https://www.googleapis.com/oauth2/v1/certs&quot;,<br>  &quot;client_x509_cert_url&quot;: &quot;https://www.googleapis.com/robot/v1/metadata/x509/github-actions%40clcg-dataengineering.iam.gserviceaccount.com&quot;,<br>  &quot;universe_domain&quot;: &quot;googleapis.com&quot;<br>}</pre><p>This key is very important since it grants you access to GCP.</p><p>Now, just having the key isn’t enough, you should also give it proper access roles. Go back to your IAM and Admin panel and follow the steps in the screenshot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oD51uSWZCgidEUhvBD0H6A.png" /><figcaption>Give your service account the bare minimum roles to access Data sets and insert data</figcaption></figure><h3>Data Pipeline</h3><p>I’ll be using Mage for the actual code base, but you can also run a single Python file instead of Mage.</p><h4>Data Loader</h4><p>For this project, I’ll be pulling data from a Dutch open data bank, the API I’m using relates to the quickness of emergency responders responding to an emergency.</p><pre>import requests<br>import pandas as pd<br><br>BASE_URL = &quot;https://dataderden.cbs.nl/ODataApi/odata/47008NED&quot;<br><br>@data_loader<br>def load_data(*args, **kwargs) -&gt; pd.DataFrame:<br>    &quot;&quot;&quot;<br>    Template code for loading data from any source.<br><br>    Returns:<br>        Anything (e.g. data frame, dictionary, array, int, str, etc.)<br>    &quot;&quot;&quot;<br>    endpoint_name = kwargs[&quot;endpoint_name&quot;]<br>    url = f&quot;{BASE_URL}/{endpoint_name}&quot;<br>    if endpoint_name == &quot;TypedDataSet&quot;:<br>        url = f&quot;{url}?$filter=Totaal_2 gt 0$&amp;orderBy=Perioden desc&amp;$top=9999&quot;<br><br>    response = requests.get(url).json()<br>    df = pd.DataFrame(response.get(&quot;value&quot;))<br><br>    return dfData Transformation</pre><p>This dataset is pretty clean, but not all the column names are allowed since some have a . (dot) inside of them which is not allowed in BigQuery.</p><p>In the parse_columns function, I rename all the columns from PascalCase to snake_case and replace the dots with underscores. Making the columns compliant with BigQuery’s column name requirements.</p><pre>import re<br>import pandas as pd<br><br>def parse_columns(df: pd.DataFrame) -&gt; pd.DataFrame:<br>    def convert(name: str) -&gt; str:<br>        s1 = re.sub(&#39;(.)([A-Z][a-z]+)&#39;, r&#39;\1_\2&#39;, name)<br>        return re.sub(&#39;([a-z0-9])([A-Z])&#39;, r&#39;\1_\2&#39;, s1).replace(&#39;.&#39;, &#39;_&#39;).lower()<br>    <br>    return df.rename(columns=convert)<br><br><br>@transformer<br>def transform(df: pd.DataFrame, *args, **kwargs) -&gt; pd.DataFrame:<br>    &quot;&quot;&quot;Retrieves the df and modifies the column names&quot;&quot;&quot;<br>    df = parse_columns(df)<br>    return df</pre><p>Mage has its own templates to export to many different locations. In the below example, I’m using their BigQuery exporting template, all I have to do is simply provide my service account key location inside the io_config.yaml and change the table_id to my project, dataset, and table.</p><pre>from mage_ai.settings.repo import get_repo_path<br>from mage_ai.io.bigquery import BigQuery<br>from mage_ai.io.config import ConfigFileLoader<br>from os import path<br>from pandas import DataFrame<br><br><br>@data_exporter<br>def export_data_to_big_query(df: DataFrame, *args, **kwargs) -&gt; None:<br>    &quot;&quot;&quot;<br>    Template for exporting data to a BigQuery warehouse.<br>    Specify your configuration settings in &#39;io_config.yaml&#39;.<br><br>    Docs: https://docs.mage.ai/design/data-loading#bigquery<br>    &quot;&quot;&quot;<br>    table_name = kwargs[&quot;table_name&quot;]<br>    print(table_name)<br>    <br>    table_id = f&quot;clcg-dataengineering.emergencies.{table_name}&quot;<br>    config_path = path.join(get_repo_path(), &quot;io_config.yaml&quot;)<br>    <br>    config_profile = &quot;default&quot;<br>    BigQuery.with_config(ConfigFileLoader(config_path, config_profile)).export(<br>        df,<br>        table_id,<br>        if_exists=&quot;replace&quot;,  # Specify resolution policy if table name already exists<br>    )<br></pre><p>The minimal pipeline looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*JOpMtpwGRpeII-Utuw9VFA.png" /><figcaption>Mage DAG Tree</figcaption></figure><h3>GitHub Actions Workflow</h3><p>To get your pipeline running in GitHub actions you’ll need a couple of things.</p><p>First, you need to add the earlier created Service Account as a secret to the pipeline</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iSscqKNqhCrzGnWJakCGWA.png" /><figcaption>Creating a secret and placing your service account</figcaption></figure><p>Give it a name you like and copy your secret inside of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pQifsWkc0kKkb81Uu_Q1ag.png" /><figcaption>Service account secret added to GitHub Actions</figcaption></figure><h4>Running the pipeline in GitHub</h4><p>Now that we prepared everything!</p><ul><li>Setting up GCP</li><li>Getting our BigQuery ready</li><li>Having a Service Account</li><li>Having a working data pipeline</li><li>Added your secret inside of GitHub Actions</li></ul><p>It’s time for the last two steps.</p><ol><li>Making a Workflow that runs your pipeline at a certain interval, I’ll have mine running every day at 4 AM</li><li>Running the pipeline manually (once) to test that it works</li></ol><p>The workflow shows a way to use Mage and the way it would run without Mage. Since I’m running the same pipeline multiple times with different arguments I’m using a run_mage.py to trigger the pipelines. This is because the CLI mage run functionality doesn’t allow for dynamic blocks.</p><pre>name: Triggers Data pipeline<br><br>on:<br>  schedule:<br>    - cron: &#39;0 4 * * *&#39; # 4am every day<br><br>jobs:<br>  run-data-pipeline:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - name: Checkout repository<br>        uses: actions/checkout@v2<br><br>      # Make our GCP Service Account secrets available for this run<br>      - name: Convert secrets to a file<br>        run: echo &quot;$GCP_SERVICE_ACCOUNT&quot; &gt; clcg-dataengineering/bigquery-key.json<br>        shell: bash<br>        env:<br>          GCP_SERVICE_ACCOUNT: ${{secrets.GCP_SERVICE_ACCOUNT}}<br><br>      # Using Mage<br>      - name: Pull Mage Docker image<br>        run: docker pull mageai/mageai:0.9.9<br><br>      - name: Execute Mage Pipeline<br>        run: docker run -v $(pwd)/clcg-dataengineering:/home/src mageai/mageai:0.9.9 python run_mage.py<br><br>      # Using a main.py<br>      # - name: Pip install dependencies<br>      #   run: pip install -r requirements.txt --upgrade pip<br>      <br>      # - name: Run python file<br>      #   run: python main.py</pre><p>Here is the content of the run_mage.py file</p><pre>import mage_ai<br><br>def main():<br>    endpoints = [<br>        {&quot;name&quot;: &quot;TableInfos&quot;, &quot;table_name&quot;: &quot;info&quot;},<br>        {&quot;name&quot;: &quot;TypedDataSet&quot;, &quot;table_name&quot;: &quot;emergencies&quot;},<br>        {&quot;name&quot;: &quot;DataProperties&quot;, &quot;table_name&quot;: &quot;properties&quot;},<br>        {&quot;name&quot;: &quot;RegioS&quot;, &quot;table_name&quot;: &quot;regions&quot;},<br>        {&quot;name&quot;: &quot;Perioden&quot;, &quot;table_name&quot;: &quot;periods&quot;},<br>    ]<br>    <br>    for endpoint in endpoints:<br>        print(f&quot;start: {endpoint[&#39;name&#39;]}&quot;)<br>        mage_ai.run(project_path=&quot;/home/src&quot;, pipeline_uuid=&quot;github_actions&quot;, endpoint_name=endpoint[&quot;name&quot;], table_name=endpoint[&quot;table_name&quot;])<br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><h4>GitHub Actions pipeline run</h4><p>As shown below, we see that all the flows have run successfully inside the CICD job</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7wjJTF-SlUEhaG1HuSRHKw.png" /></figure><h3>Results in BigQuery</h3><p>After the pipeline has run, you can see that all the tables have been created and they have the expected data inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Et7OcIem7ZE9RlsBzKYXaw.png" /><figcaption>Dutch Emergency Responder data BigQuery GCP</figcaption></figure><p>BigQuery has a free tier of 10GB storage and 1TB querying. When you almost reached 10GB, you can simply create a new project and send the newly scraped data there instead, this way you can easily query both projects while keeping the storage entirely free tier!</p><h3>Conclusion</h3><p>You’ve now got the know-how to get GCP and BigQuery up and running, all ready to handle data securely. You can start using the GitHub Actions scheduler straight away to keep your pipelines flowing, no need for manual nudges. With all this, you can kick-start your own projects in the cloud without spending a penny!</p><p>If you’re wondering about Mage, you can find out more right here:</p><ul><li><a href="https://blog.det.life/mage-the-modern-orchestration-tooling-to-replace-airflow-part-1-eb7ef5df9105">Mage, the Modern Orchestration Tooling to Replace Airflow — Part 1</a></li><li><a href="https://blog.det.life/mage-the-modern-orchestration-tooling-to-replace-airflow-part-2-35bacbb3f794">Mage, the Modern Orchestration Tooling to Replace Airflow — Part 2</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=127f5b53b6b0" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/zero-cost-cloud-solutions-for-your-personal-projects-127f5b53b6b0">Zero-Cost Cloud Solutions for Your Personal Projects</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mage, Apache Airflow's Replacement  — Part 2]]></title>
            <link>https://blog.dataengineerthings.org/mage-the-modern-orchestration-tooling-to-replace-airflow-part-2-35bacbb3f794?source=rss-5618d5be5417------2</link>
            <guid isPermaLink="false">https://medium.com/p/35bacbb3f794</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Luuk Mes]]></dc:creator>
            <pubDate>Tue, 01 Aug 2023 15:02:43 GMT</pubDate>
            <atom:updated>2023-08-22T08:11:42.168Z</atom:updated>
            <content:encoded><![CDATA[<h3>Mage, Apache Airflow’s Replacement — Part 2</h3><h4>Boosting Data Transformations: A Deep Dive into Mage’s Block Add-ons</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GrXjc8XRf1YmJ-LWKXFIrA.jpeg" /><figcaption>A young mage being powered up and ready to fight. Made by the author with leonardo.ai</figcaption></figure><p>In <a href="https://medium.com/data-engineer-things/mage-the-modern-orchestration-tooling-to-replace-airflow-part-1-eb7ef5df9105">Part 1</a> you’ve learned what Mage is, how to build a data pipeline using Mage, and what different types of blocks there are.</p><p>In Part 2, you’ll learn more about how to boost your pipeline quality through the add-ons that you can apply on all blocks.</p><p><a href="https://blog.det.life/mage-the-modern-orchestration-tooling-to-replace-airflow-part-1-eb7ef5df9105">Mage, the Modern Orchestration Tooling to Replace Airflow — Part 1</a></p><h3>Add-ons</h3><p>As you remember from Part 1, pipelines are made of independent blocks that can run SQL, Python, or R.</p><p>Most of these blocks can be customized with extra features called add-ons. These add-ons can be added in the UI or using the metadata.yaml file. Each add-on has a different purpose, waiting for you to be used.</p><h4>Dynamic</h4><p>Dynamic blocks create multiple downstream blocks at runtime.</p><p>The number of blocks created equals the output data items times the number of downstream blocks. 3 downstream blocks with a list of 3 items generate 9 blocks.</p><p>The dynamic block expects a list[list[dict]] as input and for each element in the list, it’ll run the downstream dependencies for that item.</p><p>In the example below, I generate a list of userids and names inside of a dictionary and each of the dictionaries will spawn their own transformation block. The transformation block will modify the id and group all the outputs and stops the pipeline from spawning more dynamic blocks, this happens through the reduce_output setting before sending it to the exporter where it is grouped and stored in a json file.</p><pre># users<br>[<br>  {&#39;id&#39;: 1, &#39;name&#39;: &#39;user_1&#39;},<br>  {&#39;id&#39;: 2, &#39;name&#39;: &#39;user_2&#39;}, <br>  {&#39;id&#39;: 3, &#39;name&#39;: &#39;user_3&#39;}<br>]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V9Sf0uIDNJiMIkvcN_bONQ.png" /><figcaption>Mage dynamic blocks</figcaption></figure><p>Output from the exporter;</p><pre>[<br>   {&quot;id&quot;: 100, &quot;name&quot;: &quot;user_1&quot;},<br>   {&quot;id&quot;: 200, &quot;name&quot;: &quot;user_2&quot;}, <br>   {&quot;id&quot;: 300, &quot;name&quot;: &quot;user_3&quot;}<br>]</pre><p>You could also opt to not combine the dynamic block results and instead, send them to a dynamic exporter block that exports the messages to a Kafka stream.</p><p>Mage currently doesn’t support a concurrency limit on dynamic blocks, meaning it’ll spawn as many blocks as there are items all at the same time. Possibly exceeding your memory capacities.</p><p>But they have this feature on their <a href="https://airtable.com/shrJctaGt4tvU27uF/tbl5bIlFkk2KhCpL4">roadmap</a> for August 2023, which means, that it’ll be super suitable for batch-to-streaming pipelines!</p><p>Until then, it’s also suitable for config-related pipelines where you have multiple table names inside of your config, run the data loader dynamically, and make them come together in a transformation block.</p><p><strong>Conditional</strong></p><p>This block triggers a flag to gracefully stop your pipeline from running.</p><p>You might have a pipeline running that fetches data from the database every 5 minutes. But at night there might be much less traffic and no new data is available. Normally Mage would try to run all the downstream blocks on your empty data, but with the conditional block, you can stop all the downstream blocks from running.</p><p>The following block returns False if the data is empty</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-zAe0uQHzvuT-UUOv83WBg.png" /><figcaption>Mage conditional block</figcaption></figure><p>As you can see in the logs, if transform_data receive no data at all, it’ll stop the pipeline from running and all downstream blocks will be set as CONDITION_FAILED.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kok9GRxFqCsQU-CLC21HSw.png" /><figcaption>Mage stop pipeline from continuing</figcaption></figure><h4><strong>Validator</strong></h4><p>Are you a fan of data quality, without the pain of writing everything yourself? Validator blocks are using Great Expectation to validate your data. You can use their extensive methods to define min/max values, check for nulls in the column, all values in a specific column have to be unique, and many more.</p><p>This gives great control over which data you want to enter the production environment making sure that it’s of great quality for the downstream models/dashboards</p><p>An example, below you want to validate that you have only the distinct values male and woman but the data has male and female instead, this causes the pipeline to crash since you validate that you expect woman instead of female</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AY-ljcP77owwv-x0lDsUZg.png" /><figcaption>Mage Power up great expectations</figcaption></figure><p>Great Expectations even gives you insights into the found values and their counts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DGWv40phn1uLCxG46VyOiQ.png" /><figcaption>Mage Great Expectations failing (on purpose)</figcaption></figure><p>This is a great way to implement complex data validation logic. Because validator blocks are add-ons, they can be easily attached to multiple data pipeline blocks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aLzf5SKMNzXkFibscgGc4g.png" /><figcaption>Mage validator multiple blocks</figcaption></figure><blockquote>“Quality in a data pipeline isn’t a feature, it’s a necessity. The value of data lies in its trustworthiness.”</blockquote><h4><strong>Replica</strong></h4><p>The replica add-on is a very simple block. It simply makes a copy of an existing block and runs it again in the pipeline, this means that you can’t make any code changes to this block, since it’s directly influenced by the original block it’s replicated from.</p><p>In the below flow, I first pull in user data, make sure they’re deduplicated, extend the information with newly acquired data, and make sure that it’s still unique by duplicating again. The second deduplication block is identical to the first one, through the use of the replica block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*X3Dtf6NPr1USGUTbgdj0-Q.png" /><figcaption>Mage replica blocks</figcaption></figure><p>There is a trick that, you can pass along different global variables to the replica block than the parent, by changing the given configuration in the metadata.yaml file inside of the pipeline directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*QIpgS52hqkVQcQXaDjiXmA.png" /><figcaption>Changing configuration inside the metadata.yaml</figcaption></figure><p>As you can see, I made the two blocks have different configurations while keeping the keys the same.</p><p>Now, when I run the following code in the parent block you’ll see that the logs show the correct values. This can be useful to load in different tables while keeping the code the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*CGcPYuQbs50EnRL9zdqEcQ.png" /><figcaption>Access the configuration inside the block through the kwargs</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PPqnywmQ4fJxOHPlB81K2A.png" /><figcaption>Mage Logs</figcaption></figure><h4>Callbacks</h4><p>What do you do when your function fails or succeeds? Do you like it crash, or do you have a backup plan? Callbacks are there, for your backup plans. You can decide to trigger another function in case the block crashes.</p><p>This can be useful for sending notification messages to your Teams, Slack, Discord, or Telegram channels.</p><p>But it can also be used to clean up data that’s not meant to be kept.</p><p>Let’s say you have a data exporter that exports data locally, you might not want to keep files that are corrupted due to crashes in the exporter.</p><p>In the file below, you want to write 40 rows in the CSV file, but it crashed (on purpose) after writing 31 rows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uJgH3jKioYtlUbmwMnPJxA.png" /><figcaption>Mage exporter crash</figcaption></figure><p>I want to make sure that when the export_data reruns again, the appending will not accidentally continue at line 31.</p><p>Now, by adding the callback block in the failure section, the test.csv file will get removed in case of a failure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UxIxC7icYg9gSBRZ9UqmUw.png" /><figcaption>Mage callback</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sQ_tZ0ALP3CBwdT1BHBUPg.png" /><figcaption>Rerun pipeline with callback</figcaption></figure><h3>Conclusion</h3><p>Learned a lot about the possible add-ons? Here’s a recap of them!</p><ul><li><strong>Dynamic</strong>: Great for parallel processing especially in Kubernetes and for streaming records to Kafka or Rabbitmq</li><li><strong>Conditional</strong>: Make sure to stop your pipeline from continuing when finding edge cases like empty data</li><li><strong>Validator</strong>: Trying to improve your data quality? You’re at the right address, there are a lot of validators to choose from in Great Expectations and Mage makes it easier to use inside of your pipelines, the perfect combination!</li><li><strong>Replica</strong>: To make sure that you’ll not need to change too many blocks that doing the same thing, replica helps you out by generating a new block uuid based on a parent block.</li><li><strong>Callbacks</strong>: They are limited in use cases, partly because Mage can handle notifications on a higher level than callbacks. But they can be extremely efficient in getting rid of corrupted files, making sure your disk space doesn’t overspill!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35bacbb3f794" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/mage-the-modern-orchestration-tooling-to-replace-airflow-part-2-35bacbb3f794">Mage, Apache Airflow&#39;s Replacement  — Part 2</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mage, Apache Airflow's Replacement  — Part 1]]></title>
            <link>https://blog.dataengineerthings.org/mage-the-modern-orchestration-tooling-to-replace-airflow-part-1-eb7ef5df9105?source=rss-5618d5be5417------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb7ef5df9105</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Luuk Mes]]></dc:creator>
            <pubDate>Wed, 26 Jul 2023 17:04:15 GMT</pubDate>
            <atom:updated>2023-08-22T08:10:40.837Z</atom:updated>
            <content:encoded><![CDATA[<h3>Mage, Apache Airflow’s Replacement — Part 1</h3><h4>A New Era in Data Orchestration: Unpacking the Potential of Mage</h4><p>I’m a huge fan of Mage, it’s great for small as well as big teams, and easy to set up. In this blog, I’ll go together with you, through Mage (Version 0.9.5), and its differences from other orchestration tools as well as how you can get started yourself!</p><ul><li>What is Mage?</li><li>How is it different from other orchestration tools?</li><li>What are the different available blocks?</li><li>Getting started with Mage!</li><li>Why do I personally like to use Mage?</li><li>Current Downsides to Mage</li></ul><blockquote>In this Part 1 we’re focusing on the basics, in part 2 we’ll do a deep-dive into more complex block addons and their possible use cases.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Yw5QZQ6UsWO9dpss" /><figcaption>Image from <a href="https://docs.mage.ai/introduction/overview">Mage</a></figcaption></figure><h3>What is Mage?</h3><p>Mage is an open-source Orchestration Tool designed for Extract, Transform, and Load (ETL) data pipelines, it does this through different blocks, which can have multiple upstream or downstream dependencies.</p><p>Each block has its isolated code, meant to be easily re-used in different pipelines. These blocks can be used in different programming languages such as Python, R, and SQL, which gives you complete control of using the best language for the correct job.</p><p>Mage has a lot of cool features, such as being able to use different colors for the DAG tree, which gives you a quick understanding of what occurs there, so you can see where a load or export happens, as well as transformations and custom blocks.</p><h3>How is it different from other Orchestration tools?</h3><p>Open-source orchestration tools are abundant in the market, with the most common ones being <strong>Airflow</strong>, <strong>Prefect</strong>, and <strong>Dagster</strong>. These all have their unique vision of orchestration tools, and all of them are production-level applications. But often they take quite some knowledge or resources to put into production requiring a bit more mature team or a longer proof of concept to test out.</p><p>All of them also require multiple docker containers to run the complete suite of the orchestration tool, this makes it much more complicated to run on a <strong>single</strong> serverless docker instance like Google Cloud Run or Azure’s equivalent Azure Container Instances.</p><p>Mage’s focus is on simplicity, it runs on a <strong>single</strong> docker container making it extremely easy to deploy.</p><p>One of Mage’s main differences with the other orchestration tools is that it has a note-book style web UI, that you can develop your code in as well as connect up-/downstream dependencies. This makes the data pipeline journey extremely visual, something that is normally just a piece of code now has visual aspects to it. For example:</p><ul><li>DAG Tree</li><li>Table previews whenever your code runs</li><li>Charts that you can run to quickly understand the data you’re dealing with and what their distribution is.</li><li>Tests inside of your blocks to assess in-memory data quality</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vD9eK9PzzncUrUe8A7Y2cQ.png" /><figcaption>Mage tests inside blocks <em>(there is a NaN value that blocks the test from passing)</em></figcaption></figure><p>The note-book style web UI helps a ton when developing your data pipelines, this is because you don’t need to re-run your whole code with every single change you make. It caches the results from each block, so you don’t have to re-run upstream dependencies to debug a downstream one.</p><p>This is a drastic win in case you’re dealing with limited API requests, not having to think about going over the limits while debugging your pipeline.</p><h3>What are the different available blocks?</h3><p>Mage comes with a variety of different blocks, each meant with a specific purpose in mind.</p><h4>Data Loader</h4><p>Use Mage templates to connect to many different sources, Postgres, Bigquery, Redshift, S3, and many others. You can also write your own custom data loader, connecting to an API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R4BYcXPns9-WoPl2nO6THw.png" /><figcaption>Mage data loader example</figcaption></figure><h4>Data Transformer</h4><p>Just like Data Loaders, Transformers also come with a lot of templated options, such as deduplication, adding missing values, dropping columns, and many others.</p><p>You can also write your own transformations and run these instead, or even combine the output of multiple data loaders into one big data frame.</p><p>It’s the plumbing of the pipeline, cleaning and curating the data before it enters your exporter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Txk9Tm07FET4NCZE9TIW2A.png" /><figcaption>Mage data transformation example</figcaption></figure><h4>Data Exporter</h4><p>Data can be exported to a variety of locations, think of a database, data lake, data warehouse, or simply, locally.</p><p>The data exporter helps with all of those, you either use the templated options or create one yourself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ffyzEvvSJNPhX_Vo6Ig-fQ.png" /><figcaption>Mage data exporter example</figcaption></figure><h4>Custom</h4><p>Custom blocks can be used for anything you want, like sending specific information that has nothing to do with the upstream dependencies, to a downstream dependency.</p><p>For example, you might have a config-based dictionary (like a parsed json, yaml, or toml file), that you want to use in multiple downstream blocks. Instead of importing and calling the function in all the blocks, you can also have a custom block at the top of your pipeline with the config data that you might not want to import but rather run through the pipeline itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRMlsrs2uIOCG4h0bFUYMg.png" /><figcaption>Mage global variables</figcaption></figure><p>It can also be great for logging purposes since you can give Custom blocks a lot of different colors, I like to group certain purposes to a specific color. Currently, I’m using several custom blocks that inspect the data and log % of missing values with a pink color, to make it clear in the graph that these don’t have a downstream dependency and are meant as helpers/loggers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t8G-bpAa7YAnv0V1UIalUQ.png" /><figcaption>Mage custom block example</figcaption></figure><h4>Sensor</h4><p>A sensor is a block that continuously evaluates a condition until it’s met or until a period of time has elapsed.</p><p>If there is a block with a sensor as an upstream dependency, that block won’t start running until the sensor has evaluated its condition successfully.</p><p>This can be very helpful if you need to wait for extra external dependencies, like a dependency on a different pipeline or block that’s not directly upstream from your downstream block. Amazing for handling late-arriving data/files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPWmFd1oFfhoEQhjB7h1gQ.png" /><figcaption>Mage sensor block example</figcaption></figure><h4>Markdown</h4><p>Yes, of course, you can document your code, but it’s much less clear than proper markdown blocks. These blocks make your pipeline extremely clear and straight-to-the-point</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQkqfMJ5_7q6bimWQZGmMw.png" /><figcaption>Mage markdown block example</figcaption></figure><h3>Getting started!</h3><p>You can run Mage in many different ways, conda , pip or docker for this blog, I’ll be using the docker image and use a docker-compose.yaml to not have to use an extensive docker command.</p><blockquote>If you prefer to use a docker command, use the following instead:<em><br></em>docker run -d --name app -p 6789:6789 -v $(pwd):/home/src mageai/mageai:latest /app/run_app.sh mage start clcg-dataengineering</blockquote><pre># docker-compose.yaml<br>version: &#39;3&#39;<br>services:<br>  app:<br>    image: mageai/mageai:0.9.5<br>    command: /app/run_app.sh mage start clcg-dataengineering<br>    ports:<br>      - 6789:6789<br>    volumes:<br>      - ./:/home/src</pre><p>I’ll be using the latest docker image, open port 6789 since that’s what the web UI is running on and I’m making sure that all the files that Mage creates, will be stored in the same directory as this docker-compose.yaml through the volume ./:/home/src , the /home/src is the path that Mage needs to run everything on.</p><p>The command /app/run_app.sh mage start clcg-dataengineering creates a new project with this name. Meaning that after I start up the docker image, it’ll create a folder named clcg-dataengineering inside my current directory, which will contain all the files for my ETL flows. Now, it’ll also create a folder mage_data that holds metadata such as logs.</p><p>I can now run Mage by using the command docker-compose up in my terminal (in the directory where I created the docker-compose.yaml) and it’ll make everything ready to be accessible on localhost:6789 . Now, you’ll also see all the logs in the terminal, if you want to run it in detached mode, simply run docker-compose up -d instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yYLcIjN8lnqYM3-qvIaydg.png" /><figcaption>Mage web UI localhost:6789</figcaption></figure><h3>Why do I personally like to use Mage?</h3><p>There are many reasons why I like Mage, so let’s go through them one by one.</p><h4>The UI</h4><p>Mage comes with an extensive UI, just like many other orchestration tools. I find the UI of Mage better structured, while also being much more comprehensive with the available options to get insights into your data. You can do everything within the UI, including coding, which you can’t do with the other orchestration tools.</p><p>It does have its downsides compared to an editor like Vscode, hovering over variables is limited which limits the quick understanding of their docstrings.</p><h4>Triggers</h4><p>Triggers are amazing, they bring a lot of flexibility about how your pipeline gets run, there are multiple ways to trigger your pipeline, you can use the simply schedule (cron) trigger, which triggers a flow at a certain time.</p><p>Another option is API calls, this is great when you want to trigger the pipeline outside of Mage, triggering the pipeline with their file location, or running multiple backfills for different endpoints in the same pipeline.</p><h4>Notebook style</h4><p>Data scientists love their Jupyter notebooks, and even though I was never a fan of them mostly because clean code is incredibly hard to write inside Jupyter, Mage seems to have taken the best of it, caching blocks, while massively improving the worst of it, writing clean code.</p><p>It’s great to be able to debug and rerun specific blocks, without having the pull in your data over and over again. This has sped up my data pipeline building tremendously, by not having to wait for pulling data from a database or making a big amount of API calls.</p><p>Not only is it helpful with pulling the data, but it’s also incredibly helpful if you have a couple compute expensive transformations that might run 10–15 minutes. If you’re at the end of your data pipeline, testing would become extremely hard, waiting 15+ minutes for the whole pipeline to run to validate your last steps.</p><p>Because the blocks upstream are available to you, you don’t have to wait on them and can go through the last blocks of your pipeline much quicker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eMdQjQYhccSlbr3dPDBQcg.jpeg" /><figcaption>Sad Mage created by the Author with leonardo.ai</figcaption></figure><h3>Current Downsides to Mage</h3><blockquote>Disclaimer; These downsides are based on version 0.9.5 and might not hold true in future versions.</blockquote><ul><li>It’s hard to find solutions to bugs on Stack Overflow, or chatGPT. <br>You have to make use of the Slack channel to receive proper help</li><li>It’s still heavily in development, every week there are a ton of new features. <br>Some companies prefer more “stable” frameworks that have longer release cycles.</li><li>Even though the documentation is pretty good, it still is far from up-to-date with the actual possibilities of Mage, making it sometimes hard to find examples in the docs.</li><li>Since each block runs independently you might have overlapping/duplicated code, i.e. for initiating a specific class.</li></ul><h4>Sneak peek part 2</h4><p>In part 2, we’ll go more in-depth into what functionalities you can attach to your blocks to make your pipeline run as if it’s on steroids! Think of things like; dynamic blocks to embrace processing in parallel or a validation add-on to make use of Great Expectations for better data quality.</p><p><a href="https://blog.det.life/mage-the-modern-orchestration-tooling-to-replace-airflow-part-2-35bacbb3f794">Mage, the Modern Orchestration Tooling to Replace Airflow — Part 2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb7ef5df9105" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/mage-the-modern-orchestration-tooling-to-replace-airflow-part-1-eb7ef5df9105">Mage, Apache Airflow&#39;s Replacement  — Part 1</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Which Data Storage Should You Choose?]]></title>
            <link>https://blog.dataengineerthings.org/which-data-storage-should-you-choose-2eead4fcc9dc?source=rss-5618d5be5417------2</link>
            <guid isPermaLink="false">https://medium.com/p/2eead4fcc9dc</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-engineer]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Luuk Mes]]></dc:creator>
            <pubDate>Tue, 11 Jul 2023 04:43:20 GMT</pubDate>
            <atom:updated>2023-07-11T04:43:20.401Z</atom:updated>
            <content:encoded><![CDATA[<h4>So many to choose from… Databases, Data Warehouses, Data Lakes, and Delta Lakes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4gVwFmohvglS5MTDD_v2A.png" /><figcaption>Image Created by Author</figcaption></figure><p>The data space is full of different types of storage options. But not all storages are suitable for each use case.</p><p>Some are even more expensive than others for certain business cases, so choose wisely before it becomes tech debt that needs to be migrated.</p><h3>Database</h3><p>The classic, everyone has heard of it! A Database. So… What’s it?</p><p>A database (OLTP, Online Transaction Processing) is a storage solution that stores data in relation to each other, it helps with running queries and connecting row-based data.</p><p>Because they are row-based, they are great for write-heavy applications such as CRM systems, (e-)commerce, and user access within a SaaS application. It’s most of the time, the bread-and-butter of websites.</p><p>Postgres and Mssql are the most popular ones available, especially since they are both free and easy to set up, you can spin up an environment in a matter of minutes and start practicing SQL on them.</p><p>Back in the day, I used to do my data analytics tasks on a locked version of Mssql where queries were only allowed to run for 2 minutes. I can tell you, running on hundreds of millions of records with multiple joins, isn’t great for a database that kills your query after 2 minutes… Many hours have been “wasted” optimizing those queries for my reports…</p><p>This brings us to my favorite for these types of tasks;</p><h3>Data Warehouse</h3><p>Instead of a row-based format, Data Warehouses (OLAP, Online Analytical Processing) are column-based. They are great for reading specific columns and running queries differently than OLTPs. Whereas in an OLTP query, you always get back all the tables, afterward it filters down your selected columns an OLAP database will only retrieve the columns you’ve asked for in the first place.</p><p>They are the bread-and-butter for analytical purposes known for their speed on complex queries. Often used as the T in ELT, transforming the data that’s stored inside of them.</p><p>Where can you find these? Most of them are in the cloud and offer pay-as-you-go models to use them. Such as Bigquery, Redshift, and Snowflake.</p><p>My personal favorite is Bigquery really like the UI and speed of on-demand queries. But if you’re more into an open-source self-deployed option, then Clickhouse might be something you’re looking for!</p><p>Please <strong>don’t</strong> use Bigquery as an OLTP database, because you pay for every query you run, it becomes extremely expensive when used right behind a website with high traffic. The OLAP environment should pull data from different sources such as an OLTP database, to run the complex queries on. You can combine multiple sources from other APIs and try to connect the data to get a full 360-degree view of a customer.</p><h3>Data Lake</h3><p>Need to store files without connecting to a database? Or maybe you have images instead of textual data.</p><p>Data Lakes are great for storing many different types of data. It’s the perfect place to store anything you want!</p><p>Now, you can’t directly query these files, if you want to query on top of a Data Lake you’ll need other tools such as Trino to query the from the files.</p><p>Data Lakes are very popular in the DE space for backing up data since it has much cheaper storage prices compared to a Data Warehouse and Database.</p><p>While it’s also super important for streaming and machine learning use cases. This is because for ML cases you might need more unstructured data that is easy to access from a Data Lake.</p><p>Streaming cases such as logs or IoT-related data suits Data Lakes well, this is because it handles high-velocity real-time streaming data very well.</p><p>Here comes the downside, you need to know the paths of the files you want to store/access, you can ask what is inside of a directory and try to run based on that. But often you need to know where which data is stored before you can make use of it.</p><blockquote>Structure your Data Lake well, before it becomes a <strong>Data Swamp</strong> instead.</blockquote><h3>Delta Lake</h3><p>Even though Delta Lake sounds similar to Data Lake, it doesn’t exactly do the same thing. It can store data in files as you would do in Data Lakes, but in Delta Lakes, you’re storing a specific file type, a Delta file. It’s a file type based on Parquet, very suitable for transformations with Spark.</p><p>Azure is running several tools on top of a Delta Lake, like Databricks and Synapse. The new Azure Fabric can also interact directly with Delta Lake.</p><p>So, what’s it that a Delta file offers, more than other file types? Why does it deserve its own “lake”?</p><p>Delta Tables (files) can handle ACID transactions. This allows multiple users to concurrently read and write and ensures that data is consistent and complete, even in the case of failures or partial writes.</p><p>Delta Tables can handle UPDATE, DELETE, and MERGE statements which is amazing for a file! It’s like a mini-database as a file! As they are not natively available in Parquet, these can be useful for maintaining change data capture (CDC) tables or slowly changing dimension (SCD) tables.</p><p>One of my favorite functions of a Delta Table is time travel. Instead of having file_v1, file_v2, file_final. You can have version control within your single delta file. Making it possible for you to “travel” back to earlier versions and retrieve data that has been accidentally deleted or modified in a newer version. Fixing your P1 calls with ease.</p><h3>Conclusion</h3><p>No matter your use case, there is always a storage option available for you!</p><ul><li><strong>Database:</strong> Use for high transactions, row-based great for relations</li><li><strong>Data Warehouse:</strong> Use for complex analytical queries, column-based</li><li><strong>Data Lake:</strong> Use for a high variety of files, easy access, ML, and backup purposes.</li><li><strong>Delta Lake: </strong>Use for ACID transactions, modifying rows through DELETE/UPDATE/MERGE statements, version control</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2eead4fcc9dc" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/which-data-storage-should-you-choose-2eead4fcc9dc">Which Data Storage Should You Choose?</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Got Into Data Engineering]]></title>
            <link>https://blog.dataengineerthings.org/how-i-got-into-data-engineering-740392fbd6f5?source=rss-5618d5be5417------2</link>
            <guid isPermaLink="false">https://medium.com/p/740392fbd6f5</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Luuk Mes]]></dc:creator>
            <pubDate>Sun, 25 Jun 2023 15:01:55 GMT</pubDate>
            <atom:updated>2023-06-25T15:01:55.703Z</atom:updated>
            <content:encoded><![CDATA[<h4>Finding Success in Data Engineering Without the Textbook Route</h4><p>In the world of data, we often hear tales of high-flying graduates with degrees in Computer Science landing impressive gigs at tech giants. But let’s flip the script. Here I am, a Data Engineer who found his purpose in a health-tech company, with a somewhat unconventional pathway into the field.</p><p>Take a step back and imagine this — four companies, three years, and a whole lot of data. It’s been quite the ride, and not just a linear one plotted on a graph.</p><p>There are nuggets of wisdom to be found in the most unlikely places, and this journey taught me that education isn’t the be-all and end-all. Even though almost all my colleagues have had Master’s or Ph.D. degrees, I’m still working alongside them with a Junior College degree.</p><p>Then there’s the purpose. It’s critical, but oh boy, is it elusive… I thought many times, that I made the correct decision by following money or ex-colleagues, but if the work isn’t motivating you, it’s better to find a new environment that truly makes you feel like you have an impact.</p><p>So strap in, folks. Let’s uncover the world of data engineering, shattering some preconceptions, and exploring the twists and turns of my journey.</p><p>We’ve got a lot of ground to cover, so let’s get going!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQRAItLV0efqWKxBhzD5bA.jpeg" /><figcaption>Image Generated By Author with DALL-E</figcaption></figure><h3>Education</h3><p>Back when I was 15, I choose software development as my study path in Junior College (MBO4) in the Netherlands. Looking back on it, I didn’t like creating websites, or C# applications and had some slight interest in programming with Java. My internship back then was in websites, mostly using PHP and Jquery. It just wasn’t my cup of tea.</p><p>After graduating at the age of 19 years old, I had an opportunity to continue working at that internship, but I didn’t have the ambition to already start the 9–5 life. Instead, I took a gap year and moved to the capital city of South Korea, Seoul, where I spent the early years of my 20s trying to figure out what I truly wanted to do in life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jb0tGxZSG-82pxmnZ2CN0Q.jpeg" /><figcaption>Gyeongbokgung Palace is really special at night © Lee Seong-u, Korea Tourism Organization</figcaption></figure><h3>Traveling</h3><p>You can learn a lot of things, crucial to your future career, by experiencing certain things in life.</p><p>For me, it was the first time I was really on my own. Living in a new country with a massive different culture, language, food, and people.</p><p>There were lots of things I was able to learn that ended up building my foundation.</p><h4>Perseverance</h4><p>Leaving my family behind with an 8 hours time-zone difference, being in a country that doesn’t speak my language as well as having to depend fully on myself, was a rather challenging task. Especially since I never lived by myself before.</p><h4>Thriving outside the comfort zone</h4><p>There are many reasons to feel like you’re leaving your comfort zone once you move to a different country;</p><ul><li>Going out of your way to connect with strangers to make new friends</li><li>Not feeling afraid to communicate in their language — no matter how broken it comes out of your mouth</li><li>Working part-time in a different culture</li></ul><h4>Trying something new</h4><p>When it comes to a new country, everything you experience there is something new. If you’re not up to try anything, you better not go…</p><p>From food to culture, to interacting with others, even the climate could be something new. If you come from a warm country and move to a snowing country, then that also counts as trying something new.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zMfobe6IAofFBX7s_jXKjQ.jpeg" /><figcaption>Image Generated By Author with DALL-E</figcaption></figure><h3>The Start of My New Career</h3><p>I moved back to my home country at the end of 2018, unable to search for a job because of the upcoming holidays. Dusted off my resume and started applying in January 2019. That month I received two offers, one as a PHP developer, and one as an SQL developer.</p><p>Now, knowing my introduction, you know I wasn’t that fond of PHP, and this company wasn&#39;t willing to hire another developer, so I would have 0 guidance as a Junior PHP Developer.</p><p>As for the SQL developer role it was located in the email marketing industry, I had a nice team, a Senior and Medior that could guide me as well as play with (bigger) data than I ever did before.</p><p>I ended up accepting the role, having to learn Selligent as it was our email marketing automation tooling as well as getting more comfortable with (T-)SQL.</p><h4>Feeling lost</h4><p>One of my biggest challenges was getting the trust of my project managers so that I would get projects to work on. The problem was, we were working with big clients and Selligent doesn’t really support CI/CD, code reviews, etc… Which meant that anything I did, was hard for others to validate before it went out.</p><p>On top of that, my direct Senior and Medior were heavily overpacked and got way too little time to onboard me, meaning I felt left out, not being able to contribute. It took almost half a year, before one of the project managers finally, consistently started giving me projects.</p><p>Why did it take so long? The company just didn’t give my colleagues enough space to properly review the work I could be doing. And even though I asked on a weekly basis, to receive work I could do, nothing was coming my way.</p><p>In hindsight, I think I could’ve asked to shadow the projects that the Medior was doing, without my code having to go to production, then I would at least be able to learn from what I made + validate it with what he made.</p><h4>Getting confidence and others’ trust</h4><p>After I was able to prove myself, I started to grow much faster. Enjoying the work that was given to me, and excited to learn new things.</p><p>Most of my SQL knowledge comes from those days, we had to write optimized queries since the platform we were using only gave 2-minute slots before killing the queries. Often requiring temp tables to handle long complex queries.</p><p>To this day, I still format my SQL code, how I got taught there, it just feels much more natural to me. Leading commas, 1=1 in the where clause, both to optimize for debugging since (un)commenting lines become much smoother.</p><p>It’s crucial to have a team behind you, that is willing to believe in you since it drastically changed the course of my growth, once I was getting projects and creating space in my colleagues’ agendas by picking up some of their tasks.</p><p>In the 12 months, I was able to grow from a Junior to a Medior SQL Developer, even though I missed out on 4–6 months of growth.</p><h3>Impact of COVID-19</h3><p>When COVID-19 hit, I was looking around in the market and SQL developers didn’t really have that many job openings in the Netherlands, especially if you’re looking outside of the Email Marketing industry.</p><p>Most of the things that passed me by were Backend Developer, which here meant, either PHP, Java, .NET, C#, or C++. Languages that didn’t interest me too much.</p><p>Scrolling through Reddit, I often stumbled upon nice dashboards, created by Data Analysts or Data Scientists, it sparked a light in me that moved me to learn Python.</p><p>I started playing around with some company data, visualizing them and showing them to my project managers in the hope it brought them something valuable. The question I often got back was “Why do you think, specifically, this data, is of use?” Simply building a chart, is different from providing great insights. I have 0 business knowledge, and to be honest, had no clue what actions could be taken from certain types of knowledge generated by data.</p><p>Starting to network in my company with the data team, asking for “how” to develop this skill, I came to understand that it’s either taught in school, or you learn it in your job as a Data Analyst.</p><p>After teaching myself Python for about 2 months, a colleague of mine, a Data Engineer, left the company and because I had already shown my interest in data, the team asked me if I was interested in joining the official job application together with the external applicants.</p><p>I was thrilled since I was already trying to find a safer career than my current one, and even though I had just been promoted to Medior SQL Developer, I didn’t mind going back to a Junior title to learn something new.</p><p>There was a take-home assessment, and since I was still new in Python, it took me a while to complete about 10 hours of coding + deploying in GCP (got a sandbox account from the company to deploy on) and another 6 hours preparing a presentation that you could give to a client, explaining which decisions could be taken based off (local) weather data.</p><p>Needlessly to say, after some hard evenings, I was able to get the job. Excited to join my colleague’s team that was helping me out with my self-study data-related questions.</p><p>When hard times are in front of you, make sure to have an escape plan. Mine was, moving into a better, more interesting career path, than I at that moment had. Little did I know, how much positivity it brought to me, finding my passion but also financially. The growth has been great.</p><h3>Diving into Data Engineering</h3><p>I had no idea what I got myself into when I entered the data team, but I was super excited to be able to do more than just SQL, being able to do Python + SQL gave me a lot of variety in my day-to-day work as well as able to grow in new areas.</p><p>The team at the time, was also rather new and still growing. Finding their footing with best practices and I, together with a colleague tried our best to build a guide about built-in Python functions like how to use decorators, group-by, lambda, and much more.</p><h4>The first job — My Foundation</h4><p>I very much enjoyed playing around and learning more about Python, spent countless evenings out of pure ambition playing on small side projects or improving the best practices guide.</p><p>Our data stack was located on the Google Cloud Platform (GCP)</p><ul><li>Data Warehouse; Bigquery, connecting to dashboards</li><li>Data Lake; Cloud Storage Buckets, mostly as landing zone + backups</li><li>Extract Flows; Cloud Functions, or Cloud Run if we required longer compute times</li><li>Cron; Cloud Scheduler</li></ul><p>The transformations we did fully within Bigquery, at the time with scheduled queries.</p><p>It was a great stack to tip my toes in, not too complex, and at the same time, it built a great foundation.</p><p>When you’re looking for your first job, make sure that you’re opting for a good data stack, it’s important to learn skills that are of value, this gives you more opportunities in the long run.</p><h4>The second job — AI instead of BI</h4><p>For personal reasons, I decided to move to another consultancy company, working on a project for a startup.</p><p>Their data stack was on Azure and much less gated to BI compared to my first job. There were no dashboards or Data Analysts, instead, I was working together with Computer Vision Engineers.</p><p>Creating streaming pipelines to process images, deduplicating based on image hash, putting the metadata in Postgres and the file in a Blob storage, and streaming specific images to other AI models that were required for our e2e model to work.</p><p>We even created our own label tool to ensure the accuracy of our images, since AmazonTurk wasn’t really working well for us. Maintaining data quality was paramount — if we were unsure about a batch’s labeling, we simply didn’t include it in the dataset.</p><p>I learned a lot, building the whole data architecture mostly by myself, having a Senior Computer Vision Engineer as a sparring partner, as well as providing value to make the Computer Vision Engineers able to focus on the models. Using another cloud solution, daily working on VMs, working with streaming data instead of only batched data.</p><p>Our use case didn’t require an expensive Kafka cluster to run, it simply ran on a VM with RabbitMQ + Celery to process all the images concurrently, processing tens to hundreds of thousands of images per day.</p><p>My Senior Computer Vision Engineer taught me the ins and outs of Docker + docker-compose, working on VMs instead of locally on my own laptop, and using Vscode’s remote connection to connect with the VM. I also made a swap from Flask to FastAPI, being able to test the API and see the image results in the docs was extremely helpful!</p><p>Having him, the Senior Computer Vision Engineer, as my first mentor, really sped up my capabilities as a Data Engineer. He was incredibly good at giving the exact right amount of chunked information, for you to quickly pick up something new. And the second that you learned them, the next chunk was available.</p><p>Finding a mentor is hard, it often has to come naturally, but it’s often underrated and was extremely important to my career growth.</p><h3>Reflecting on My Soft Skills</h3><p>Once I became a Data Engineer, I was surprised that I learned some of my most important soft skills, through the travels I’ve had in South Korea.</p><h4>Perseverance</h4><p>Similarly to my travels, the realm of Data Engineering is not exempt from these challenges. You might be working on a very big project that requires extracting real-time data from multiple sources. The setbacks could be many and the progress might be slower than expected.</p><p>The real challenge lies in managing expectations and even more importantly, trust. It’s about convincing your stakeholders to keep believing in the importance of the project, even when it demands more time and resources than initially planned. Because at the end of the day, the success of any project hinges not just on skill or expertise, but on the unwavering commitment to see it through.</p><p>Perseverance, in this sense, is more than just a skill; it is the backbone of any successful endeavor, be it adjusting to a new country or steering a complex data engineering project to fruition.</p><h4>Thriving outside of the comfort zone</h4><p>Data Engineers constantly get challenged to leave their comfort zone, because the scene is very broad and there are many things for you to know. It’s not strange to have to pick up a new skill without feeling ready.</p><p>Maybe you’re a SQL guru, but your team requires you to learn Python to create DAGs, or you’ve been working hard integrating your ETL flow into Mage, but now you need to have a CI/CD pipeline that handles the deployment of your codebase.</p><p>All of these require you to step out, be uncomfortable and learn a new skill. I enjoy getting out of my comfort zone since it means I’ll learn or experience something new.</p><blockquote>“In the dynamic world of data, the real growth happens at the edge of your schemas, where ambiguity meets creativity. Thriving outside the comfort zone is not a choice, but a necessary leap towards innovation.”</blockquote><h4>Trying something new</h4><p>The data space is ever-changing new technologies come out every day, and just 5–10 years ago, people thought Hadoop was there to stay, but since then, Spark has drastically changed the distributed computing space.</p><p>The same goes for on-prem vs cloud, how AI is improving on a daily basis, and even new file formats like Delta which launched its V1.0.0 back on May 25th of 2021. It’s getting more popular by the day, which also influenced new frameworks such as Iceberg making use of the Delta file format.</p><p>Even big frameworks such as Airflow have a ton of other orchestration tools like Prefect, Mage, and Dagster.</p><p>Trying out new technologies, and creating proof of concepts to validate their usefulness in your business cases is a crucial aspect of Data Engineering.</p><p><em>But, don’t fall into the trap of always chasing the next hot technology. It’s about improving your data stack, it should be meaningful, impactful, and resourceful.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hQ0R2zZkOPAdbi8c3BQ0Bw.jpeg" /><figcaption>Image Generated By Author with DALL-E</figcaption></figure><h3>Finding Purpose in My Data Engineering Career</h3><p>Stranded I felt, working for companies that were most interested in their bottom line, made me understand that the industry that I want to work in, wasn’t the one I was working in.</p><p>Before my current company, I worked for 3 consultancy companies, 2 in Marketing and 1 broader, having a project at an AI startup in the Fashion industry. From all of these companies, I learned a lot, but in the end, it just wasn’t for me…</p><p>Talking to my wife and looking at my own core values, it came to my understanding that what I truly cared about, was using my skills for the “greater good” more for society than for the profit of a company.</p><p>So, I started looking for jobs related to government, health care, non-profit organizations, etc… And ended up stumbling on my current employer where we help hospitals get better insights into which patients are more likely to have an infection after their surgery and possibly need to be monitored more actively.</p><p>It felt like an incredible mission with real, positive, social impact. Potentially saving the patient&#39;s limbs if not their lives.</p><p>I’m grateful for being part of this amazing startup and for the steps that I’ve taken in the last 4 years. I appreciate all the opportunities I’ve received, as well as the people who believed in me along the way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7jbZ22fayPVKyKIbGde2JA.jpeg" /><figcaption>Image Generated By Author with DALL-E</figcaption></figure><h3>Conclusion</h3><p>Landed at my current destination — feels like a great time to reflect on my journey.</p><p>The things I wish I knew ahead of time;</p><ol><li><strong>Hard skills &gt; Education</strong>. Building proper projects gives you the right skills needed to hit that first job.</li><li><strong>Soft skills</strong> are rare, important, but rare, the further you grow in your career the more important they become. Luckily, we can develop these already ahead of time, way before we start our careers. You can develop them while traveling, like me, or when teaching your peers in college, be in the present and reflect once in a while, on which soft skills you already have.</li><li><strong>Networking</strong> is important, if I never had talked to my internal data team and showed my passion for data, they would’ve never thought of me when their colleague left. (Fun fact, when I left the company, that same colleague came back, so don’t burn your bridges, she was able to come back by keeping her contacts warm)</li><li>Be picky in your first job; yes, you must get your foot in the door, but you must also ensure that you have the hard skills required for future opportunities. Make sure your first data stack is strong. <em>Cloud-based with transferable frameworks like Spark, and Kafka. A company that makes use of CI/CD like GitHub Actions, and an orchestration tool such as Prefect, Mage, or Airflow. Make sure that you will not be the sole DE; you will need colleagues to learn from!</em></li><li>Data Engineers are needed in all sorts of industries. Be honest with yourself, try to work in an industry that truly captures your heart. Don’t worry if you don’t know what you want yet; try out different companies and industries to help you grow as a Data Engineer and as a person.</li><li><strong>Mentors</strong> are crucial to how quickly you grow, accept someone’s guidance, and always stay curious to learn, if someone feels like you enjoy the be taught, they’re more open to keep giving you advice, slowly resulting in a possible mentor-mentoree relationship.</li></ol><p>Continuous learning fosters continuous growth.</p><p>Keep on learning, and enjoy your own journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=740392fbd6f5" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/how-i-got-into-data-engineering-740392fbd6f5">How I Got Into Data Engineering</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Ways to Boost Your Productivity as a Data Engineer]]></title>
            <link>https://blog.dataengineerthings.org/5-ways-to-boost-your-productivity-as-a-data-engineer-e89072ff44aa?source=rss-5618d5be5417------2</link>
            <guid isPermaLink="false">https://medium.com/p/e89072ff44aa</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Luuk Mes]]></dc:creator>
            <pubDate>Sun, 11 Jun 2023 03:56:03 GMT</pubDate>
            <atom:updated>2023-06-11T03:56:03.081Z</atom:updated>
            <content:encoded><![CDATA[<h4>Get back your time to write more code and data solutions!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XAAkxBrjlucLVnkZi-vjdg.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/photo/black-laptop-beside-black-computer-mouse-inside-room-669996/">Bich Tran</a></figcaption></figure><p>Do you always feel like you’re not using your time productively? You’re not alone!</p><p>Many data engineers find themselves struggling to maximize their output and achieve the excellence they know they’re capable of. But fear not, for this blog post is here to help you.</p><p>Discover how to boost your data engineer career to outperform your peers by mastering these five essential productivity techniques, and unlock the secrets that will set you apart in this highly competitive industry!</p><blockquote>“Productivity is never an accident. It is always the result of a commitment to excellence, intelligent planning, and focused effort.” — Paul J. Meyer.</blockquote><h3>Be the driving force to get your focus back</h3><p>As a data engineer, you’re responsible for managing vast amounts of data and ensuring its quality and accessibility. This requires a high level of focus and dedication. Recognize distractions that are specific to your role — such as frequent data alerts, ad-hoc requests, complex debugging tasks, or simply a mountain of meetings — and set stronger boundaries to manage them effectively.</p><h4>1. Decline Optional Meetings</h4><p>One of the biggest energy taxes is back-to-back meetings, no one likes to be in a meeting that could’ve been an email, we’re not managers, that love their meetings!</p><p>Data Engineers require a lot of deep work to implement their data pipelines, data modeling requests, or searching the bug that’s causing your data quality to fail.</p><p>All these meetings are a major distraction and multiple back-to-back meetings even generate a lot of stress that will impact you for the rest of the day as shown by Microsoft’s research below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JVo6CIMt1ltqkwFEMXm6MA.jpeg" /><figcaption>Microsoft <a href="https://www.microsoft.com/en-us/worklab/work-trend-index/brain-research">Research</a></figcaption></figure><p>If you don’t bring anything to the meeting, simply decline it, if you’re just there to listen and don’t say a single word, then a colleague could’ve just summarized the meeting and sent a message to you instead.</p><h4>2. Block Message Notifications</h4><p>As Data Engineers, we often have to communicate with a lot of different people and have our data quality monitoring linked to message apps.</p><p>How often do you hear your message app (Teams, Slack, Google Chat, etc.) bleep? Every single time you hear it, you’re instantly distracted.</p><p>Even if you’re not looking at them, your mind has already wandered off and is thinking about what the message is about. And we’re curious as human beings and checking the message is a gratification system for our dopamine.</p><p>By blocking the notifications, we <strong>can avoid this negative cycle.</strong> Instead, have designated times when you want to check your inbox, messages, etc.</p><p>This way, you’ve set a <strong>healthy boundary</strong> and your colleagues don’t need you right away, even if they do, then they can call you for emergencies. If they’re blocked and you’re their savior to unblock them, then they can simply work on another task until you’ve responded.</p><p>Let them know your message schedules so they know when to anticipate a response or timing it around your message blocks; you may do this in a separate document outlining how you like your colleagues to contact you. <em>I’ll come back to this topic, creating a specific document for that in a future blog post.</em></p><h4>3. Schedule Focus Blocks</h4><p>Focus blocks are moments in your day when you’re able to heavily focus on a <strong>single</strong> task. The idea is that you set a specific block of time (I noticed that for myself, I prefer blocks of at least 2 hours) and fully disconnect yourself from any possible distractions.</p><p>This way you can enter the state of “zone&quot; faster and produce a much higher code quality. The perfect time to think about your code design, data architecture or simply creating good, easy-to-test, functions for your idempotent data pipelines!</p><p>Make sure to schedule your focus blocks ahead of time so that you can schedule meetings outside of them as much as possible, as well as communicate with your direct colleagues when you’ll be away from any noise.</p><p>Create boundaries when people are allowed to call you “awake”, for example when there is a critical bug that only you can fix like your colleague dropping production tables ;-). It’s fine if people are temporarily blocked, they can simply continue on their next task until you’re available to help them out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4dl4tMD9Hw_LX79xUvy3TA.jpeg" /><figcaption>Created By Author With DALL-E</figcaption></figure><h3>Embrace Automation to Clear Space for Essential Tasks</h3><h4>4. Automating with Makefiles</h4><p>Improving your team’s productivity is just as important as your own. Making sure that repetitive (complex) tasks are automated free’s up a lot of time for you and your colleagues.</p><blockquote>This can be done through Makefiles or Taskfiles depending on your preference. Makefile runs bash commands to automate different tasks for you.</blockquote><p>One of the great parts is that even juniors can use them since it’s automated through commands and they can slowly learn what happens underwater.</p><p>Example from my work; We have a docker-compose.yaml that is being used in our CI/CD pipeline which builds off of a docker image that is stored inside of an environment variable.</p><p>Now, to run these tests with the docker-compose.yaml it’s quite the hassle to always have to run multiple commands…</p><ol><li>Setting the docker image name based on our branch name</li><li>Building the docker image</li><li>Running the tests in the docker-compose to stay in line with the CI/CD pipeline</li></ol><pre># Use the current branch name as test_image_name (lowercase)<br># Docker tags are required to be lowercased<br>export TEST_IMAGE_NAME := $(shell git branch --show-current | sed &#39;s/^feature\///&#39; | tr &#39;[:upper:]&#39; &#39;[:lower:]&#39;)<br><br>build:<br> docker build --tag ${TEST_IMAGE_NAME} .<br><br>test: build<br> docker-compose -f docker-compose-testing.yml run app /code/bash/run_tests.sh</pre><p>The above Makefile does everything for us and simply running make test it’ll rebuild the image with our branch name so we can always come back to the correct one when swapping branches and afterward run the docker-compose that uses the tagged docker image.</p><p>This instantly made it possible for the whole team, to run tests locally, even people that are less familiar with docker and bash.</p><p>Another Makefile I created at a previous company was to help juniors who just started working on cloud VMs, to set up the correct Python environment.</p><pre>ACTIVATE_VENV = . venv/bin/active<br><br>PYTHONPATH = PYTHONPATH=$$PWD/src<br><br># Build a virtual environment and install all the required packages<br>build:<br>  (python3 -m venv venv; \<br>  ${ACTIVATE_ENV}; \<br>  pip install -r requirements.txt --upgrade pip; \<br>  pip install pytest pytest-cov; \<br>  )<br><br># Activate virtual env and run the uvicorn webserver to launch FastAPI<br>run:<br>  (${ACTIVATE_VENV}; \<br>  ${PYTHONPATH} uvicorn main:app --reload --port 8000; \<br>  )</pre><p>Whenever they were in a new repository they could run make build and it would install all the dependencies, while if they wanted to test the API they could run make run and it’ll run the virtual environment before running the webserver that FastAPI uses.</p><p>This way, they didn’t need to know right away how and why we use virtual environments and were able to test their endpoints with the provided FastAPI docs.</p><p>Be aware, that you have to run all the commands inside of the () only then will they be called from the same shell, otherwise it’ll use a new shell for each command.</p><h4><strong>5. CI/CD: Quality Assurance</strong></h4><p>Coming back to team productivity, data solution requirements often change and these changes need to hit production again.</p><p>God bless that your team uses a dev/staging/production environment that is synced properly, but if not, it’s likely the most senior person that’s (re-)deploying the code.</p><p>To prevent any major problems from happening, we use CI/CD pipelines to test and deploy the code for us.</p><p>This way we can make sure that any future changes that break the code are properly caught inside the code reviews and in case everything looks great, automatically deployed to the corresponding environment. This saves you and your colleagues massive time, to not have to test and deploy manually.</p><p>It also frees up time from the most senior person to do other things, for example teaching others how to do proper code reviews, build new data pipelines or add new tools to the data architecture.</p><p>Having CI/CD pipelines for your most important data pipelines also makes them much more robust since you can simply revert to an old version in case of any uncaught-breaking changes.</p><h3><strong>Conclusion</strong></h3><p>Being able to reduce the amount of time spent doing repetitive tasks or being able to skip meetings that are just not necessary, gives you a lot more hours in the week to produce high-quality data pipelines and do the things you love most, bringing data projects come to life.</p><p>So make sure to do the following things:</p><ol><li>Double check if you’re really, really, necessary to attend the meeting</li><li>Enjoy a silent-notification work time</li><li>Schedule focus blocks for optimal “in-the-zone” moments</li><li>Automate repetitive (complex) tasks so everyone on the team can do them without knowing how extremely nice for slowly onboarding juniors</li><li>Don’t deploy manually, use CI/CD pipelines instead</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e89072ff44aa" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/5-ways-to-boost-your-productivity-as-a-data-engineer-e89072ff44aa">5 Ways to Boost Your Productivity as a Data Engineer</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improving Data Integration Test Performance with Mock]]></title>
            <link>https://blog.dataengineerthings.org/improving-data-integration-test-performance-with-mock-ef6b357456da?source=rss-5618d5be5417------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef6b357456da</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Luuk Mes]]></dc:creator>
            <pubDate>Mon, 15 May 2023 18:47:42 GMT</pubDate>
            <atom:updated>2023-05-15T18:47:42.051Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*quMOfdjb1KTWCr_qbgOGkw.png" /><figcaption>Image Created by Author</figcaption></figure><h3>Introduction</h3><p>Have you ever wondered how Data Engineers test code components that involves data endpoints?</p><p>Testing in data engineering typically starts with unit tests — checking if a single encapsulated function returns the expected results given input. Besides unit tests, integration tests are also used to evaluate the behaviours of multiple functions or modules combined together. In data engineering, integration testing usually involved components of data endpoints, such as SFTP, databases, Blob storage, and so on.</p><p>As best practices, integration tests should never make requests to actual servers, because that would make the test flow dependent on the uptime of the dependencies. For example, if the service is momentarily unavailable, the integration test will fail even if the logic of your code is correct. In addition, exchanging data with actual servers can significantly increase the total runtime of integration tests as the codebase gets bigger.</p><p>Therefore, data endpoints are often Mocked in integration tests to improve test reliability and performance. In this blog, I will talk about what Mock is and the benefits of Mock, and walk through integration test examples using Mock library to test functions that exchange data with SFTP servers.</p><h3>What is a Mock?</h3><p>I could hear you asking this exact thing! So let’s define a Mock.</p><p>A Mock is a simulated object that mimics a real component. It’s used to isolate the system under test and control its inputs and outputs, particularly when actual components are unavailable or too complex.</p><p>Mocks can be programmed to behave in specific ways, like returning predefined responses or throwing exceptions, enabling the creation of diverse test scenarios. For example, a Mock database could test how an application handles database outages. Furthermore, Mocks can be sued to verify interactions between the system and its dependencies.</p><p>Mock allows testing in a controlled, predictable environment, simulating real-world scenarios and facilitating detailed interaction verification. Thanks to Mock, we don’t need to put credentials into a git provider!</p><blockquote>⚠️ Never let your credentials dangle unencrypted inside a git repository!</blockquote><p>Let’s look at some Mock examples!</p><h3>Upload File to SFTP</h3><p>In the simple example below, we’ll be uploading a CSV file from a local drive named foo.csv to the root folder on SFTP.</p><pre># main.py<br>from paramiko import SSHClient, AutoAddPolicy<br><br>def upload_file_to_sftp(<br>    hostname: str,<br>    username: str,<br>    password: str,<br>    local_path: str,<br>    remote_path: str,<br>    port: int = 2222,<br>) -&gt; None:<br>  with SSHClient() as ssh:<br>      ssh.set_missing_host_key_policy(AutoAddPolicy())<br>  <br>      # Connect to the SFTP server<br>      ssh.connect(hostname=hostname, username=username, password=password, port=port)<br>  <br>      # Open an SFTP session using a context manager<br>      with ssh.open_sftp() as sftp:<br>          sftp.put(localpath=local_path, remotepath=remote_path)<br><br>if __name__ == &quot;__main__&quot;:<br>    hostname = &quot;0.0.0.0&quot;<br>    username = &quot;foo&quot;<br>    password = &quot;pass&quot;<br>    local_path = &quot;foo.csv&quot;<br>    remote_path = &quot;/foo.csv&quot;<br>  <br>    upload_file_to_sftp(hostname, username, password, local_path, remote_path)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1uWDsZSB9waXclNaacFdA.png" /><figcaption>Photo by <a href="https://unsplash.com/@dtravisphd?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">David Travis</a> on <a href="https://unsplash.com/photos/WC6MJ0kRzGw?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> (slight edit by Author)</figcaption></figure><h3>Testing the Upload Function</h3><p>Since we don’t want to leave our SFTP credentials inside our CI/CD workflow, we’ll be using a Mock, which is created by patching the SSHClient.</p><p>By calling our function, within the patch context manager, it’ll automagically mock the SSHClient for us and we’ll be able to use the mock_ssh_client variable to validate if our functions were called as expected.</p><pre>from unittest.mock import patch<br>from main import upload_file_to_sftp<br><br>def test_upload_file_to_sftp() -&gt; None:<br>    &quot;&quot;&quot;<br>    Test to see if we can upload a file to a test sftp server<br>    &quot;&quot;&quot;<br>    hostname = &quot;127.0.0.1&quot;<br>    username = &quot;test&quot;<br>    password = &quot;test&quot;<br>    local_path = &#39;foo.csv&#39;<br>    remote_path = &quot;/foo.csv&quot;<br>    # Mock the SSHClient constructor<br>    with patch(&quot;main.SSHClient&quot;) as mock_ssh_client:<br>        upload_file_to_sftp(hostname=hostname, username=username, password=password, local_path=local_path, remote_path=remote_path)</pre><p>First we want to validate if we called the connect function correctly, with the parameters that we’ve provided. Because we’re using a context manager, with we’re required to use the __enter__ return value, to access our underlying functions. This makes the mock methods look a bit odd.</p><pre>def test_upload_file_to_sftp() -&gt; None:<br>    &quot;&quot;&quot;<br>    Test to see if we can upload a file to a test sftp server<br>    &quot;&quot;&quot;<br>    hostname = &quot;127.0.0.1&quot;<br>		<br>    ...<br><br>    # Validate that we connected with the expected parameters<br>    mock_ssh_client.return_value.__enter__.return_value.connect.assert_called_once_with(hostname=hostname, username=username, password=password)</pre><p>Afterwards we can use the same structure, to validate that we called the put function from the SFTP client correctly. Since this is a 2nd context manager, we’ll require to go one __enter__ deeper.</p><pre>def test_upload_file_to_sftp() -&gt; None:<br>    &quot;&quot;&quot;<br>    Test to see if we can upload a file to a test sftp server<br>    &quot;&quot;&quot;<br>    hostname = &quot;127.0.0.1&quot;<br>		<br>    ...<br><br>    # Validate that we uploaded a file with the correct parameters<br>    mock_ssh_client.return_value.__enter__.return_value.open_sftp.return_value.__enter__.return_value.put.assert_called_once_with(localpath=local_path, remotepath=remote_path)</pre><p>The full code will look like:</p><pre>from unittest.mock import patch<br>from main import upload_file_to_sftp<br><br>def test_upload_file_to_sftp() -&gt; None:<br>    &quot;&quot;&quot;<br>    Test to see if we can upload a file to a test sftp server<br>    &quot;&quot;&quot;<br>    hostname = &quot;127.0.0.1&quot;<br>    username = &quot;test&quot;<br>    password = &quot;test&quot;<br>    local_path = &#39;foo.csv&#39;<br>    remote_path = &quot;/foo.csv&quot;<br>  <br>    # Mock the SSHClient constructor<br>    with patch(&quot;main.SSHClient&quot;) as mock_ssh_client:<br>        upload_file_to_sftp(hostname=hostname, username=username, password=password, local_path=local_path, remote_path=remote_path)<br>    <br>    # Validate that we connected with the expected parameters<br>    mock_ssh_client.return_value.__enter__.return_value.connect.assert_called_once_with(hostname=hostname, username=username, password=password)<br>    # Validate that we uploaded a file with the correct parameters<br>    mock_ssh_client.return_value.__enter__.return_value.open_sftp.return_value.__enter__.return_value.put.assert_called_once_with(localpath=local_path, remotepath=remote_path)</pre><h3>Creating Directories Inside the SFTP</h3><p>Our first example doesn’t let us upload files in new directories, only in existing ones.</p><p>What if we want to validate that we can actually create new directories?</p><p>Let’s first create a new function for that, that expects an SFTP client and a list of directories.</p><p>The directories are ordered by parent → child so that we can simply create them one by one.</p><p>The stat function checks if the directory exists and if not, triggers the FileNotFoundError which will trigger the mkdir function instead, creating our new directory.</p><pre>def create_remote_directory(sftp: SSHClient.open_sftp, remote_path: str) -&gt; None:<br>    # Retrieve only the directory path, excluding the filename<br>    directories = remote_path.split(&quot;/&quot;)[:-1]<br><br>    # Initialize an empty path for the current directory<br>    current_directory = &quot;&quot;<br>    # Iterate through the components and create each directory if it doesn&#39;t exist<br>    for directory in directories:<br>        # Skip empty components, e.g. the first one for an absolute path<br>        if not directory:<br>            continue<br>        current_directory = os.path.join(current_directory, directory)<br>        # Check if the current directory exists and create it if it doesn&#39;t<br>        try:<br>            sftp.stat(current_directory)<br>        except FileNotFoundError:<br>            sftp.mkdir(current_directory)</pre><p>The code would look like this, we make sure to grab the remote_directories from the remote_path and create them if necessary.</p><p>We know that our path /foo/bar/zoo doesn’t exist, so those 3 folders will be created by create_remote_directory</p><pre>from paramiko import SSHClient, AutoAddPolicy<br><br>def upload_file_to_sftp(<br>    hostname: str,<br>    username: str,<br>    password: str,<br>    local_path: str,<br>    remote_path: str,<br>    port: int = 2222,<br>) -&gt; None:<br>  with SSHClient() as ssh:<br>      ssh.set_missing_host_key_policy(AutoAddPolicy())<br>  <br>      # Connect to the SFTP server<br>      ssh.connect(hostname=hostname, username=username, password=password, port=port)<br>  <br>      # Open an SFTP session using a context manager<br>      with ssh.open_sftp() as sftp:<br>          create_remote_directory(sftp=sftp, directories=remote_directories)<br>  <br>          sftp.put(localpath=local_path, remotepath=remote_path)<br><br>if __name__ == &quot;__main__&quot;:<br>     hostname = &quot;0.0.0.0&quot;<br>     username = &quot;foo&quot;<br>     password = &quot;pass&quot;<br>     local_path = &quot;foo.csv&quot;<br>     remote_path = &quot;/foo/bar/zoo/foo.csv&quot;<br>     upload_file_to_sftp(hostname, username, password, local_path, remote_path)</pre><h3>Testing If a Function Got Called Multiple Times</h3><p>Since we create 3 directories, and because of that, trigger the function mkdir 3 times. We need to validate that, that truly happens.</p><p>So how do we do that? We can validate this in two different ways.</p><h3>1. Testing Directly in the test_upload_file_to_sftp</h3><p>This requires us to validate that within the open_sftp context manager, the function mkdir got called 3 times.</p><pre>from unittest.mock import patch<br>from main import upload_file_to_sftp<br><br>def test_upload_file_to_sftp() -&gt; None:<br>    &quot;&quot;&quot;<br>    Test to see if we can upload a file to a test sftp server<br>    &quot;&quot;&quot;<br>    hostname = &quot;127.0.0.1&quot;<br>    username = &quot;test&quot;<br>    password = &quot;test&quot;<br>    local_path = &#39;foo.csv&#39;<br>    remote_path = &quot;foo.csv&quot;<br>    # Mock the SSHClient constructor<br>    with patch(&quot;main.SSHClient&quot;) as mock_ssh_client:<br>        upload_file_to_sftp(hostname=hostname, username=username, password=password, local_path=local_path, remote_path=remote_path)<br>    <br>    # Validate that we connected with the expected parameters<br>    mock_ssh_client.return_value.__enter__.return_value.connect.assert_called_once_with(hostname=hostname, username=username, password=password)<br>  <br>    # Validate that we created 3 new folders (foo, foo/bar, foo/bar/zoo)<br>    assert mock_ssh_client.return_value.__enter__.return_value.open_sftp.return_value.__enter__.return_value.mkdir.calls == 3<br>    # Validate that we uploaded a file with the correct parameters<br>    mock_ssh_client.return_value.__enter__.return_value.open_sftp.return_value.__enter__.return_value.put.assert_called_once_with(localpath=local_path, remotepath=remote_path)</pre><h3>2. Testing the create_remote_directory Itself</h3><p>Since this function expects an SSHClient.open_sftp object, we can also send a Mock object directly to create_remote_directory instead of going through the complete test_upload_file_to_sftp flow. By doing this, we don’t have to think about the return_value since we don’t use the context manager.</p><pre>from unittest.mock import MagicMock<br>from main import create_remote_directory<br><br>def test_create_remote_directory() -&gt; None:<br>    &quot;&quot;&quot;<br>    Test to see if we can upload a file to a test sftp server<br>    &quot;&quot;&quot;<br>    mock_sftp_client = MagicMock()<br>    remote_path = &quot;/foo/bar/zoo/foo.csv&quot;<br>    <br>    create_remote_directory(sftp_client, remote_directories)<br>    <br>    # Validate that we created 3 new folders (foo, foo/bar, foo/bar/zoo)<br>    assert mock_sftp_client.mkdir.calls == 3</pre><h3>Debugging Mocks</h3><p>You may be confused about whether your Mock object is being called correctly at times. If you’re unfamiliar with the procedures, this can be a real nuisance to troubleshoot. The mock_callsmethod is a great way to see the calls on the Mock. This method returns a list of all the methods called on your Mock.</p><pre>from unittest.mock import patch<br>from main import upload_file_to_sftp<br><br>def test_upload_file_to_sftp() -&gt; None:<br>    &quot;&quot;&quot;<br>    Test to see if we can upload a file to a test sftp server<br>    &quot;&quot;&quot;<br>    hostname = &quot;127.0.0.1&quot;<br>    ...<br>    with patch(&quot;main.SSHClient&quot;) as mock_ssh_client:<br>        upload_file_to_sftp(hostname=hostname, username=username, password=password, local_path=local_path, remote_path=remote_path)<br><br>    print(mock_ssh_client.mock_calls)</pre><p>Running the above code with pytest -rP * will show us exactly what was called. As you can see the context manager opened the __enter__() which we used in the above examples for the return_value pathing</p><blockquote>* -rP gives you all passed tests output including the print statements</blockquote><pre>[call(),<br> call().__enter__(),<br> call().__enter__().set_missing_host_key_policy(&lt;paramiko.client.AutoAddPolicy object at 0x7fd9b4a08910&gt;),<br> call().__enter__().connect(hostname=&#39;127.0.0.1&#39;, password=&#39;test&#39;, port=2222, username=&#39;test&#39;),<br> call().__enter__().open_sftp(),<br> call().__enter__().open_sftp().__enter__(),<br> call().__enter__().open_sftp().__enter__().put(localpath=&#39;foo.csv&#39;, remotepath=&#39;/foo.csv&#39;),<br> call().__enter__().open_sftp().__exit__(None, None, None),<br> call().__exit__(None, None, None)]</pre><h3>Tips and Tricks</h3><p>Debugging mocks can be challenging when you just started out. It can be unclear if the Mock is actually working or even triggered at all.</p><ol><li>Ensure that you substitute the actual object with its mock at the location in the code where the object is <strong>utilized</strong>, rather than where it’s initially instantiated.</li><li>Using the mock_calls method, helps you figure out how you need to formulate your return_value&#39;s or if you can skip them all together. You also get a much better understanding of your code flow.</li><li>Validate your mock’s configuration by writing targeted unit tests for the mock itself. These tests ensure that the mock is functioning as intended and can help catch any issues before they affect your integration tests. For example, if you have a return_value == &quot;success&quot; make sure that the Mock actually returns this as well.</li></ol><h3>Conclusion</h3><p>In this blog, we have explored</p><ul><li>the purpose of integration tests</li><li>the process of creating them</li><li>the technique of mocking SSH and SFTP clients.</li></ul><p>Additionally, we have dived into the proper usage of return_value, situations when it’s not necessary, and the advantages of the mock_calls method to enhance your debugging experience with mocks.</p><p>Armed with this knowledge, you are now better equipped to mock your way through the world of integration tests!</p><p>Want to read more about data engineering? Check out these articles on <a href="https://medium.com/data-engineer-things">Data Engineer Things</a>:</p><ul><li><a href="https://medium.com/data-engineer-things/mastering-collaboration-and-communication-as-a-data-engineer-ce2e819d720c">Mastering Collaboration and Communication as a Data Engineer</a></li><li><a href="https://medium.com/data-engineer-things">Data Engineer Things</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef6b357456da" width="1" height="1" alt=""><hr><p><a href="https://blog.dataengineerthings.org/improving-data-integration-test-performance-with-mock-ef6b357456da">Improving Data Integration Test Performance with Mock</a> was originally published in <a href="https://blog.dataengineerthings.org/">Data Engineer Things</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>