<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mage AI</title>
    <description>The latest articles on Forem by Mage AI (@mage_ai).</description>
    <link>https://forem.com/mage_ai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F691496%2Fdffa11ef-06bc-41d8-bf5b-e719d4cbcb12.png</url>
      <title>Forem: Mage AI</title>
      <link>https://forem.com/mage_ai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mage_ai"/>
    <language>en</language>
    <item>
      <title>Streamline data transfer: The ultimate data integration guide SFTP to BigQuery</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Fri, 07 Mar 2025 21:15:16 +0000</pubDate>
      <link>https://forem.com/mage_ai/streamline-data-transfer-the-ultimate-data-integration-guide-sftp-to-bigquery-501g</link>
      <guid>https://forem.com/mage_ai/streamline-data-transfer-the-ultimate-data-integration-guide-sftp-to-bigquery-501g</guid>
      <description>&lt;p&gt;&lt;em&gt;Link to original article written by Mage DevRel, Cole Freeman: &lt;a href="https://www.mage.ai/blog/streamline-data-transfer-the-ultimate-data-integration-guide-sftp-to-bigquery" rel="noopener noreferrer"&gt;https://www.mage.ai/blog/streamline-data-transfer-the-ultimate-data-integration-guide-sftp-to-bigquery&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;Securely move data from SFTP to Google BigQuery using Mage Pro for automated analytics. This guide walks you through setting up a pipeline, connecting to SFTP, choosing data streams, configuring replication, transforming data, connecting to BigQuery, triggering syncs, and verifying data. Automate your data flow, eliminate manual errors, and get valuable business insights!&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Business use case&lt;/li&gt;
&lt;li&gt;Step by step implementation guide&lt;/li&gt;
&lt;li&gt;Step 1: Creating a new pipeline&lt;/li&gt;
&lt;li&gt;Step 2: Configuring the SFTP connection&lt;/li&gt;
&lt;li&gt;Step 3: Selecting data streams&lt;/li&gt;
&lt;li&gt;Step 4: Configuring data replication methods&lt;/li&gt;
&lt;li&gt;Step 5: Transforming data&lt;/li&gt;
&lt;li&gt;Step 6: Setting up Google BigQuery as destination&lt;/li&gt;
&lt;li&gt;Step 7: Triggering the data sync&lt;/li&gt;
&lt;li&gt;Step 8: Verifying data synced to Google BigQuery&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Are you struggling with secure data transfers from SFTP to your data warehouse for analytics? This guide demonstrates how to build automated, scalable data integration pipelines using Mage to transform complex data workflows into straightforward processes that power your analytics infrastructure. In the following sections, we'll walk through setting up Mage Pro, creating your first pipeline, and establishing reliable data synchronization to Google BigQuery.&lt;/p&gt;

&lt;h2&gt;
  
  
  Business use case
&lt;/h2&gt;

&lt;p&gt;Many companies face a common challenge when managing transaction data from multiple systems, even multiple vendors. These organizations regularly receive sensitive financial information via SFTP as CSV files while their analytics teams require this data in a centralized warehouse like Google BigQuery for analyzing important business operations. Without automation, the process of transferring data from SFTP servers to analytics platforms creates multiple pain points. Manual transfers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Consume valuable time;&lt;/li&gt;
&lt;li&gt;Introduce security vulnerabilities when handling sensitive information;&lt;/li&gt;
&lt;li&gt;Llead to data inconsistencies that impact analysis quality.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Implementing an automated SFTP to BigQuery pipeline addresses these challenges by streamlining the entire data flow. The business benefits are substantial, they:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduce processing time;&lt;/li&gt;
&lt;li&gt;Eliminate of human error in transfers;&lt;/li&gt;
&lt;li&gt;Produce consistent application of data transformations;&lt;/li&gt;
&lt;li&gt;Improve monitoring capabilities;&lt;/li&gt;
&lt;li&gt;Better data availability for analytics teams.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This integration is particularly valuable for any organization that regularly receives data via SFTP but needs that information in a modern data warehouse to power analytics, reporting, and business intelligence. By creating a reliable pipeline between these systems, companies can focus less on data logistics and more on extracting valuable insights that drive business decisions. Let’s get started building an integration pipeline in Mage Pro.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step by step implementation guide
&lt;/h2&gt;

&lt;p&gt;To begin, you'll want to log into your Mage Pro account, and once logged in, you'll land on the homepage. On the homepage, look for the navigation menu. Hover over it, and you’ll see several options. Your next step is to find the button labeled "Pipelines." Click on it to be directed to the pipelines page where all your data integration workflows are managed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftugq4pl2udwnaukoqm4a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftugq4pl2udwnaukoqm4a.png" alt="Image description" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Creating a new pipeline
&lt;/h2&gt;

&lt;p&gt;Once you are on the pipelines page, it’s time to create a new pipeline. Click on the green "New pipeline" button. You will be prompted to choose how you want to start your pipeline configuration. For this tutorial, select the option to "Start from Scratch."&lt;/p&gt;

&lt;p&gt;Next, choose "Data Integration" as the type of pipeline you want to create. Name your pipeline something descriptive to easily identify it later. After naming it, hit the "Create new pipeline" button to proceed.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92zhv7ogbh5qpo0fm1m9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92zhv7ogbh5qpo0fm1m9.png" alt="Image description" width="800" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Configuring the SFTP connection
&lt;/h2&gt;

&lt;p&gt;After creating your pipeline, you will enter the pipeline editor. Here, you’ll need to set up the SFTP connection. Click into the Select source dropdown and then scroll down the list until you see SFTP and click on it&lt;/p&gt;

&lt;p&gt;This action will populate a YAML configuration file in the editor. You’ll need to fill in the necessary details for the SFTP connection, including the host, port, username, and password. Additionally, specify the table name to pull data, and set the folder prefix to "export" including any subfolder specifications if necessary.&lt;/p&gt;

&lt;p&gt;Once you've entered the connection details, it's crucial to test the SFTP connection to ensure everything is set up correctly. Look for the "Test Connection" button and click it. If everything is configured properly, you should receive a positive confirmation of the connection.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo4li3boyv7vnk8vo25kv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo4li3boyv7vnk8vo25kv.png" alt="Image description" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Selecting data streams
&lt;/h2&gt;

&lt;p&gt;With a successful connection established, it's time to select the data streams you want to synchronize. Mage will display available streams from your SFTP source. Look for the stream corresponding to "fetch golf player data" and check the box next to it to confirm your selection.&lt;/p&gt;

&lt;p&gt;After confirming the stream, allow a moment for Mage to load all column data associated with the selected stream. This data will include metadata and actual CSV content, which is essential for setting up your data integration.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc03wmmnqjd7hvq1rgfj1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc03wmmnqjd7hvq1rgfj1.png" alt="Image description" width="800" height="1499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Configuring data replication methods
&lt;/h2&gt;

&lt;p&gt;Now that your data stream is selected, you can configure how you want to replicate this data into Google BigQuery. You have two primary options: loading a full table or incrementally loading new data. For this example, we will choose the "Full Table" option, as we are working with a single file.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flsvzbc1rpvdsv85elmok.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flsvzbc1rpvdsv85elmok.png" alt="Image description" width="800" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Additionally, you can set unique conflict methods that dictate how Mage should handle records with duplicate values. You may choose to update existing records or ignore them. It’s essential to determine this based on your data requirements.&lt;/p&gt;

&lt;p&gt;Moreover, you can provide bookmarks to track sync processing, which is particularly useful for incremental loading. Finally, you may define a key property to create a primary key for your destination table if required.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9mb8bh2vmlslww62v2lb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9mb8bh2vmlslww62v2lb.png" alt="Image description" width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Transforming data
&lt;/h2&gt;

&lt;p&gt;Transforming data may be necessary to meet specific analytics requirements. In Mage, you can access the transformation settings through the "Transformer" button. This feature allows you to apply various transformations to your data before it’s sent to Google BigQuery. Define any transformations needed, such as data calculations, aggregations, or filtering.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Setting up Google BigQuery as destination
&lt;/h2&gt;

&lt;p&gt;Next, we need to configure Google BigQuery as the destination for your data. In the pipeline editor, select BigQuery from the destination options. This action will generate another YAML configuration file.&lt;/p&gt;

&lt;p&gt;Within this configuration, you will need to provide the path to your credentials file. This file is crucial as it authenticates your access to Google BigQuery. You can download the credentials in JSON format from your Google Cloud Platform account.&lt;/p&gt;

&lt;p&gt;Additionally, specify your project ID and dataset name. For example, if your dataset is called "golf rankings," enter that in the configuration. Ensure that your location settings are correct, typically set to "US" for the United States.&lt;/p&gt;

&lt;p&gt;With your destination configured, it’s time to test the data sync connection. Click the "Test Connection" button. A successful test indicates that your pipeline can communicate with Google BigQuery effectively.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzapz65al9uq4z0ks6xbo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzapz65al9uq4z0ks6xbo.png" alt="Image description" width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Triggering the data sync
&lt;/h2&gt;

&lt;p&gt;Once your data integration pipeline is fully configured and tested, it’s time to trigger the data sync. Navigate to the "Triggers" section in the left-hand menu. Here, you can create a new trigger or run an existing one.&lt;/p&gt;

&lt;p&gt;For this demonstration, simply select the "Run One" trigger. This will initiate the data transfer process from your SFTP server to Google BigQuery. During this process, you can monitor the run's progress, and Mage provides detailed logging to help diagnose any potential issues.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftahlaqnchnb348yjclb1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftahlaqnchnb348yjclb1.png" alt="Image description" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 8: Verifying data synced to Google BigQuery
&lt;/h2&gt;

&lt;p&gt;After the sync process completes, it’s important to verify that the data has been correctly loaded into Google BigQuery. Refresh your BigQuery console and navigate to the designated dataset, such as "golf rankings." You should see a new table, in this dataset where you can run a new query. Simply run a Count (*) query on the new table to ensure the expected data synced to BigQuery. This query will return the number of records imported, confirming that your data transfer was successful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this guide, we have covered the entire process of automating data integration from an SFTP server to Google BigQuery using Mage. From setting up your SFTP connection to verifying the data in BigQuery, each step is crucial for creating a reliable data pipeline.&lt;/p&gt;

&lt;p&gt;By following these steps, you've created a scalable and efficient workflow that ensures only new or updated records are processed, saving you both time and resources. With your data now integrated, you can focus on analyzing it to gain insights that drive your business forward.&lt;/p&gt;

&lt;p&gt;Looking to try out Mage Pro? Book your &lt;a href="https://www.mage.ai/getdemo" rel="noopener noreferrer"&gt;demo&lt;/a&gt; today!&lt;/p&gt;

</description>
      <category>dataengineering</category>
      <category>dataintegration</category>
      <category>bigquery</category>
      <category>mageai</category>
    </item>
    <item>
      <title>We're back and better than ever!</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Fri, 07 Mar 2025 19:29:01 +0000</pubDate>
      <link>https://forem.com/mage_ai/were-back-and-better-than-ever-32j0</link>
      <guid>https://forem.com/mage_ai/were-back-and-better-than-ever-32j0</guid>
      <description>&lt;p&gt;We've been quiet, but we've been busy. We've recently launched Mage Pro, our new managed service and data platform for data engineers!&lt;/p&gt;

&lt;h2&gt;
  
  
  What's new in Mage Pro?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Build, deploy, and run data pipelines in minutes&lt;/li&gt;
&lt;li&gt;Scale instantly to handle any data volume&lt;/li&gt;
&lt;li&gt;New deployment regions: US East and Australia&lt;/li&gt;
&lt;li&gt;AI assistant for quick answers and troubleshooting&lt;/li&gt;
&lt;li&gt;Improved version control and file comparison&lt;/li&gt;
&lt;li&gt;VS Code integration for seamless development&lt;/li&gt;
&lt;li&gt;Enhanced search and filtering for pipeline runs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Our open source project is still active. We've added:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Custom Python source for streaming pipelines&lt;/li&gt;
&lt;li&gt;OracleDB exporter for batch pipelines&lt;/li&gt;
&lt;li&gt;Customizable server logging templates&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why choose Mage Pro?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create complex workflows easily&lt;/li&gt;
&lt;li&gt;Combine multiple data sources&lt;/li&gt;
&lt;li&gt;Transform data using Python, R, or SQL&lt;/li&gt;
&lt;li&gt;Deliver results when and where needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mage Pro offers over 100 API endpoints and granular security settings. You can tailor it to your needs.&lt;/p&gt;

&lt;p&gt;Ready to upgrade your data engineering? Try Mage Pro today: &lt;a href="https://www.mage.ai/pro" rel="noopener noreferrer"&gt;https://www.mage.ai/pro&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recent updates: &lt;a href="https://www.mage.ai/updates" rel="noopener noreferrer"&gt;https://www.mage.ai/updates&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Demo: &lt;a href="https://www.mage.ai/getdemo" rel="noopener noreferrer"&gt;https://www.mage.ai/getdemo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What will you build with Mage Pro?&lt;/p&gt;

</description>
      <category>mageai</category>
      <category>ai</category>
      <category>datapipelines</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Understanding DBT (Data Build Tool): An Introduction</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Tue, 29 Aug 2023 05:39:29 +0000</pubDate>
      <link>https://forem.com/mage_ai/understanding-dbt-data-build-tool-an-introduction-1e43</link>
      <guid>https://forem.com/mage_ai/understanding-dbt-data-build-tool-an-introduction-1e43</guid>
      <description>&lt;p&gt;&lt;em&gt;Guest blog by Shashank Mishra, Data Engineer @ Expedia&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;DBT (Data Build Tool) is an open-source software tool that enables data analysts and engineers to transform and model data in the data warehouse. It simplifies the ETL process by focusing on the ‘T’ — transformation — and integrates seamlessly with modern cloud-based data platforms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Overview of DBT&lt;/li&gt;
&lt;li&gt;Core principles of DBT&lt;/li&gt;
&lt;li&gt;DBT architecture&lt;/li&gt;
&lt;li&gt;Challenges with DBT&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Overview of DBT
&lt;/h2&gt;

&lt;p&gt;DBT (Data Build Tool) is an open-source tool that has revolutionized the way data analysts and engineers view and handle data transformation and modeling in the modern data stack. Here’s an overview of DBT:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Philosophy:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Focuses on the ELT (Extract, Load, Transform) approach, leveraging modern cloud data warehouses.
&lt;strong&gt;Core Components:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Models: SQL queries that define data transformations.&lt;/li&gt;
&lt;li&gt;Tests: Ensure data quality by validating models.&lt;/li&gt;
&lt;li&gt;Snapshots: Track historical changes in data.&lt;/li&gt;
&lt;li&gt;Documentation: Auto-generates documentation for clarity on data processes.
&lt;strong&gt;Development Workflow:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Developer-centric with version control (typically Git), branching, and pull requests.
&lt;strong&gt;Execution:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Compiles models into SQL and runs them directly on data warehouses like Snowflake, BigQuery, and Redshift.
&lt;strong&gt;Adapters:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Makes DBT versatile by connecting to various databases and data platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsdrr06f0olpbthyds0lk.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsdrr06f0olpbthyds0lk.gif" alt="Image description" width="480" height="360"&gt;&lt;/a&gt; (Source: &lt;a href="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExbjhodWpxMXYxOWIzNGN6cnFvdWZkanFrZG1jMXhud3VzNmF1NnZmYyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/nxC1YCvGlsLDVGZ2Vt/giphy.gif" rel="noopener noreferrer"&gt;Giphy&lt;/a&gt;)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Core principles of DBT
&lt;/h2&gt;

&lt;p&gt;DBT (Data Build Tool) operates on a set of core principles that guide its philosophy and approach to data transformation and modeling:&lt;br&gt;
&lt;strong&gt;Data Warehouse-Centric:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Raw data is ingested into the data warehouse, using its computational capabilities for in-database transformations. This principle capitalizes on modern warehouses like Snowflake, BigQuery, or Redshift for heavy computations.
&lt;strong&gt;ELT Workflow:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Instead of pre-transforming data (ETL), DBT supports ELT, where raw data is loaded into the data warehouse (Extract, Load) and then transformed using SQL-based models (Transform).
&lt;strong&gt;SQL as the DSL:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;DBT uses SQL as its domain-specific language. This eliminates the need for proprietary transformation languages or GUI-based ETL tools, providing direct and transparent transformation logic.
&lt;strong&gt;Git-based Version Control:&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;DBT projects are typically version-controlled using Git, allowing for branch-based development, commit histories, and collaboration through pull requests.
Model Dependencies:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Models, written in SQL, can reference other models (ref() function). This creates a DAG (Directed Acyclic Graph) of dependencies, which DBT uses to run models in the correct order.&lt;br&gt;
Data Testing:&lt;/p&gt;

&lt;p&gt;DBT’s schema tests (e.g., unique, not_null, accepted_values) validate the integrity of the transformed data. Custom data tests can also be written in SQL to enforce specific business rules or constraints.&lt;br&gt;
Jinja Templating:&lt;/p&gt;

&lt;p&gt;DBT uses the Jinja2 templating engine. This allows for dynamic SQL code generation, loops, conditional logic, and macro creation for reusable SQL snippets.&lt;br&gt;
CLI and API Integration:&lt;/p&gt;

&lt;p&gt;DBT’s command-line interface (CLI) supports operations like run, test, and docs generate. It can also be integrated with CI/CD tools and other platforms through APIs.&lt;br&gt;
Configurations &amp;amp; Hooks:&lt;/p&gt;

&lt;p&gt;Technical configurations can be set at the project, model, or global level (dbt_project.yml). Pre- and post-hooks allow for operations (like data quality checks or audit trails) to be executed before or after a model runs.&lt;br&gt;
Extensibility with Adapters:&lt;/p&gt;

&lt;p&gt;DBT’s architecture allows for custom adapters. While it comes with adapters for popular data platforms, the community or organizations can develop adapters for other platforms, ensuring wide compatibility.&lt;br&gt;
By emphasizing these technical principles and functionalities, DBT provides a powerful and flexible framework for data engineers and analysts to manage data transformations with precision and efficiency.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8x0dnlz0mfj345afxvgc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8x0dnlz0mfj345afxvgc.gif" alt="Image description" width="480" height="480"&gt;&lt;/a&gt; (Source: &lt;a href="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExazc3bW0zb3lkamNtNDQ5ZngyM2poaXYweThncDIzbHB6Z3p1Z3B6YSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/5z0cCCGooBQUtejM4v/giphy.gif" rel="noopener noreferrer"&gt;Giphy&lt;/a&gt;)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  DBT architecture
&lt;/h2&gt;

&lt;p&gt;DBT (Data Build Tool) employs a unique architecture that sets it apart from traditional ETL tools and frameworks. At its core, DBT is a command-line tool that uses SQL and Jinja2 templating to transform and model data. Let’s break down its architecture:&lt;/p&gt;

&lt;p&gt;Command-Line Interface (CLI):&lt;/p&gt;

&lt;p&gt;Central Control: DBT is primarily operated through its command-line interface, allowing users to run commands for transformations (dbt run), testing (dbt test), and documentation generation (dbt docs generate).&lt;br&gt;
SQL + Jinja2 Templating:&lt;/p&gt;

&lt;p&gt;Dynamic SQL Generation: By combining SQL with the Jinja2 templating engine, DBT allows for dynamic SQL code generation. This lets users incorporate loops, conditional logic, and macros into their transformation logic.&lt;br&gt;
Projects and Configuration:&lt;/p&gt;

&lt;p&gt;DBT Project: The foundational unit in DBT. It contains models, tests, snapshots, macros, and the essential dbt_project.yml configuration file.&lt;br&gt;
Configuration Files: These YAML files (dbt_project.yml, profiles.yml, etc.) define project details, model configurations, and database connections.&lt;br&gt;
Models &amp;amp; Directed Acyclic Graph (DAG):&lt;/p&gt;

&lt;p&gt;Models: SQL files that represent the transformation logic.&lt;br&gt;
DAG: DBT builds a DAG of model dependencies using the ref() function in models. The DAG determines the execution order when running transformations.&lt;br&gt;
Adapters:&lt;/p&gt;

&lt;p&gt;Database Compatibility: DBT uses adapters to connect and interface with different data platforms, like Snowflake, BigQuery, and Redshift. Adapters translate DBT’s generic SQL into database-specific SQL.&lt;br&gt;
Testing Framework:&lt;/p&gt;

&lt;p&gt;Built-in &amp;amp; Custom Tests: DBT supports both built-in tests (like unique or not_null) and custom tests defined in SQL, ensuring data quality and conformity to business rules.&lt;br&gt;
Version Control Integration:&lt;/p&gt;

&lt;p&gt;Git Integration: DBT projects are typically stored in Git repositories, enabling collaboration, versioning, and branching.&lt;br&gt;
Documentation:&lt;/p&gt;

&lt;p&gt;Auto-generation: DBT automatically generates a web-based documentation portal that visualizes model metadata, lineage, and descriptions.&lt;br&gt;
Plugins and Extensibility:&lt;/p&gt;

&lt;p&gt;Community Plugins: DBT’s architecture allows for extensions, and the community has contributed various plugins, adding functionality and compatibility with other tools.&lt;br&gt;
Runtime Environment:&lt;/p&gt;

&lt;p&gt;In-database Computation: Unlike ETL tools that may have their own computation engines, DBT compiles and runs SQL directly in the target data warehouse, leveraging its computational power for transformations.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fijdw07n83z0rxp2moy3h.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fijdw07n83z0rxp2moy3h.gif" alt="Image description" width="480" height="274"&gt;&lt;/a&gt; (Source: &lt;a href="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExMGRyMzVmdDkzNm5hcm05Z2p1am53cmwxOWZ3ZzczaDZ3cXEzODFxNiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/em4i0bDs9Hm2Q/giphy.gif" rel="noopener noreferrer"&gt;Giphy&lt;/a&gt;)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges with DBT
&lt;/h2&gt;

&lt;p&gt;While DBT (Data Build Tool) has gained substantial popularity due to its approach to data transformation, it is not without its technical challenges, especially when viewed in the context of the broader data pipeline design:&lt;/p&gt;

&lt;p&gt;Initial Data Ingestion:&lt;/p&gt;

&lt;p&gt;DBT focuses mainly on the transformation (T) part of the ELT process. The extraction (E) and load (L) phases are out of its scope, requiring other tools or manual setups to ingest data into the data warehouse.&lt;br&gt;
Complex Dependency Management:&lt;/p&gt;

&lt;p&gt;As DBT projects grow, managing model dependencies (DAG) can become complex. Ensuring models run in the right order without causing circular dependencies is crucial and can be challenging in large projects.&lt;br&gt;
Performance Considerations:&lt;/p&gt;

&lt;p&gt;Relying on the computational power of the data warehouse for transformations can lead to increased costs, especially if not optimized.&lt;br&gt;
Some transformations might be less efficient in SQL compared to other data processing languages or tools.&lt;br&gt;
Concurrency and Parallelism:&lt;/p&gt;

&lt;p&gt;Handling concurrent DBT runs or ensuring that parallel transformations don’t interfere with each other can be challenging. There’s a need to fine-tune data warehouse configurations and manage resource contention.&lt;br&gt;
Incremental Processing:&lt;/p&gt;

&lt;p&gt;While DBT supports incremental models, designing them effectively requires careful consideration to ensure data integrity and avoid data duplication.&lt;br&gt;
Real-time Data Processing:&lt;/p&gt;

&lt;p&gt;DBT is batch-oriented by design. Real-time or near-real-time data processing pipelines might need additional tools or configurations outside of DBT’s standard capabilities.&lt;br&gt;
Integration with External Tools:&lt;/p&gt;

&lt;p&gt;DBT’s ecosystem is primarily SQL-focused. Integrating with non-SQL tools or platforms might require additional effort or custom plugins.&lt;br&gt;
Operational Monitoring and Alerting:&lt;/p&gt;

&lt;p&gt;Out-of-the-box, DBT does not provide comprehensive monitoring or alerting mechanisms for transformations. Integration with monitoring tools or building custom alert systems might be necessary.&lt;br&gt;
Error Handling:&lt;/p&gt;

&lt;p&gt;Granular error handling, especially for non-fatal issues, can be complex. DBT will fail a run if a model encounters an error, requiring manual intervention or a robust orchestration tool to manage failures.&lt;br&gt;
Security and Compliance:&lt;/p&gt;

&lt;p&gt;Ensuring that DBT processes adhere to data governance, security, and compliance requirements might necessitate additional configurations, especially when working with sensitive data.&lt;br&gt;
Scalability:&lt;/p&gt;

&lt;p&gt;As data volume grows, some DBT models might need refactoring or optimization to maintain performance. This requires ongoing maintenance and tuning.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flm3yzlagmwvi3u0ghgq9.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flm3yzlagmwvi3u0ghgq9.gif" alt="Image description" width="400" height="400"&gt;&lt;/a&gt; (Source: &lt;a href="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcmp3NW9iZzh1OHBqbHBqeTQxcHVycXpuZ2p4NHlkcDM2M2ptdTEzcyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/pqcWLv9btMBin5T92o/giphy.gif" rel="noopener noreferrer"&gt;Giphy&lt;/a&gt;)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In the ever-evolving landscape of data processing and analytics, DBT emerges as a powerful tool that merges software engineering best practices with data operations. Its ELT-centric approach, modular design, and emphasis on code and collaboration make it an attractive solution for modern data teams.&lt;/p&gt;

&lt;p&gt;Yet, like any tool, it is not without its challenges. Factors like dependency management, real-time processing, and scalability require thoughtful consideration in the broader context of data pipeline design.&lt;/p&gt;

&lt;p&gt;With proper planning and awareness of its intricacies, DBT can be a pivotal element in a data team’s toolkit, driving efficiency, transparency, and reliability in data transformations. As with all tools, a balance of its strengths against its challenges is essential in leveraging its full potential effectively.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Link to the original blog: &lt;a href="https://www.mage.ai/blog/understanding-dbt-data-build-tool-an-introduction" rel="noopener noreferrer"&gt;https://www.mage.ai/blog/understanding-dbt-data-build-tool-an-introduction&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Data Integration: Google BigQuery with Mage</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Fri, 21 Jul 2023 19:01:33 +0000</pubDate>
      <link>https://forem.com/mage_ai/data-integration-google-bigquery-with-mage-461p</link>
      <guid>https://forem.com/mage_ai/data-integration-google-bigquery-with-mage-461p</guid>
      <description>&lt;p&gt;Guest blog by &lt;a href="https://www.linkedin.com/in/shashank219/" rel="noopener noreferrer"&gt;Shashank Mishra&lt;/a&gt;, Data Engineer @ &lt;em&gt;Expedia&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;This article outlines the integration between &lt;a href="https://www.mage.ai" rel="noopener noreferrer"&gt;Mage&lt;/a&gt; and &lt;a href="https://cloud.google.com/bigquery" rel="noopener noreferrer"&gt;Google BigQuery&lt;/a&gt;, a serverless data warehousing service. We’ll discuss the integration process, its benefits, and how it aids businesses in making data-driven decisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction to Mage&lt;/li&gt;
&lt;li&gt;Overview of Google BigQuery&lt;/li&gt;
&lt;li&gt;Step by step process to integrate Google BigQuery with Mage&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction to Mage
&lt;/h2&gt;

&lt;p&gt;In an age where data is the new oil, efficient and reliable data management tools are essential. &lt;a href="https://www.mage.ai/github" rel="noopener noreferrer"&gt;Mage&lt;/a&gt; is a platform committed to simplifying data integration and analytics. Designed for seamless data transformation and loading, Mage is transforming how businesses approach data management. Here are its key features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Automated Data Pipeline:&lt;/em&gt; Mage automates data extraction, transformation, and loading (ETL) processes. It can extract data from multiple sources, transform it to a desirable format, and load it into a data warehouse.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Connectors:&lt;/em&gt; Mage offers various data connectors to widely-used data sources like Shopify, Facebook Ads, Google Ads, Google Analytics, etc. This makes it easier to import data from these platforms.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Easy Integration:&lt;/em&gt; Mage provides easy integration with popular data warehouses including Google BigQuery, Amazon Redshift, and Snowflake.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Pre-built SQL Models:&lt;/em&gt; Mage comes with pre-built SQL models for popular e-commerce platforms like Shopify and WooCommerce. These models simplify the process of data analysis.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Incremental Loading:&lt;/em&gt; Mage supports incremental loading, which means only new or updated data is loaded into the data warehouse. This saves storage space and improves efficiency.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Transformations:&lt;/em&gt; Mage performs automatic data transformations, converting raw data into a more usable format. This process makes the data ready for analysis and reporting.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Scheduled Refresh:&lt;/em&gt; Data refreshes can be scheduled in Mage, ensuring that the data in the warehouse is always up-to-date.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Security:&lt;/em&gt; Mage places a high emphasis on data security, ensuring data privacy and compliance with GDPR and other data protection regulations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2zcjvhdhi10cvjtp9gl.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2zcjvhdhi10cvjtp9gl.gif" alt="Image description" width="480" height="263"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview of Google BigQuery
&lt;/h2&gt;

&lt;p&gt;Google BigQuery is a highly scalable, serverless data warehouse offered by Google as part of its Google Cloud Platform (GCP). It is designed to streamline and simplify the processing of big data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Serverless Architecture:&lt;/em&gt; BigQuery operates on a serverless model, which means users don’t need to manage any servers or infrastructure. This means you can focus more on analysis and less on maintenance. It allows you to query massive datasets in seconds and get insights in real-time, without needing to worry about resource provision.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Real-Time Analytics:&lt;/em&gt; BigQuery is engineered for real-time analytics. It allows users to analyze real-time data streams instantly. With its ability to run SQL queries on petabytes of data, it delivers speedy results on real-time data analytics, enabling businesses to make timely decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google BigQuery, with its serverless architecture and real-time analytics, serves as a robust platform to handle, analyze, and draw insights from massive datasets with ease.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptiv6r03koy4n1uu1nvu.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptiv6r03koy4n1uu1nvu.gif" alt="Image description" width="480" height="270"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step by step process to migrate Google BigQuery with Mage
&lt;/h2&gt;

&lt;p&gt;Before we begin, we’ll need to create a service account key. Please read &lt;a href="https://cloud.google.com/iam/docs/keys-create-delete" rel="noopener noreferrer"&gt;Google Cloud’s documentation&lt;/a&gt; on how to create that.&lt;/p&gt;

&lt;p&gt;Once we are finished, following these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new pipeline or open an existing pipeline.&lt;/li&gt;
&lt;li&gt;Expand the left side of the screen to view the file browser.&lt;/li&gt;
&lt;li&gt;Scroll down and click on a file named &lt;strong&gt;io_config.yaml&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Enter the following keys and values under the key named default (we can have multiple profiles, add it under whichever is relevant for us)&lt;/li&gt;
&lt;li&gt;Note: we only need to add the keys under &lt;strong&gt;GOOGLE_SERVICE_ACC_KEY&lt;/strong&gt; or the value for key &lt;strong&gt;GOOGLE_SERVICE_ACC_KEY_FILEPATH&lt;/strong&gt; (both are not simultaneously required).
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version: 0.1.1
default:
  GOOGLE_SERVICE_ACC_KEY:
    type: service_account
    project_id: project-id
    private_key_id: key-id
    private_key:
      "-----BEGIN PRIVATE KEY-----\nyour_private_key\n-----END_PRIVATE_KEY"
    client_email: your_service_account_email
    auth_uri: "https://accounts.google.com/o/oauth2/auth"
    token_uri: "https://accounts.google.com/o/oauth2/token"
    auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs"
    client_x509_cert_url: 
"https://www.googleapis.com/robot/v1/metadata/x509/your_service_account_email"
  GOOGLE_SERVICE_ACC_KEY_FILEPATH: "/path/to/your/service/account/key.json"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Using SQL block&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new pipeline or open an existing pipeline.&lt;/li&gt;
&lt;li&gt;Add a data loader, transformer, or data exporter block.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;SQL&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under the &lt;strong&gt;Data provider&lt;/strong&gt; dropdown, select &lt;strong&gt;BigQuery&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Under the &lt;strong&gt;Profile&lt;/strong&gt; dropdown, select &lt;strong&gt;default&lt;/strong&gt; (or the profile we added credentials underneath).&lt;/li&gt;
&lt;li&gt;Next to the &lt;strong&gt;Database&lt;/strong&gt; label, enter the database name we want this block to save data to.&lt;/li&gt;
&lt;li&gt;Next to the &lt;strong&gt;Save to schema&lt;/strong&gt; label, enter the schema name we want this block to save data to.&lt;/li&gt;
&lt;li&gt;Under the &lt;strong&gt;Write policy&lt;/strong&gt; dropdown, select &lt;strong&gt;Replace&lt;/strong&gt; or &lt;strong&gt;Append&lt;/strong&gt; (please see &lt;a href="https://docs.mage.ai/guides/sql-blocks" rel="noopener noreferrer"&gt;SQL blocks guide&lt;/a&gt; for more information on write policies).&lt;/li&gt;
&lt;li&gt;Enter in this test query: &lt;strong&gt;SELECT 1&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Run the block.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Using Python block&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new pipeline or open an existing pipeline.&lt;/li&gt;
&lt;li&gt;Add a data loader, transformer, or data exporter block (the code snippet below is for a data loader).&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Generic&lt;/strong&gt; (no template).&lt;/li&gt;
&lt;li&gt;Enter this code snippet (note: change the &lt;strong&gt;config_profile&lt;/strong&gt; from default if we have a different profile):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from mage_ai.data_preparation.repo_manager import get_repo_path
from mage_ai.io.bigquery import BigQuery
from mage_ai.io.config import ConfigFileLoader
from os import path
from pandas import DataFrame
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if 'data_loader' not in globals():
    from mage_ai.data_preparation.decorators import data_loader
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@data_loader
def load_data_from_big_query(**kwargs) -&amp;gt; DataFrame:
    query = 'SELECT 1'
    config_path = path.join(get_repo_path(), 'io_config.yaml')
    config_profile = 'default'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    return BigQuery.with_config(ConfigFileLoader(config_path, config_profile)).load(query)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run the block.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94ijcmqoiwtlxyyntduw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94ijcmqoiwtlxyyntduw.gif" alt="Image description" width="480" height="480"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Integrating Mage with Google BigQuery provides your team with a potent combination of automated data pipeline management and robust data warehousing. This partnership not only simplifies data extraction, transformation, and loading but also provides a seamless pathway for data analysis and insight generation. As we’ve demonstrated in this step-by-step guide, the integration process is straightforward, making it an accessible option for businesses of all sizes. By leveraging this integration, you can unlock the full potential of your data, streamline operations, and drive data-informed decisions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Link to the original blog: &lt;a href="https://www.mage.ai/blog/data-integration-google-bigquery-with-mage" rel="noopener noreferrer"&gt;https://www.mage.ai/blog/data-integration-google-bigquery-with-mage&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Google BigQuery: Serverless data warehousing made simple</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Fri, 21 Jul 2023 18:44:08 +0000</pubDate>
      <link>https://forem.com/mage_ai/google-bigquery-serverless-data-warehousing-made-simple-3em9</link>
      <guid>https://forem.com/mage_ai/google-bigquery-serverless-data-warehousing-made-simple-3em9</guid>
      <description>&lt;p&gt;&lt;em&gt;Guest blog by &lt;a href="https://www.linkedin.com/in/shashank219/" rel="noopener noreferrer"&gt;Shashank Mishra&lt;/a&gt;, Data Engineer @ Expedia&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/bigquery" rel="noopener noreferrer"&gt;Google BigQuery&lt;/a&gt; is a serverless, scalable data warehouse on Google Cloud. It supports real-time analytics, machine learning, and GIS capabilities. With its unique architecture separating storage and computing, it offers automatic scalability and strong security, ideal for data-driven businesses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction to Google BigQuery&lt;/li&gt;
&lt;li&gt;Key features of Google BigQuery&lt;/li&gt;
&lt;li&gt;BigQuery’s Unique Architecture&lt;/li&gt;
&lt;li&gt;Benefits of Using BigQuery&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction to Google BigQuery
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/bigquery" rel="noopener noreferrer"&gt;Google BigQuery&lt;/a&gt; is a highly scalable, serverless data warehouse offered by Google as part of its Google Cloud Platform (GCP). It is designed to streamline and simplify the processing of big data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Serverless Architecture:&lt;/em&gt; BigQuery operates on a serverless model, which means users don’t need to manage any infrastructure or do any server management. This helps in focusing more on data analysis rather than worrying about capacity planning or server management. It allows you to query massive datasets in seconds and get insights in real-time, without needing to worry about resource provision.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Real-Time Analytics:&lt;/em&gt; BigQuery is engineered for real-time analytics. It allows users to analyze real-time data streams instantly. With its ability to run SQL queries on gigabytes to petabytes of data, it delivers speedy results on real-time data analytics, enabling businesses to make timely decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In summary, Google BigQuery, with its serverless architecture and real-time analytics, serves as a robust platform to handle, analyze, and draw insights from massive datasets with ease.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqng98sdss78ja2pkwf5.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqng98sdss78ja2pkwf5.gif" alt="Image description" width="480" height="358"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key features of Google BigQuery
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/bigquery" rel="noopener noreferrer"&gt;Google BigQuery&lt;/a&gt; offers a robust set of features that make it an ideal choice for businesses looking to leverage data for actionable insights. These features extend from machine learning capabilities and geospatial analytics to multi-cloud data analysis and automated data transfer services. These cutting-edge functionalities position BigQuery as a powerful tool in the data analytics landscape. Let’s dive into some of these key features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Machine Learning Integration: Google BigQuery provides built-in machine learning capabilities, enabling data scientists to create and execute machine learning models on structured and semi-structured data directly inside BigQuery using SQL. This ML integration allows users to build models with the ease of SQL commands, eliminating the need to move data across different environments or learn a new language.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GIS Capabilities: BigQuery GIS, or Geo Viz, allows analysts to manage and analyze geospatial data in BigQuery by providing SQL geographic functions. These functions make it easier to understand spatial relationships and provide insights about geographic-based data that are critical for businesses, like determining delivery routes, analyzing service coverage areas, and much more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;BI Engine: BigQuery BI Engine is a fast, in-memory analysis service that allows users to analyze data stored in BigQuery with sub-second query response time and high concurrency. Integrated with popular tools like Google Data Studio, it enables analysts and data scientists to create interactive dashboards and reports without any performance latency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;BigQuery Omni: BigQuery Omni is a multi-cloud data analytics solution that allows users to execute BigQuery’s powerful analytics capabilities on data stored not just in Google Cloud, but also AWS and Azure. This means you can break down data silos and gain insights across different cloud platforms without having to move or copy data, enabling a truly multi-cloud data analytics approach.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;BigQuery Data Transfer Service: The BigQuery Data Transfer Service automates data movement from SaaS applications to Google BigQuery on a scheduled, managed basis. This allows businesses to maintain an updated data warehouse without the hassle of writing custom scripts or manually importing data, simplifying data ingestion and ensuring that data is readily available for analysis.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In essence, Google BigQuery provides a comprehensive suite of tools and capabilities that not only simplify data warehousing tasks but also empower businesses to draw actionable insights from their data.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsit28pw8umvb5m9r3ev.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsit28pw8umvb5m9r3ev.gif" alt="Image description" width="480" height="270"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Google BigQuery’s unique architecture
&lt;/h2&gt;

&lt;p&gt;At its core, Google BigQuery’s architecture is a manifestation of Google’s Dremel technology. Dremel is a highly scalable, interactive ad-hoc query system for the analysis of read-only nested data, and BigQuery utilizes this technology to execute SQL-like queries over multi-terabyte datasets in seconds.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Dremel-Inspired Architecture:&lt;/em&gt; BigQuery’s Dremel-inspired architecture allows it to deliver incredibly fast analytics on a petabyte scale. By creating a tree architecture for dispatching queries and aggregating results, Dremel enables BigQuery to scan trillions of rows in seconds and return results in a blink. This architecture uses a combination of columnar storage for data organization and tree architecture for query execution, allowing BigQuery to run SQL queries on large datasets swiftly.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Separation of Compute and Storage:&lt;/em&gt; A fundamental design principle of BigQuery is the decoupling of compute and storage. The data you store in BigQuery is kept in a multi-tenant distributed architecture, separated from the computational resources. This separation allows for nearly infinite scalability: as your data grows, BigQuery scales to meet your storage needs without any intervention, and you can ramp up query computing power as needed without being limited by your data size.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Compute Resources:&lt;/em&gt; When you run a query, BigQuery dynamically allocates computing resources as needed. This serverless model means that you don’t have to worry about pre-provisioning compute capacity, and you only pay for the queries you run.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Storage Layer:&lt;/em&gt; On the storage side, BigQuery automatically replicates data for durability and high availability. It also handles all ongoing maintenance, including patches and upgrades. Data in BigQuery is stored in Capacitor, Google’s next-generation columnar storage format, which is highly compressed and optimized for reading large amounts of structured data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google BigQuery’s unique architecture, inspired by Dremel, and its separation of compute and storage lead to high-speed query performance, automatic scalability, and strong data security, thereby making it an efficient data warehouse solution for businesses of all sizes.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F67p8cudccdx018m5tpkr.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F67p8cudccdx018m5tpkr.gif" alt="Image description" width="400" height="400"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of using Google BigQuery
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/bigquery" rel="noopener noreferrer"&gt;Google BigQuery&lt;/a&gt; provides a number of benefits that make it a compelling choice for businesses of all sizes, from startups to large enterprises, who are looking to derive insights from their data. These benefits stem from BigQuery’s serverless architecture, automatic scalability, strong security features, and other business benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Serverless Data Warehousing:&lt;/em&gt; As a serverless solution, BigQuery eliminates the need for businesses to manage, administer, or tune any infrastructure, saving them time and resources. This allows businesses to focus on what truly matters — deriving insights from their data and using them to make informed business decisions.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Automatic Scalability:&lt;/em&gt; BigQuery scales automatically to accommodate your data and workloads. Its architecture separates storage and computation, enabling each to scale independently. This ensures that the system can handle any volume of data and any number of queries while maintaining high performance.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Strong Security Features:&lt;/em&gt; BigQuery is designed with a robust security model that integrates with other Google Cloud security tools. It offers data encryption at rest and in transit, identity and access management, and a host of other security features that help businesses protect their sensitive data.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Business Benefits:&lt;/em&gt; Beyond the technical features, BigQuery offers tangible business benefits. It provides real-time insights that enable businesses to make timely decisions, improving operational efficiency and enabling new opportunities. It also reduces costs, as businesses only pay for the storage they use and the queries they run, making BigQuery a cost-effective solution for data warehousing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgt7nbflwzqoaa30ghcji.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgt7nbflwzqoaa30ghcji.gif" alt="Image description" width="500" height="281"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, Google BigQuery stands out as a robust, serverless data warehouse in the Google Cloud Platform. Its unique Dremel-inspired architecture supports immense scalability and swift, real-time analytics. With features like machine learning integration, GIS capabilities, and multi-cloud data analytics, it equips businesses to derive critical insights from massive datasets efficiently and securely. BigQuery simplifies data management, providing a potent solution for data-driven decision-making in the ever-evolving digital landscape.&lt;/p&gt;

&lt;p&gt;In episode 4 of Datawarehouse series, we’ll explore how we can integrate Data Warehousing services like Snowflake/Redshift/Google BigQuery with Mage.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Link to the original blog: &lt;a href="https://www.mage.ai/blog/google-bigquery-serverless-data-warehousing-made-simple" rel="noopener noreferrer"&gt;https://www.mage.ai/blog/google-bigquery-serverless-data-warehousing-made-simple&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>dataanalytics</category>
      <category>googlebigquery</category>
      <category>datascience</category>
      <category>cloudcomputing</category>
    </item>
    <item>
      <title>Snowflake: Revolutionizing data warehousing</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Fri, 21 Jul 2023 18:34:25 +0000</pubDate>
      <link>https://forem.com/mage_ai/snowflake-revolutionizing-data-warehousing-1dkm</link>
      <guid>https://forem.com/mage_ai/snowflake-revolutionizing-data-warehousing-1dkm</guid>
      <description>&lt;p&gt;Guest blog by &lt;a href="https://www.linkedin.com/in/shashank219/" rel="noopener noreferrer"&gt;Shashank Mishra&lt;/a&gt;, Data Engineer @ &lt;em&gt;Expedia&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.snowflake.com/en/" rel="noopener noreferrer"&gt;Snowflake&lt;/a&gt;  is a cloud-based data warehousing platform that brings a new level of performance, simplicity, and affordability to businesses that require big data processing and analytics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction to snowflake&lt;/li&gt;
&lt;li&gt;Key features of snowflake&lt;/li&gt;
&lt;li&gt;Snowflake’s unique architecture&lt;/li&gt;
&lt;li&gt;Benefits of using snowflake&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction to snowflake
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.snowflake.com/en/" rel="noopener noreferrer"&gt;Snowflake&lt;/a&gt; is a powerful, cloud-based data warehousing platform known for its unique, flexible architecture. By separating compute and storage resources, it offers scalable, efficient, and cost-effective data management. Snowflake eliminates the complexity of traditional data warehouses, offering a user-friendly, fully-managed solution. It supports various data formats and integrates well with diverse data processing tools and BI software. With robust security measures including encryption and role-based access control, Snowflake ensures data safety. Essentially, it empowers organizations to be data-driven, delivering a powerful and simple-to-use data warehouse solution in the cloud.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz377sl4a58dczuzhc9wr.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz377sl4a58dczuzhc9wr.gif" alt="Image description" width="168" height="168"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key features of snowflake
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.snowflake.com/en/" rel="noopener noreferrer"&gt;Snowflake&lt;/a&gt; is a powerful data warehousing platform that incorporates a broad set of capabilities designed to make data storage, retrieval, and analysis more efficient, flexible, and scalable. Let’s dive into some of the prime features that make Snowflake a standout choice in the realm of cloud data platforms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Elastic Scalability:&lt;/em&gt; Snowflake enables you to scale up or down instantaneously. It can handle any volume of data, the number of users, or the complexity of queries without compromising performance.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Zero Management:&lt;/em&gt; Snowflake is a fully-managed service that requires no management from your end, such as indexing or tuning, and it handles all infrastructure, optimization, availability, data protection, and more.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Multi-Cloud Platform:&lt;/em&gt; Snowflake can run on multiple clouds, including AWS, Google Cloud, and Azure. This cross-cloud capability allows businesses to leverage the advantages of different cloud providers.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Sharing:&lt;/em&gt; Snowflake allows you to share live, ready-to-query data across your organization, with partners, or even with your customers, securely and in real time.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Performance and Speed:&lt;/em&gt; Snowflake’s unique architecture offers excellent query performance and allows for quick data retrieval, empowering businesses with real-time insights.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Security:&lt;/em&gt; Snowflake offers robust security features, including automatic data encryption, network policies, and role-based access control to protect your data.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Support for Structured and Semi-Structured Data:&lt;/em&gt; Snowflake natively supports JSON, Avro, XML, ORC, and Parquet, allowing you to work with various data formats in a flexible and straightforward manner.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Time Travel:&lt;/em&gt; Snowflake’s Time Travel feature enables access to historical data at any point in the past, providing easy data recovery and audit capabilities.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Automatic Concurrency Scaling:&lt;/em&gt; During high demand, Snowflake automatically spins up additional computing resources to ensure consistent, high-speed performance for all users and queries.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;In-Database Machine Learning:&lt;/em&gt; Snowflake supports in-database machine learning, allowing you to train models directly where your data resides, reducing data movement and improving security and efficiency.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuoom162mqp0z2dl08xfm.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuoom162mqp0z2dl08xfm.gif" alt="Image description" width="480" height="270"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Snowflake’s unique architecture&lt;br&gt;
Snowflake’s architecture is a hybrid of traditional shared-disk and shared-nothing architectures with an additional layer of cloud services. This three-tier architecture consists of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Storage Layer:&lt;/strong&gt; The base layer of Snowflake’s architecture is the database storage layer. It manages all aspects of data storage in Snowflake.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Cloud Agnostic Storage:&lt;/em&gt; Snowflake can store an unlimited amount of structured and semi-structured data across multiple cloud platforms. It can run on AWS, Google Cloud, or Azure.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Automatic Organization:&lt;/em&gt; Data is automatically divided into micro-partitions when loaded into Snowflake. These micro-partitions are columnar and compressed for optimal storage and query performance.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Immutable Data:&lt;/em&gt; Once written, data in Snowflake is immutable, which provides the ability to access data at any point in time, a feature known as ‘Time Travel’.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compute Layer:&lt;/strong&gt; The second layer is the compute layer, known as virtual warehouses. This layer is responsible for executing queries on the data.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Elasticity and Separation of Compute and Storage:&lt;/em&gt; Virtual warehouses are independent compute resources that do not share CPU, memory, or storage, enabling them to scale up or down instantaneously based on workload, ensuring optimal performance without any contention.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Multi-cluster Warehouses:&lt;/em&gt; For large concurrent workloads, Snowflake can automatically scale out queries across multiple compute clusters to maintain performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Services Layer:&lt;/strong&gt; The top layer is the cloud services layer. It coordinates and manages all aspects of Snowflake’s functionality.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Security and Access Control:&lt;/em&gt; This layer handles tasks such as user authentication, session management, access control, and encryption.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Metadata Management:&lt;/em&gt; Snowflake automatically maintains detailed metadata about all objects in the system, including data files, table structures, and data statistics.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Query Optimization and Execution:&lt;/em&gt; The cloud services layer optimizes and executes all SQL queries. It compiles SQL statements into low-level code that’s executed on virtual warehouses.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Transactions and ACID Compliance:&lt;/em&gt; Snowflake supports fully ACID-compliant transactions, ensuring data consistency and reliability.
In essence, Snowflake’s unique architecture enables a highly efficient, flexible, and scalable data processing environment, making it a powerful choice for organizations seeking to leverage data for business insights.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj19s0k9uefuqg2zboyw9.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj19s0k9uefuqg2zboyw9.gif" alt="Image description" width="480" height="262"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of using snowflake
&lt;/h2&gt;

&lt;p&gt;Snowflake offers numerous advantages that make it a highly effective solution for data warehousing. These benefits, spanning from operational efficiency to strategic decision-making, are designed to cater to both technical needs and business objectives, providing an edge in today’s data-driven landscape.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Seamless Data Integration:&lt;/em&gt; Snowflake integrates effortlessly with existing data management tools, ETL/ELT solutions, and business intelligence platforms. This allows organizations to continue using their preferred tools while leveraging Snowflake’s powerful data warehousing capabilities.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Multi-Cloud and Cross-Cloud Capabilities:&lt;/em&gt; Snowflake isn’t tied to a single cloud provider. You can use it on AWS, Google Cloud, or Azure, giving you the flexibility to choose your preferred cloud vendor, leverage multi-cloud strategies, or even migrate between them.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Disaster Recovery:&lt;/em&gt; The platform’s ability to replicate data across cloud regions helps in achieving a robust disaster recovery strategy, mitigating the risk of data loss and ensuring business continuity.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Democratizing Data:&lt;/em&gt; Snowflake empowers organizations to democratize their data by making it accessible for stakeholders across the organization. The increased availability of data for business users can drive data-driven decisions at all levels of the organization.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Collaboration and Data Exchanges:&lt;/em&gt; Snowflake data exchange allows organizations to share live data with their business partners, creating collaborative opportunities and enabling more informed decision-making across the business ecosystem.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Reduced Total Cost of Ownership (TCO):&lt;/em&gt; With its fully managed services, Snowflake reduces the need for extensive in-house data management and infrastructure, bringing down the total cost of ownership. The resources saved can be utilized for business-critical operations and innovation.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Resource Optimization:&lt;/em&gt; Snowflake’s separate compute and storage resources allow organizations to optimize resource usage based on their specific needs. This not only enhances performance but also results in cost savings by ensuring resources are not wasted.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Business Agility:&lt;/em&gt; With its robust features, scalability, and ease of use, Snowflake empowers businesses to be more agile. Organizations can rapidly adapt to changes, whether it’s increased demand, new data sources, or evolving business needs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7c2lae0kjx7murg0dkb.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7c2lae0kjx7murg0dkb.gif" alt="Image description" width="480" height="265"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Snowflake is a comprehensive data warehousing solution designed for the cloud era. Its unique architecture and suite of features empower organizations to handle vast amounts of data with ease, speed, and flexibility. From effortless integration with existing tools to unparalleled scalability, and from secure real-time data sharing to cost-effective operations, Snowflake offers a transformative approach to data management. It ensures that businesses of all sizes and industries can leverage data effectively to derive valuable insights, make informed decisions, and ultimately, drive growth and innovation in an increasingly data-centric world. Whether you’re a small business looking to harness the power of data or a large enterprise aiming to optimize your data operations, Snowflake stands as a compelling choice in the realm of cloud data warehousing.&lt;/p&gt;

&lt;p&gt;In episode 3 of data warehouse series, we’ll explore Google BigQuery.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Link to the original blog: &lt;a href="https://www.mage.ai/blog/snowflake-revolutionizing-data-warehousing" rel="noopener noreferrer"&gt;https://www.mage.ai/blog/snowflake-revolutionizing-data-warehousing&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>datawarehouse</category>
      <category>snowflake</category>
      <category>cloudcomputing</category>
      <category>bigdata</category>
    </item>
    <item>
      <title>AWS Redshift: Robust and Scalable Data Warehousing</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Wed, 14 Jun 2023 21:58:05 +0000</pubDate>
      <link>https://forem.com/mage_ai/aws-redshift-robust-and-scalable-data-warehousing-26ep</link>
      <guid>https://forem.com/mage_ai/aws-redshift-robust-and-scalable-data-warehousing-26ep</guid>
      <description>&lt;p&gt;&lt;em&gt;Guest blog by Shashank Mishra, Data Engineer @ Expedia&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/redshift/" rel="noopener noreferrer"&gt;Amazon Redshift&lt;/a&gt; is a powerful, scalable data warehousing service within the AWS ecosystem. It excels in handling large datasets with its columnar storage, parallel query execution, and features like Redshift Spectrum and RA3 instances. Redshift’s clustered architecture, robust security, and integration with AWS services make it a go-to choice for businesses needing efficient and secure data management solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction to AWS Redshift&lt;/li&gt;
&lt;li&gt;Key Features of AWS Redshift&lt;/li&gt;
&lt;li&gt;Redshift Architecture&lt;/li&gt;
&lt;li&gt;Benefits and Use Cases&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction to AWS Redshift
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/redshift/" rel="noopener noreferrer"&gt;Amazon Redshift&lt;/a&gt; is a fully managed, petabyte-scale data warehousing service in the cloud, part of the expansive Amazon Web Services (AWS) ecosystem. As organizations today deal with astronomical amounts of data, they require efficient tools to store, retrieve, and analyze this data. Redshift is AWS’s answer to this growing need.&lt;/p&gt;

&lt;p&gt;Designed for high-performance analysis of large datasets, Redshift allows businesses to run complex, data-heavy queries against big data sets, with results returned in seconds. It leverages columnar storage technology and parallel queries to quickly process data across multiple nodes.&lt;/p&gt;

&lt;p&gt;The service is integrated with other AWS services, making it a natural choice for organizations already invested in the AWS infrastructure. With its scalability, speed, and integration capabilities, AWS Redshift opens the door to cost-effective big data analytics, helping businesses leverage their data for actionable insights.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fknos08asjygjldq1nd8a.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fknos08asjygjldq1nd8a.gif" alt="Image description" width="480" height="270"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key features of AWS Redshift
&lt;/h2&gt;

&lt;p&gt;Amazon Redshift packs a number of unique features designed to provide reliable, scalable, and fast data warehousing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Redshift Spectrum:&lt;/em&gt; This feature allows users to run queries directly against vast amounts of data stored in Amazon S3. You don’t need to import or load the data, and you can use the same SQL-based interface you use for your regular Redshift queries.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Lake Integration:&lt;/em&gt; AWS Redshift can directly query and analyze data across your operational databases, data warehouse, and data lake. This gives you the ability to understand the complete picture using all your data without moving it around.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Concurrency Scaling:&lt;/em&gt; This feature enhances performance by adding more query processing power when you need it. As demand for data processing increases, Redshift automatically adds additional capacity to handle that demand, allowing multiple queries to run concurrently without any decrease in performance.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;RA3 instances:&lt;/em&gt; RA3 instances let you size your cluster based primarily on your compute needs. They feature managed storage, meaning Redshift will automatically manage your data from high-performance SSDs to S3 as per the workload demand.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Advanced Data Compression:&lt;/em&gt; AWS Redshift employs columnar storage technology, which minimizes the amount of data read from the disk, and advanced compression techniques that require less space compared to traditional relational databases.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Encryption:&lt;/em&gt; Redshift provides robust security through automatic encryption for data at rest and in transit.
By offering these key features, AWS Redshift delivers a flexible, powerful, and efficient solution for data warehousing and analytics.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fop987p4ssls3lxpk5gly.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fop987p4ssls3lxpk5gly.gif" alt="Image description" width="480" height="260"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Redshift Architecture
&lt;/h2&gt;

&lt;p&gt;Amazon Redshift’s architecture is the cornerstone of its efficiency and high-speed performance when dealing with vast data volumes. Redshift utilizes a Massively Parallel Processing (MPP) data warehouse architecture, which partitions data across multiple nodes and executes queries in parallel, dramatically enhancing query performance. Here’s a deeper look at its design:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Cluster:&lt;/em&gt; The fundamental building block of Amazon Redshift data warehouse is a cluster. A cluster is a set of nodes, which consists of a leader node and one or more compute nodes. The number of compute nodes can be scaled up or down depending upon the processing power needed, and each node has its own CPU, storage, and RAM.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Leader Node:&lt;/em&gt;_ The leader node is the orchestrator of the Redshift environment. It manages communication between client applications and the compute nodes. Client applications send SQL requests to the leader node, which parses and creates optimized query execution plans. The leader node then coordinates query execution with the compute nodes and compiles the final results to send back to the client applications. This node is also responsible for managing the distribution of data to the compute nodes.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Compute Nodes:&lt;/em&gt;_ Compute nodes are responsible for executing the query plans received from the leader node. Each compute node scans its local data blocks and performs the operations needed by the query. Intermediate results are then sent back to the leader node for aggregation before the results are returned to the client. The compute nodes ensure the MPP (Massively Parallel Processing) architecture of Amazon Redshift.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Node Slices:&lt;/em&gt; Each compute node is divided into slices. The number of slices per node depends on the node size of the cluster. Each slice is allocated a portion of the node’s memory and disk space, and it operates independently of other slices. When a query is run, each slice can work on its portion of the data concurrently, which contributes to Redshift’s high query performance.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Columnar Storage:&lt;/em&gt; Redshift uses columnar storage, which means data is stored by column rather than by row. This can dramatically improve query speed, as it means that only the columns needed for a query are read from the disk, reducing the amount of I/O and boosting query performance.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Distribution:&lt;/em&gt; Redshift distributes the rows of a table to the compute nodes according to a key chosen when the table is created. Proper choice of this key can significantly speed up query performance by minimizing the amount of data that needs to be transferred between nodes during query execution.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Compression:&lt;/em&gt; Redshift uses various encoding techniques to compress columns of data, which can result in less disk I/O and faster query performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This robust and thoughtfully designed architecture allows Amazon Redshift to efficiently manage and process huge volumes of data, making it a go-to solution for organizations dealing with big data analytics.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7x3s7293m241fqm3dca.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7x3s7293m241fqm3dca.gif" alt="Image description" width="480" height="270"&gt;&lt;/a&gt; (Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits and Use Cases of AWS Redshift
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Benefits&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Amazon Redshift provides several benefits that make it a potent choice for businesses looking to leverage their data effectively:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;AWS Integration:&lt;/em&gt; As part of the AWS ecosystem, Redshift integrates seamlessly with other AWS services such as S3, Kinesis, and DynamoDB, which facilitates diverse data workflows.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Robust Security:&lt;/em&gt; Redshift provides robust security features like automatic encryption, network isolation using Amazon VPC, and robust access control policies, ensuring your sensitive data is protected.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Cost-Effectiveness:&lt;/em&gt; With Redshift’s ability to automatically scale resources, businesses only pay for what they need, making it a cost-effective solution. Also, Redshift’s columnar storage and data compression reduce the amount of storage needed, leading to additional cost savings.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Performance:&lt;/em&gt; Redshift’s columnar storage, parallel query execution, and data compression lead to high-performance data processing, allowing businesses to gain insights from their data quickly.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Scalability:&lt;/em&gt; Redshift allows you to start with a few hundred gigabytes of data and scale up to a petabyte or more, making it an excellent choice for businesses of all sizes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Cases&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Redshift is ideal for various scenarios, but it truly shines in the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Business Intelligence (BI) Tools:&lt;/em&gt; Redshift integrates well with various BI tools like Tableau, Looker, and QuickSight, enabling organizations to create visualizations and perform detailed data analysis.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Lake Analytics:&lt;/em&gt; With Redshift Spectrum, users can directly query data in an Amazon S3 data lake without having to move or transform it.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Log Analysis:&lt;/em&gt; Businesses can use Redshift to analyze log data and understand website user behavior, application performance, and security patterns.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Real-Time Analytics:&lt;/em&gt; Combined with other AWS services like Kinesis, Redshift can power real-time analytics applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4gl992r7bc0i8t42r3ky.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4gl992r7bc0i8t42r3ky.gif" alt="Image description" width="500" height="281"&gt;&lt;/a&gt; S(Source: Giphy)&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, AWS Redshift offers a powerful, scalable, and secure data warehousing solution. Its robust features and benefits, combined with seamless integration within the AWS ecosystem, make it a formidable tool for businesses looking to glean valuable insights from their data. Whether it’s powering real-time analytics, driving business intelligence tools, or analyzing vast data lakes, Redshift’s potential to unlock the power of big data is immense.&lt;/p&gt;

&lt;p&gt;In episode 2 of the Datawarehouse series, we’ll explore &lt;a href="https://www.snowflake.com/" rel="noopener noreferrer"&gt;Snowflake&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Link to the original blog: &lt;a href="https://www.mage.ai/blog/aws-redshift-robust-and-scalable-data-warehousing" rel="noopener noreferrer"&gt;https://www.mage.ai/blog/aws-redshift-robust-and-scalable-data-warehousing&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>redshift</category>
      <category>datawarehousing</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Stream data processing with Mage</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Tue, 13 Jun 2023 01:55:37 +0000</pubDate>
      <link>https://forem.com/mage_ai/stream-data-processing-with-mage-28e9</link>
      <guid>https://forem.com/mage_ai/stream-data-processing-with-mage-28e9</guid>
      <description>&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;Dive into the implementation of stream data processing with Mage, using Kafka as source.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction to Mage&lt;/li&gt;
&lt;li&gt;Why is kafka a popular component of streaming applications?&lt;/li&gt;
&lt;li&gt;Step by step guide to create streaming pipeline on Mage&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction to Mage
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.mage.ai/" rel="noopener noreferrer"&gt;Mage&lt;/a&gt; is a powerful data processing tool allowing integration and synchronization of data from third-party sources. It supports building real-time and batch pipelines using Python, SQL, and R, making data transformation simple and efficient. Moreover, it enables running, monitoring, and orchestrating thousands of pipelines, ensuring a smooth data operation without the risk of data loss or interruption.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4ppcogtqusq4sp0bsw4z.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4ppcogtqusq4sp0bsw4z.gif" alt="Image description" width="480" height="400"&gt;&lt;/a&gt; &lt;br&gt;
Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is kafka a popular component of streaming applications?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://kafka.apache.org/" rel="noopener noreferrer"&gt;Apache Kafka&lt;/a&gt; is an open-source stream-processing software platform developed by LinkedIn and later donated to the Apache Software Foundation. It's built on the publish-subscribe messaging system and designed to handle real-time data feeds. Kafka is essentially a distributed event log service that is fault-tolerant, highly scalable, and provides high throughput for publishing and subscribing records.&lt;/p&gt;

&lt;p&gt;Given its robust features, Kafka is a popular component of streaming applications due to the following reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Performance and Scalability:&lt;/em&gt; Kafka can handle real-time data feeds on a large scale, processing millions of messages per second. Its distributed architecture allows for effortless scalability.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Durability and Reliability:&lt;/em&gt; Kafka's distributed commit log ensures robust data persistence, safeguarding against data loss. If a node fails, the data can still be retrieved from other nodes, hence ensuring reliability.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Fault Tolerance:&lt;/em&gt; Kafka can handle system failures without impacting the availability of data streams, which is crucial for applications that require constant, uninterrupted access to data.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Real-time Processing:&lt;/em&gt; Kafka supports both batch and real-time use cases, providing developers with flexibility when creating various applications.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Integration Capabilities:&lt;/em&gt; Kafka can integrate with a wide range of programming languages and data systems, making it versatile for differing application needs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kafka's popularity stems from its high performance, reliability, fault tolerance, real-time processing, and comprehensive integration capabilities.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fet3auv3z1ysydih59gps.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fet3auv3z1ysydih59gps.gif" alt="Image description" width="431" height="255"&gt;&lt;/a&gt; &lt;br&gt;
Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step by step guide to create streaming pipeline on Mage
&lt;/h2&gt;

&lt;p&gt;Dive into a comparison of Flink and Spark based on their performance benchmarks and scalability. Discover how they handle processing speed, in-memory computing, resource management, and more.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Processing Speed:&lt;/em&gt; Flink excels in &lt;strong&gt;low-latency&lt;/strong&gt;, high-throughput stream processing, while Spark is known for its fast batch processing capabilities. Both frameworks can process large volumes of data quickly, with Flink focusing on real-time analytics and Spark catering to &lt;strong&gt;batch&lt;/strong&gt; data processing tasks.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;In-Memory Computing:&lt;/em&gt; Both Flink and Spark leverage in-memory computing, which allows them to cache intermediate results during data processing tasks. This approach significantly reduces the time spent on &lt;strong&gt;disk I/O&lt;/strong&gt; operations and improves overall performance.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Resource Management:&lt;/em&gt; Flink and Spark can efficiently manage resources by dynamically allocating and deallocating them according to workload requirements. This enables both frameworks to scale horizontally, handling large-scale data processing tasks across multiple nodes in a distributed environment.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Adaptive Query Execution:&lt;/em&gt; Spark's Adaptive Query Execution (&lt;strong&gt;AQE&lt;/strong&gt;) feature optimizes query execution plans at runtime, allowing it to adapt to changing data and workload characteristics. This results in improved performance and resource utilization. Flink, on the other hand, does not currently have an equivalent feature.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Backpressure Handling:&lt;/em&gt; Flink is designed to handle backpressure, ensuring that the system remains stable even under high loads. This is achieved through its built-in flow control mechanisms, which prevent data processing bottlenecks. Spark Streaming, in contrast, may &lt;strong&gt;struggle&lt;/strong&gt; to handle &lt;strong&gt;backpressure&lt;/strong&gt;, leading to potential performance degradation.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Partitioning:&lt;/em&gt; Both Flink and Spark utilize data partitioning techniques to improve parallelism and optimize resource utilization during data processing tasks. While Spark employs RDDs and data partitioning strategies like Hash and Range partitioning, Flink uses &lt;strong&gt;operator chaining&lt;/strong&gt; and pipelined execution to optimize data processing performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8w6mh08wkawzs3h91ohm.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8w6mh08wkawzs3h91ohm.gif" alt="Image description" width="237" height="185"&gt;&lt;/a&gt; &lt;br&gt;
Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Recommendations for choosing the right tool for specific use cases
&lt;/h2&gt;

&lt;p&gt;Set up Kafka&lt;/p&gt;

&lt;p&gt;Here is a quick guide on how to run and use Kafka locally.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clone repository: &lt;code&gt;git clone https://github.com/wurstmeister/kafka-docker.git&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Change directory into that repository: &lt;code&gt;cd kafka-docker&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Edit the &lt;code&gt;docker-compose.yml&lt;/code&gt; file to match this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version: "2"
services:
  zookeeper:
    image: wurstmeister/zookeeper:3.4.6
    ports:
      - "2181:2181"
  kafka:
    build: .
    container_name: docker_kafka
    ports:
      - "9092:9092"
    expose:
      - "9093"
    environment:
      KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
      KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092
      KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Start Docker: &lt;code&gt;docker-compose up&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Start a terminal session in the running container:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker exec -i -t -u root $(docker ps | grep docker_kafka | cut -d' ' -f1) /bin/bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a topic:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$KAFKA_HOME/bin/kafka-topics.sh --create --partitions 4 --bootstrap-server kafka:9092 -
topic test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;List all available topics in Kafka instance:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$KAFKA_HOME/bin/kafka-topics.sh --bootstrap-server kafka:9092 --list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Start a producer on topic named &lt;code&gt;test&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$KAFKA_HOME/bin/kafka-console-producer.sh --broker-list kafka:9092 --topic=test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Send messages to the topic named &lt;code&gt;test&lt;/code&gt; by typing the following in the terminal:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;hello
&amp;gt;this is a test
&amp;gt;test 1
&amp;gt;test 2
&amp;gt;test 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Open another terminal and start a consumer on the topic named &lt;code&gt;test&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$KAFKA_HOME/bin/kafka-console-consumer.sh --from-beginning --bootstrap-server kafka:9092
--topic=test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The output should look something like this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hello
test 1
test 3
this is a test
test 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Setup stream data ingestion in Mage&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the following command to run Docker in network mode:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -it -p 6789:6789 -v $(pwd):/home/src \
  --env AWS_ACCESS_KEY_ID=your_access_key_id \
  --env AWS_SECRET_ACCESS_KEY=your_secret_access_key \
  --env AWS_REGION=your_region \
  --network kafka-docker_default \
  mageai/mageai /app/run_app.sh  mage start default_repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If the network named &lt;code&gt;kafka-docker_default&lt;/code&gt; doesn’t exist, create a new network:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker network create -d bridge kafka-docker_default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Check that it exists:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker network ls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If not able to connect with Kafka locally in a Docker container using Mage, in a Docker container the follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clone Mage: &lt;code&gt;git clone https://github.com/mage-ai/mage-ai.git&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Change directory into Mage: &lt;code&gt;cd mage-ai&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Edit the &lt;code&gt;docker-compose.yml&lt;/code&gt; file to match this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version: '3'
services:
  server:
    ... (original config)
    networks:
      - kafka
  app:
    ... (original config)
networks:
  kafka:
    name: kafka-docker_default
        external: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run the following script in terminal: &lt;code&gt;./scripts/dev.sh&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will run Mage in development mode, which runs it in a Docker container using docker compose instead of docker run.&lt;/p&gt;

&lt;p&gt;Create streaming data pipeline&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Mage in your browser.&lt;/li&gt;
&lt;li&gt;Click + &lt;code&gt;New pipeline&lt;/code&gt;, then select &lt;code&gt;Streaming&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add a data loader block, select &lt;code&gt;Kafka&lt;/code&gt;, and paste the following:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;connector_type: kafka
bootstrap_server: "localhost:9092"
topic: test
consumer_group: unique_consumer_group
batch_size: 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;By default, the &lt;code&gt;bootstrap_server&lt;/code&gt; is set to &lt;code&gt;localhost:9092&lt;/code&gt;, If you’re running Mage in a container, the &lt;code&gt;bootstrap_server&lt;/code&gt; should be &lt;code&gt;kafka:9093&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Messages are consumed from source in micro batch mode for better efficiency. The default batch size is 100. You can adjust the batch size in the source config.&lt;/li&gt;
&lt;li&gt;Add a transformer block and paste the following:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from typing import Dict, List

if 'transformer' not in globals():
    from mage_ai.data_preparation.decorators import transformer

@transformer
def transform(messages: List[Dict], *args, **kwargs):
    for msg in messages:
        print(msg)

    return messages
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add a data exporter block, select OpenSearch and paste the following:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;connector_type: opensearch
host: https://search-something-abcdefg123456.us-west-1.es.amazonaws.com/
index_name: python-test-index
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Change the &lt;code&gt;host&lt;/code&gt; to match your OpenSearch domain’s endpoint.&lt;/li&gt;
&lt;li&gt;Change the &lt;code&gt;index_name&lt;/code&gt; to match the index you want to export data into.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Test pipeline&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the streaming pipeline you just created, and in the right side panel near the bottom, click the button Execute pipeline to test the pipeline.&lt;/li&gt;
&lt;li&gt;You should see an output like this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[streaming_pipeline_test] Start initializing kafka consumer.
[streaming_pipeline_test] Finish initializing kafka consumer.
[streaming_pipeline_test] Start consuming messages from kafka.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Publish messages using Python&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a terminal on your local workstation.&lt;/li&gt;
&lt;li&gt;Install &lt;code&gt;kafka-python&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install kafka-python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Open a Python shell and write the following code to publish messages:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from kafka import KafkaProducer
from random import random
import json

topic = 'test'
producer = KafkaProducer(
    bootstrap_servers='kafka:9093',
)

def publish_messages(limit):
    for i in range(limit):
        data = {
            'title': 'test_title',
            'director': 'Bennett Miller',
            'year': '2011',
            'rating': random(),
        }
        producer.send(topic, json.dumps(data).encode('utf-8'))

publish_messages(5)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Once you run the code snippet above, go back to your streaming pipeline in Mage and the output should look like this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[streaming_pipeline_test] Start initializing kafka consumer.
[streaming_pipeline_test] Finish initializing kafka consumer.
[streaming_pipeline_test] Start consuming messages from kafka.
[streaming_pipeline_test] [Kafka] Receive message 2:16: v=b'{"title": "test_title",
"director": "Bennett Miller", "year": "2011", "rating": 0.7010424523477785}',
time=1665618592.226788
[streaming_pipeline_test] [Kafka] Receive message 0:16: v=b'{"title": "test_title",
"director": "Bennett Miller", "year": "2011", "rating": 0.7886308380991354}',
time=1665618592.2268753
[streaming_pipeline_test] [Kafka] Receive message 0:17: v=b'{"title": "test_title",
"director": "Bennett Miller", "year": "2011", "rating": 0.0673276352704153}',
time=1665618592.2268832
[streaming_pipeline_test] [Kafka] Receive message 3:10: v=b'{"title": "test_title",
"director": "Bennett Miller", "year": "2011", "rating": 0.37935417366095525}',
time=1665618592.2268872
[streaming_pipeline_test] [Kafka] Receive message 3:11: v=b'{"title": "test_title",
"director": "Bennett Miller", "year": "2011", "rating": 0.21110511524126563}',
time=1665618592.2268918
[streaming_pipeline_test] {'title': 'test_title', 'director': 'Bennett Miller', 'year':
'2011', 'rating': 0.7010424523477785}
[streaming_pipeline_test] {'title': 'test_title', 'director': 'Bennett Miller', 'year':
'2011', 'rating': 0.7886308380991354}
[streaming_pipeline_test] {'title': 'test_title', 'director': 'Bennett Miller', 'year':
'2011', 'rating': 0.0673276352704153}
[streaming_pipeline_test] {'title': 'test_title', 'director': 'Bennett Miller', 'year':
'2011', 'rating': 0.37935417366095525}
[streaming_pipeline_test] {'title': 'test_title', 'director': 'Bennett Miller', 'year':
'2011', 'rating': 0.21110511524126563}
[streaming_pipeline_test] [Opensearch] Batch ingest data [{'title': 'test_title',
'director': 'Bennett Miller', 'year': '2011', 'rating': 0.7010424523477785}, {'title':
'test_title', 'director': 'Bennett Miller', 'year': '2011', 'rating': 0.7886308380991354},
{'title': 'test_title', 'director': 'Bennett Miller', 'year': '2011', 'rating':
0.0673276352704153}, {'title': 'test_title', 'director': 'Bennett Miller', 'year': '2011',
'rating': 0.37935417366095525}, {'title': 'test_title', 'director': 'Bennett Miller',
'year': '2011', 'rating': 0.21110511524126563}], time=1665618592.2294626
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Consume messages using Python&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you want to programmatically consume messages from a Kafka topic, here is a code snippet:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from kafka import KafkaConsumer
import time

topic = 'test'
consumer = KafkaConsumer(
    topic,
    group_id='test',
    bootstrap_servers='kafka:9093',
)

for message in consumer:
    print(f"{message.partition}:{message.offset}: v={message.value}, time={time.time()}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run in production&lt;/p&gt;

&lt;p&gt;If you want to programmatically consume messages from a Kafka topic, here is a code snippet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.mage.ai/design/data-pipeline-management#create-trigger" rel="noopener noreferrer"&gt;Create a trigger&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Once the trigger is created, click the Start trigger button at the top of the page to make the streaming pipeline active.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcjoe3lr6k83wjaazsupy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcjoe3lr6k83wjaazsupy.gif" alt="Image description" width="300" height="170"&gt;&lt;/a&gt; &lt;br&gt;
Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, &lt;a href="https://www.mage.ai" rel="noopener noreferrer"&gt;Mage&lt;/a&gt; is an exceptional tool for stream data processing, adept at managing data from various sources and transforming it through real-time and batch pipelines using Python, SQL, and R. It stands out in its capacity to efficiently handle thousands of pipelines simultaneously, ensuring smooth operations and data integrity. Given the increasing need for real-time data processing in today's data-driven world, Mage is positioned as a vital tool in the arsenal of data professionals. Its versatility and robust capabilities make it a reliable choice for handling complex and voluminous streaming data.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Link to the original blog: &lt;a href="https://www.mage.ai/blog/stream-data-processing-with-Mage" rel="noopener noreferrer"&gt;https://www.mage.ai/blog/stream-data-processing-with-Mage&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>streaming</category>
      <category>data</category>
      <category>dataengineering</category>
      <category>kafka</category>
    </item>
    <item>
      <title>A mage on the Hero’s Journey: a fantasy epic on how a startup rose from the ashes</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Mon, 12 Jun 2023 23:24:05 +0000</pubDate>
      <link>https://forem.com/mage_ai/a-mage-on-the-heros-journey-a-fantasy-epic-on-how-a-startup-rose-from-the-ashes-3od6</link>
      <guid>https://forem.com/mage_ai/a-mage-on-the-heros-journey-a-fantasy-epic-on-how-a-startup-rose-from-the-ashes-3od6</guid>
      <description>&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;TLDR&lt;/li&gt;
&lt;li&gt;Prologue&lt;/li&gt;
&lt;li&gt;Adventure, trials, and tribulations&lt;/li&gt;
&lt;li&gt;Death, rebirth, and transformation&lt;/li&gt;
&lt;li&gt;Battle, freedom, and victory&lt;/li&gt;
&lt;li&gt;Epilogue&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.mage.ai/" rel="noopener noreferrer"&gt;Mage&lt;/a&gt; pivoted from an AI platform to an &lt;a href="https://www.mage.ai/github" rel="noopener noreferrer"&gt;open-source data pipeline tool&lt;/a&gt; and is making a huge impact on the lives of data engineers around the world.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prologue
&lt;/h2&gt;

&lt;p&gt;Once upon a time, there lived a promising young mage that left the magic academy early, journeying off on her own to make a difference in the world.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FGHgquQpTjirDVn03GItQ" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FGHgquQpTjirDVn03GItQ" alt="Image description" width="800" height="490"&gt;&lt;/a&gt;The young mage journeying off on her own to make a difference in the world.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;She believed that helping townsfolk harness the power of AI would create an economic boom across villages around the world.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adventure, trials, and tribulations
&lt;/h2&gt;

&lt;p&gt;The young mage created an AI tool to help developers at small companies build, train, and deploy AI models. Initially, the villagers were excited and had lots of interest in using the tool. Many of them lined up for days outside the village just to schedule demos and paid trials.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1189%2Cheight%3A1600%2FFGkVhbBFTPW3QG9x7J8y" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1189%2Cheight%3A1600%2FFGkVhbBFTPW3QG9x7J8y" alt="Image description" width="800" height="1076"&gt;&lt;/a&gt;The young mage showing off the magical AI tool to the villagers.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;However, when the day approached to implement the tool, villagers kept giving the young mage reasons for why they weren’t ready. Some of these reasons included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;“We need a data warehouse first.”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“We need to make our first data hire.”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“We need a data pipeline management tool first.”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“We need to organize and clean our data first.”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After many sleepless nights, the young mage sensed that an evil dark presence had secretly infiltrated the village. This dark force came to be known as the Harbinger of Unnecessary Tools.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2F2pUhfwPT56EOqL4yn9IA" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2F2pUhfwPT56EOqL4yn9IA" alt="Image description" width="800" height="490"&gt;&lt;/a&gt;The Harbinger of Unnecessary Tools secretly infiltrates villages and companies.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In that moment, the young mage realized that the AI tool was not a necessity; the villagers had more urgent problems that needed a remedy immediately. This realization was devastating because the AI tool had been worked on for over a year.&lt;/p&gt;

&lt;p&gt;The young mage was defeated by the Harbinger of Unnecessary Tools. In pain and despair, she was driven out of the town and went into hiding; uncertain of her future.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1495%2Cheight%3A1080%2F4DTxliJ7TBuKOnhjHDBx" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1495%2Cheight%3A1080%2F4DTxliJ7TBuKOnhjHDBx" alt="Image description" width="800" height="577"&gt;&lt;/a&gt;The young mage defeated… but not giving up yet!&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here are a few lessons inscribed in her tome:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Pay attention to why users don’t give a resounding “yes”. Avoid “maybe” like the black plague. They can be a secret poison because it gives hope that it’ll eventually be a “yes” when in fact it’s a “no”.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fail fast. Find ways to prove the product wrong as fast as possible. The quicker it fails, the more chances there are to try something different and succeed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Death, rebirth, and transformation
&lt;/h2&gt;

&lt;p&gt;The young mage began doubting herself, questioning whether she left the magic academy too early. Injured and depleted of mana (energy that powers magic), she began wandering aimlessly through the abyss of the multiverse. Along the way, she spoke with nearly a thousand data professionals and asked them this question: what was the most boring part of your work?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FAQ0rdqWRVGYJ6clVxKMQ" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FAQ0rdqWRVGYJ6clVxKMQ" alt="Image description" width="800" height="490"&gt;&lt;/a&gt;The young mage traveling through the multiverse.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Enlightened by the responses, the young mage meditated on the reasons why the villagers weren’t ready to implement the AI tool. After meditating and deciphering the arcane knowledge of responses gathered throughout the multiverse, the young mage had a revelation: companies need urgent help moving their data and preparing it for usage.&lt;/p&gt;

&lt;p&gt;The young mage began rebuilding and leveling up her powers. She trained day and night for what seemed like an eternity. The young mage took some of the technology she used in the previous AI tool, infused it with power-ups, and open-sourced it. Legend has it that her reborn powers are known as the Data Pipeline Tool.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FLOsFuH86TMGNpQMcqQQ3" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FLOsFuH86TMGNpQMcqQQ3" alt="Image description" width="800" height="490"&gt;&lt;/a&gt;The young mage training, leveling up, and upgrading her magic attributes.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;However, this was no ordinary tool; it has 3 major differentiators:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It’s designed to have the easiest developer experience by providing a user interface; enabling developers to build data pipelines visually, quickly, and intuitively.&lt;/li&gt;
&lt;li&gt;It combines 3 use cases that have strong synergy and affinity for one another: batch processing pipelines, data integration pipelines, and streaming pipelines.&lt;/li&gt;
&lt;li&gt;Engineering best practices are built-in. The tool enables modular design of data pipelines; making each step in your pipeline easily reusable and simple to test with data validations.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At full power, the mage was ready to return and defend the village from the Harbinger of Unnecessary Tools!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1156%2Cheight%3A1600%2FIKTGntrRlGkLEBY64o6A" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1156%2Cheight%3A1600%2FIKTGntrRlGkLEBY64o6A" alt="Image description" width="800" height="1107"&gt;&lt;/a&gt;Mage at full power.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Battle, freedom, and victory
&lt;/h2&gt;

&lt;p&gt;The mage walked across astral planes and arrived at the village that was being oppressed by the Harbinger of Unnecessary Tools. She summoned all her powers and open-sourced the data pipeline tool.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1840%2Cheight%3A2080%2FoTIAvKEpQEW0b3joPp7h" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1840%2Cheight%3A2080%2FoTIAvKEpQEW0b3joPp7h" alt="Image description" width="800" height="904"&gt;&lt;/a&gt;The mage getting ready to battle the Harbinger of Unnecessary Tools.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After releasing the tool, spells of fire, water, wind, and lightning were cast at the dark force. With every passing moment, the open-source tool grew more powerful. As the battle raged on, bugs were eliminated, scalability issues were banished, powerful new features were added, and chromatic color began returning to the village.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FLrONyLOfT7GYkP87EORG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FLrONyLOfT7GYkP87EORG" alt="Image description" width="800" height="490"&gt;&lt;/a&gt;Mage casting spells at the dark force.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After a fortnight of intense dueling, the Harbinger of Unnecessary Tools was finally defeated! The darkness of an unnecessary product, that had previously haunted the people, was lifted once and for all.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1470%2Cheight%3A1080%2FW8m2P8SIQT2Zwm37dZ8C" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1470%2Cheight%3A1080%2FW8m2P8SIQT2Zwm37dZ8C" alt="Image description" width="800" height="587"&gt;&lt;/a&gt;The Harbinger of Unnecessary Tools defeated.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Everyone was liberated from the dark force’s grip and joy overflowed in the streets. The entire village praised the mage for saving them from the pain of using data tools with a dreadful developer experience. Countless villagers expressed their gratitude and gave many thanks to the mage.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FSsOwmEW0QKGfSv5lEnO8" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FSsOwmEW0QKGfSv5lEnO8" alt="Image description" width="800" height="490"&gt;&lt;/a&gt;The darkness of dreadful developer experiences have finally lifted.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here are some of the testimonies from developers in that village:&lt;/p&gt;

&lt;p&gt;“I was awestruck when I used Mage for the 1st time. It’s super clean and user friendly.” — &lt;a href="https://www.linkedin.com/in/ajshetty28/" rel="noopener noreferrer"&gt;Ajith Shetty, Data Engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“Recently tried Mage 🧙 and I must say I’m amazed by its developer centric usability.” — &lt;a href="https://www.linkedin.com/in/salman-ahmed987/" rel="noopener noreferrer"&gt;Salman Ahmed, Data Engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“Mage is such a refreshing orchestrator compared to Airflow.” — &lt;a href="https://www.linkedin.com/in/anilakulkarni/" rel="noopener noreferrer"&gt;Anil Kulkarni, Senior Data Engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“All throughout this Slack space, you guys are quick, resourceful, and have an open mind. It really separates you from other orchestrators.” — &lt;a href="https://www.linkedin.com/in/gregory-lenane-b31bb2125/" rel="noopener noreferrer"&gt;Greg Lenane, Senior Analytics Engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“It took minimal work to start understanding and building pipelines as opposed to Airflow.” — &lt;a href="https://www.linkedin.com/in/pedrodellazzari/" rel="noopener noreferrer"&gt;Pedro Dellazzari, Data Scientist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“I would like to express my love for using Mage. My experience with it has been fantastic so far.” — Fabián Sepúlveda, Data Engineer&lt;/p&gt;

&lt;p&gt;“I truly appreciate being part of this amazing community and am honored to have had the opportunity to contribute to its success.” — &lt;a href="https://www.linkedin.com/in/gharsallaoui-dhia-eddine/" rel="noopener noreferrer"&gt;Dhia Gharsallaoui, Data Architect&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“Just wanted to say that I’m incredibly impressed with what Mage is capable of. It’s incredibly powerful and user friendly.” — &lt;a href="https://www.linkedin.com/in/matthewpegler/" rel="noopener noreferrer"&gt;Matt Pegler, SVP of Innovation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“Hey! Transferring all our stuff to Mage from Airflow. We have around 80 pipelines running (and will be growing), managed by a team of 4.” — &lt;a href="https://www.linkedin.com/in/nazari-goudin-556a55165/" rel="noopener noreferrer"&gt;Nazari Goudin, Head of Data&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“Pushed existing dbt repo into Mage repo as sub module. Oh Man, Mage is 🔥” — &lt;a href="https://www.linkedin.com/in/vijayasarathym/" rel="noopener noreferrer"&gt;Vijayasarathy Muthu, Data Engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“To be honest, I am really loving Mage.” — &lt;a href="https://www.linkedin.com/in/alexanderbolano/" rel="noopener noreferrer"&gt;Alexander Bolaño, Senior Data Engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“Congrats on creating one helluva DX. Night and day for all other tools we’ve been testing.” — Tomas Roaldsnes&lt;/p&gt;

&lt;p&gt;“I have never seen such a friendly place to ask questions, I love the openness of it!” — &lt;a href="https://www.linkedin.com/in/davisvance/" rel="noopener noreferrer"&gt;Davis Vance, Data Engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“I finished the tutorial and my reaction was… DAMMMMM! It is a really nice platform! OMG” — &lt;a href="https://www.linkedin.com/in/paulo-mota-955218a2/" rel="noopener noreferrer"&gt;Paulo Mota, Data Engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“I love the tool and see potential for not only being a standard tool but also a standard user experience. This is an amazing product y’all.” — &lt;a href="https://www.linkedin.com/in/farmanp/" rel="noopener noreferrer"&gt;Farman Pirzada, Senior Software Engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“Just deleted Cloud Composer yesterday and fully moved to Mage.” — &lt;a href="https://www.linkedin.com/in/leminh-nguyen/" rel="noopener noreferrer"&gt;Le Minh Nguyen, Data Scientist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“I’ve been using Mage for 2 months now and I must say that I’m really impressed with the work that has been done so far.” — &lt;a href="https://www.linkedin.com/in/salomon-dion/" rel="noopener noreferrer"&gt;Dion Salomon, Data Engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“It massively lowers the barrier for entry on data engineering, which has had to turn into its own specialized profession (Airflow isn’t exactly fun to debug).” — &lt;a href="https://www.linkedin.com/in/essipova/" rel="noopener noreferrer"&gt;Nicolas Essipova, CTO&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“I think this is one of the most beautiful pieces of software I’ve ever used. There is powerful sorcery at work here.” — &lt;a href="https://www.linkedin.com/in/patcl/" rel="noopener noreferrer"&gt;Patrick Clark, Data Engineer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since the release of the &lt;a href="https://www.mage.ai/github" rel="noopener noreferrer"&gt;open-source data pipeline tool&lt;/a&gt; in June 2022, the project has received over 4.6 thousand stars on &lt;a href="https://www.mage.ai/github" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, over 2.1 thousand community members on &lt;a href="https://www.mage.ai/chat" rel="noopener noreferrer"&gt;Slack&lt;/a&gt;, and over a hundred teams using the tool in production.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FcYcyCyTSKWMG5GrZVckx" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1760%2Cheight%3A1080%2FcYcyCyTSKWMG5GrZVckx" alt="Image description" width="800" height="490"&gt;&lt;/a&gt;The tool has traction in the village.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In return for defeating the Harbinger of Unnecessary Tools, the Magic Council of Venture Capital decided to award the mage with an additional investment of $5 million. This investment was led again by &lt;a href="https://www.gradient.com/" rel="noopener noreferrer"&gt;Gradient Ventures&lt;/a&gt;, included previous investors (&lt;a href="https://www.essencevc.fund/" rel="noopener noreferrer"&gt;Essence VC&lt;/a&gt;, &lt;a href="https://www.designerfund.com/" rel="noopener noreferrer"&gt;Designer Fund&lt;/a&gt;, &lt;a href="https://www.manaventures.vc/" rel="noopener noreferrer"&gt;Mana Ventures&lt;/a&gt;), and added an amazing group of strategic angel investors:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/guillermo-rauch-b834b917b/" rel="noopener noreferrer"&gt;Guillermo Rauch&lt;/a&gt; (CEO @ &lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt;)&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/scottbreitenother/" rel="noopener noreferrer"&gt;Scott Breitenother&lt;/a&gt; (CEO @ &lt;a href="https://brooklyndata.co/" rel="noopener noreferrer"&gt;Brooklyn Data Co&lt;/a&gt;)&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/ananthdurai/" rel="noopener noreferrer"&gt;Ananth Packkildurai&lt;/a&gt; (&lt;a href="https://www.dataengineeringweekly.com/" rel="noopener noreferrer"&gt;Data Engineering Weekly&lt;/a&gt;)&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/ryguyrg/" rel="noopener noreferrer"&gt;Ryan Boyd&lt;/a&gt; (Co-founder @ &lt;a href="https://motherduck.com/" rel="noopener noreferrer"&gt;MotherDuck&lt;/a&gt;)&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/jordantigani/" rel="noopener noreferrer"&gt;Jordan Tigani&lt;/a&gt; (CEO @ &lt;a href="https://motherduck.com/" rel="noopener noreferrer"&gt;MotherDuck&lt;/a&gt;)&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/benn-stancil/" rel="noopener noreferrer"&gt;Benn Stancil&lt;/a&gt; (CTO @ &lt;a href="https://mode.com/" rel="noopener noreferrer"&gt;Mode&lt;/a&gt;)&lt;br&gt;
and several other data industry thought leaders.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A700%2Cheight%3A911%2FRqREUDhJQS26WmHcYqCa" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A700%2Cheight%3A911%2FRqREUDhJQS26WmHcYqCa" alt="Image description" width="700" height="911"&gt;&lt;/a&gt;Gold coins invested to continue powering up data engineers!&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In addition to acquiring more gold, the mage gathered a powerful and wise group of advisors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.linkedin.com/in/eczachly/" rel="noopener noreferrer"&gt;Zach Wilson&lt;/a&gt; (&lt;a href="https://www.linkedin.com/company/eczachly/" rel="noopener noreferrer"&gt;EcZachly&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.linkedin.com/in/benjaminrogojan/" rel="noopener noreferrer"&gt;Benjamin Rogojan&lt;/a&gt; (&lt;a href="https://www.theseattledataguy.com/" rel="noopener noreferrer"&gt;Seattle Data Guy&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.linkedin.com/in/agrigorev/" rel="noopener noreferrer"&gt;Alexey Grigorev&lt;/a&gt; (&lt;a href="https://datatalks.club/" rel="noopener noreferrer"&gt;DataTalks.Club&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.linkedin.com/in/josephreis/" rel="noopener noreferrer"&gt;Joe Reis&lt;/a&gt; (&lt;a href="https://www.oreilly.com/library/view/fundamentals-of-data/9781098108298/" rel="noopener noreferrer"&gt;Fundamentals of Data Engineering&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1098%2Cheight%3A1600%2FdveZiGAkTquyARyrX7sp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1098%2Cheight%3A1600%2FdveZiGAkTquyARyrX7sp" alt="Image description" width="800" height="1165"&gt;&lt;/a&gt;Powerful and wise Mage advisors.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Epilogue
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.mage.ai/" rel="noopener noreferrer"&gt;Mage&lt;/a&gt; is on a mission to make data engineering more accessible so that developers can harness the power of data to create magical experiences.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1283%2Cheight%3A1600%2FEitkAjAiRMKpP6QQJGgu" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1283%2Cheight%3A1600%2FEitkAjAiRMKpP6QQJGgu" alt="Image description" width="800" height="997"&gt;&lt;/a&gt;Mage making advanced technology more accessible to the world.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That’s why &lt;a href="https://www.mage.ai/" rel="noopener noreferrer"&gt;Mage&lt;/a&gt; is recruiting other fellow mages who want to go on an adventure and achieve this mission together. Here are the roles in the party that are currently open:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.notion.so/Full-Stack-Engineer-Senior-cb05487255f745aa86fc69e94eb7794a" rel="noopener noreferrer"&gt;Full Stack Engineer (Senior)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.notion.so/Front-end-Engineer-Senior-b0d4b80fe38241408d08a00a9ae1151d" rel="noopener noreferrer"&gt;Front-end Engineer (Senior)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.notion.so/Backend-Engineer-Senior-db792ac3788145c9a2d5d7f5be0e7e93" rel="noopener noreferrer"&gt;Backend Engineer (Senior)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.toDeveloper%20Success%20Engineer"&gt;Developer Success Engineer&lt;/a&gt; (aka Developer Relations)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.notion.so/Head-of-Developer-Success-ad10877fd5c64404a27866455316eb4f" rel="noopener noreferrer"&gt;Head of Developer Success&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the coming years, &lt;a href="https://www.mage.ai/" rel="noopener noreferrer"&gt;Mage&lt;/a&gt; will create a cooperative experience so that developers can build data pipelines with their team and level up together. After that journey, Mage will go on an epic quest to create the 1st open world community experience in the data universe.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A720%2Cheight%3A442%2FYa0x1USKYXfveoB5WeAb" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A720%2Cheight%3A442%2FYa0x1USKYXfveoB5WeAb" alt="Image description" width="720" height="442"&gt;&lt;/a&gt;Open World mode, unlocked.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Thank you so much for your relentless support of the mission and continued belief in the century long vision!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1121%2Cheight%3A1680%2FAM4ImgHiRWicLDf9aROD" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fresize%3Dwidth%3A1121%2Cheight%3A1680%2FAM4ImgHiRWicLDf9aROD" alt="Image description" width="800" height="1198"&gt;&lt;/a&gt;It’s never the end. Mage will be the 1st millenia long company.&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>startup</category>
      <category>dataengineering</category>
      <category>datapipelines</category>
      <category>etl</category>
    </item>
    <item>
      <title>How to build a data pipeline using Delta Lake</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Fri, 19 May 2023 07:26:11 +0000</pubDate>
      <link>https://forem.com/mage_ai/how-to-build-a-data-pipeline-using-delta-lake-l78</link>
      <guid>https://forem.com/mage_ai/how-to-build-a-data-pipeline-using-delta-lake-l78</guid>
      <description>&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;Combine powerful database features with the flexibility of an object storage system by using the Delta Lake framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Intro&lt;/li&gt;
&lt;li&gt;Prologue&lt;/li&gt;
&lt;li&gt;Defend the planet&lt;/li&gt;
&lt;li&gt;Final battle&lt;/li&gt;
&lt;li&gt;Epilogue&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fgot82qTFSIgWAlbZfhIX" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fgot82qTFSIgWAlbZfhIX" alt="Image description" width="700" height="201"&gt;&lt;/a&gt;&lt;a href="https://delta.io/" rel="noopener noreferrer"&gt;Delta Lake&lt;/a&gt;
&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  What’s Delta Lake?
&lt;/h3&gt;

&lt;p&gt;This sounds like a new trending destination to take selfies in front of, but it’s even better than that. &lt;a href="https://delta.io/" rel="noopener noreferrer"&gt;Delta Lake&lt;/a&gt; is an “open-source storage layer designed to run on top of an existing data lake and improve its reliability, security, and performance.” (&lt;a href="https://www.hpe.com/us/en/what-is/delta-lake.html" rel="noopener noreferrer"&gt;source&lt;/a&gt;). It let’s you interact with an object storage system like you would with a database.&lt;/p&gt;
&lt;h3&gt;
  
  
  Why it’s useful?
&lt;/h3&gt;

&lt;p&gt;An object storage system (e.g. &lt;a href="https://aws.amazon.com/s3/" rel="noopener noreferrer"&gt;Amazon S3&lt;/a&gt;, &lt;a href="https://azure.microsoft.com/en-us/products/storage/blobs" rel="noopener noreferrer"&gt;Azure Blob Storage&lt;/a&gt;, &lt;a href="https://cloud.google.com/storage" rel="noopener noreferrer"&gt;Google Cloud Platform Cloud Storage&lt;/a&gt;, etc.) makes it easy and simple to save large amounts of historical data and retrieve it for future use.&lt;/p&gt;

&lt;p&gt;The downside of such systems is that you don’t get the benefits of a traditional database; e.g. ACID transactions, rollbacks, schema management, DML (data manipulation language) operations like merge and update, etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://delta.io/" rel="noopener noreferrer"&gt;Delta Lake&lt;/a&gt; gives you best of both worlds. For more details on the benefits, check out their &lt;a href="https://docs.delta.io/latest/delta-intro.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Install Delta Lake
&lt;/h3&gt;

&lt;p&gt;To install the Delta Lake Python library, run the following command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install deltalake
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setup Delta Lake storage
&lt;/h3&gt;

&lt;p&gt;Delta Lake currently supports several storage backends:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Amazon S3&lt;/li&gt;
&lt;li&gt;Azure Blob Storage&lt;/li&gt;
&lt;li&gt;GCP Cloud Storage&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Before we can use Delta Lake, please setup one of the above storage options. For more information on Delta Lake’s supported storage backends, read their documentation on &lt;a href="https://docs.rs/object_store/latest/object_store/aws/enum.AmazonS3ConfigKey.html#variants" rel="noopener noreferrer"&gt;Amazon S3&lt;/a&gt;, &lt;a href="https://docs.rs/object_store/latest/object_store/azure/enum.AzureConfigKey.html#variants" rel="noopener noreferrer"&gt;Azure Blob Storage&lt;/a&gt;, and &lt;a href="https://docs.rs/object_store/latest/object_store/gcp/enum.GoogleConfigKey.html#variants" rel="noopener noreferrer"&gt;GCP Cloud Storage&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prologue
&lt;/h2&gt;

&lt;p&gt;We live in a multi-verse of planets and galaxies. Amongst the multi-verse, there exists a group of invaders determined to conquer all friendly planets. They call themselves the Gold Legion.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FAIP2SlpSI6UfyMNnisyQ" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FAIP2SlpSI6UfyMNnisyQ" alt="Image description" width="700" height="525"&gt;&lt;/a&gt; The Gold Legion&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Many millennia ago, the Gold Legion conquered vast amounts of planets whose name have now been lost in history. Before these planets fell, they spent their final days exporting what they learned about their invaders, into the fabric of space; with the hopes of future generations surviving the oncoming calamity.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FUVwAdCHyT4S0ahuwkV0Y" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FUVwAdCHyT4S0ahuwkV0Y" alt="Image description" width="700" height="525"&gt;&lt;/a&gt; Share our data to save the universe&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Along with the battle data, these civilizations exported their avatar’s magic energy into the cosmos so that others can one day harness it.&lt;/p&gt;
&lt;h3&gt;
  
  
  How to use Delta Lake
&lt;/h3&gt;

&lt;p&gt;The current unnamed planet is falling. We have 1 last chance to export the battle data we learned about the Gold Legion. We’re going to use a reliable technology called Delta Lake for this task.&lt;/p&gt;

&lt;p&gt;First, download a CSV file and create a dataframe object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd


df = pd.read_csv(
    'https://raw.githubusercontent.com/mage-ai/datasets/master/battle_history.csv',
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, create a Delta Table from the dataframe object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from deltalake.writer import write_deltalake


write_deltalake(
    # Change this URI to your own unique URI
    's3://mage-demo-public/battle-history/1337',
    data=df,
    mode='overwrite',
    overwrite_schema=True,
    storage_options={
        'AWS_REGION': '...',
        'AWS_ACCESS_KEY_ID': '...',
        'AWS_SECRET_ACCESS_KEY': '...',
        'AWS_S3_ALLOW_UNSAFE_RENAME': 'true',
    },
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to append the data to an existing table, change the &lt;code&gt;mode&lt;/code&gt; argument to &lt;code&gt;append&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you don’t want to change the schema when writing to an existing table, change the &lt;code&gt;overwrite_schema&lt;/code&gt; argument to &lt;code&gt;False&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When creating or appending data to a table, you can optionally write that data using partitions. Set the keyword argument &lt;code&gt;partition_by&lt;/code&gt; to a list of 1 or more column names to use as the partition for the table. For example, &lt;code&gt;partition_by=['planet', 'universe']&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For more options to customize your usage of Delta Lake, check out their awesome API &lt;a href="https://delta-io.github.io/delta-rs/python/usage.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you’re not sure what keys are available to use in the storage options dictionary, refer to these examples depending on the storage backend you’re using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon S3&lt;/li&gt;
&lt;li&gt;Azure Blob Storage&lt;/li&gt;
&lt;li&gt;GCP Cloud Storage&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Defend the planet
&lt;/h2&gt;

&lt;p&gt;Fast forward to the present day and the Gold Legion has found Earth. They are beginning the invasion of our home planet. We must defend it!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FeN2l0WHfTfiFOKaZWVHu" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FeN2l0WHfTfiFOKaZWVHu" alt="Image description" width="700" height="525"&gt;&lt;/a&gt; Defend Earth!&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Load data from Delta Lake
&lt;/h3&gt;

&lt;p&gt;Let’s use Delta Lake to load battle history data from within the fabric of space.&lt;/p&gt;

&lt;p&gt;If you don’t have AWS credentials, you can use these read-only credentials:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AWS_ACCESS_KEY_ID=AKIAZ4SRK3YKQJVOXW3Q
AWS_SECRET_ACCESS_KEY=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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from deltalake import DeltaTable


dt = DeltaTable(
    # Change this to your unique URI from a previous step
    # if you’re using your own AWS credentials.
    's3://mage-demo-public/battle-history/1337',
    storage_options={
        'AWS_ACCESS_KEY_ID': '...',
        'AWS_SECRET_ACCESS_KEY': '...',
    },
)
dt.to_pandas()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is how the data could look:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FrJPkMqoiRieCX6NfYWse" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FrJPkMqoiRieCX6NfYWse" alt="Image description" width="700" height="285"&gt;&lt;/a&gt; Sample battle history data&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now that we’ve acquired battle data from various interstellar planets across the multi-verse spanning many millennia, planet Earth has successfully halted the Gold Legion’s advances into the atmosphere!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2F8HEAvBblRoCYiepHOx60" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2F8HEAvBblRoCYiepHOx60" alt="Image description" width="700" height="525"&gt;&lt;/a&gt; We successfully defended the planet!&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;However, the invaders are still in the Milky Way and are plotting their next incursion into our planet. Do you want to repel them once and for all? If so, proceed to the section labeled &lt;strong&gt;“Craft data pipeline (optional)”&lt;/strong&gt;.&lt;/p&gt;


&lt;h3&gt;
  
  
  Time travel with versioned data
&lt;/h3&gt;

&lt;p&gt;In the multi-verse, time is a concept that can be controlled. With Delta Lake, you can access data that has been created at different times. For example, let’s take the battle data, create a new table, and append data to that table several times:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from deltalake.writer import write_deltalake


# ['Aiur', 'Eos', 'Gaia', 'Kamigawa', 'Korhal', 'Ravnica']
planets = list(sorted(set(df['planet'].values)))

# Loop through each planet
for planet in planets:
    # Select a subset of the battle history data for a single planet
    planet_df = df.query(f"`planet` == '{planet}'")

    # Write to Delta Lake for each planet and keep appending the data
    write_deltalake(
        # Change this URI to your own unique URI
        's3://mage-demo-public/battle-history-versioned/1337',
        data=planet_df,
        mode='append',
        storage_options={
            'AWS_REGION': '...',
            'AWS_ACCESS_KEY_ID': '...',
            'AWS_SECRET_ACCESS_KEY': '...',
            'AWS_S3_ALLOW_UNSAFE_RENAME': 'true',
        },
    )
    print(
        f'Created table with {len(planet_df.index)} records for planet {planet}.',
    )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This operation will have appended data 6 times. Using Delta Lake, you can travel back in time and retrieve the data using the &lt;code&gt;version&lt;/code&gt; parameter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from deltalake import DeltaTable




dt = DeltaTable(
    # Change this to your unique URI from a previous step
    # if you’re using your own AWS credentials.
    's3://mage-demo-public/battle-history-versioned/1337',
    storage_options={
        'AWS_ACCESS_KEY_ID': '...',
        'AWS_SECRET_ACCESS_KEY': '...',
    },
    version=0,
)
dt.to_pandas()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The table returned will only include data from the planet Aiur because the 1st append operation only had data from that planet. If you change the &lt;code&gt;version&lt;/code&gt; argument value from 0 to 1, the table will include data from Aiur and Eos.&lt;/p&gt;




&lt;h3&gt;
  
  
  Craft data pipeline (optional)
&lt;/h3&gt;

&lt;p&gt;If you made it this far, then you’re determined to stop the Gold Legion for good. In order to do that, we must build a data pipeline that will continuously gather magic energy in addition to constantly collecting battle data from space.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FwgMrca8TQV6rztquoSbG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FwgMrca8TQV6rztquoSbG" alt="Image description" width="700" height="525"&gt;&lt;/a&gt; Load data, transform data, export data&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once this data is loaded, we’ll transform the data by deciphering its arcane knowledge and combining it all into a single concentrated source of magical energy.&lt;/p&gt;

&lt;p&gt;The ancients, that came to our planet thousands of years before us, knew this day would come. They crafted a magical data pipeline tool called &lt;a href="https://www.mage.ai/" rel="noopener noreferrer"&gt;Mage&lt;/a&gt; that we’ll use to fight the enemy.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FEs1wRBIyTxacZg5KvDfy" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FEs1wRBIyTxacZg5KvDfy" alt="Image description" width="700" height="525"&gt;&lt;/a&gt; Magical data pipelines&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;a href="https://demo.mage.ai/" rel="noopener noreferrer"&gt;demo.mage.ai&lt;/a&gt;, and click the &lt;strong&gt;New&lt;/strong&gt; button in the top left corner, and select the option labeled &lt;strong&gt;Standard (batch)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FK2W0uOlHRM2lZ5DY70qc" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FK2W0uOlHRM2lZ5DY70qc" alt="Image description" width="700" height="518"&gt;&lt;/a&gt; Create new data pipeline&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Load magic energy
&lt;/h3&gt;

&lt;p&gt;We’ll load the magic energy from the cosmos by reading a table using Delta Lake.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the button + &lt;strong&gt;Data loader&lt;/strong&gt;, select &lt;strong&gt;Python&lt;/strong&gt;, and click the option labeled &lt;strong&gt;Generic (no template)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FtkSe8XtcQsSxnjQkz6Qj" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FtkSe8XtcQsSxnjQkz6Qj" alt="Image description" width="700" height="509"&gt;&lt;/a&gt; Add data loader block&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste the following code into the text area:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from deltalake import DeltaTable


@data_loader
def load_data(*args, **kwargs):
    dt = DeltaTable(
        's3://mage-demo-public/magic-energy/1337', 
        storage_options={
            'AWS_ACCESS_KEY_ID': '...',
            'AWS_SECRET_ACCESS_KEY': '...',
        },
    )
    return dt.to_pandas()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Use the following read-only AWS credentials to read from S3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AWS_ACCESS_KEY_ID=AKIAZ4SRK3YKQJVOXW3Q
AWS_SECRET_ACCESS_KEY=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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Click the play icon button in the top right corner of the block to run the code:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fq50VlCytRXulUhzFq9Pb" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fq50VlCytRXulUhzFq9Pb" alt="Image description" width="800" height="754"&gt;&lt;/a&gt; Run code and preview results&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Transform data
&lt;/h3&gt;

&lt;p&gt;Now that we’ve retrieved the magic energy from the cosmos, let’s combine it with the battle history data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the button + &lt;strong&gt;Transformer&lt;/strong&gt;, select &lt;strong&gt;Python&lt;/strong&gt;, and click the option labeled &lt;strong&gt;Generic (no template)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fo4MSyjS5S1qGxdOsypyz" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fo4MSyjS5S1qGxdOsypyz" alt="Image description" width="800" height="216"&gt;&lt;/a&gt; Add transformer block&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste the following code into the text area:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from deltalake import DeltaTable
import pandas as pd


@transformer
def transform(magic_energy, *args, **kwargs):
    dt = DeltaTable(
        # Change this to your unique URI from a previous step
        # if you’re using your own AWS credentials.
        's3://mage-demo-public/battle-history/1337',
       storage_options={
            'AWS_ACCESS_KEY_ID': '...',
            'AWS_SECRET_ACCESS_KEY': '...',
        },
    )
    battle_history = dt.to_pandas()

    return pd.concat([magic_energy, battle_history])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Click the play icon button in the top right corner of the block to run the code:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FSSdMej3QwuATquOObteQ" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FSSdMej3QwuATquOObteQ" alt="Image description" width="800" height="917"&gt;&lt;/a&gt; Run code and preview results&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Export data
&lt;/h3&gt;

&lt;p&gt;Now that we’ve combined millennia worth of battle data with magical energy from countless planets, we can channel that single source of energy into Earth’s Avatar of the Lake.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the button + &lt;strong&gt;Data exporter&lt;/strong&gt;, select &lt;strong&gt;Python&lt;/strong&gt;, and click the option labeled &lt;strong&gt;Generic (no template)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Ff202x18T7CR6Idg46T4w" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Ff202x18T7CR6Idg46T4w" alt="Image description" width="700" height="195"&gt;&lt;/a&gt; Add data exporter block&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste the following code into the text area:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from deltalake.writer import write_deltalake


@data_exporter
def export_data(combined_data, *args, **kwargs):
    write_deltalake(
        # Change this URI to your own unique URI
        's3://mage-demo-public/magic-energy-and-battle-history/1337',
        data=combined_data,
        mode='overwrite',
        overwrite_schema=True,
        storage_options={
            'AWS_REGION': '...',
            'AWS_ACCESS_KEY_ID': '...',
            'AWS_SECRET_ACCESS_KEY': '...',
            'AWS_S3_ALLOW_UNSAFE_RENAME': 'true',
        },
        partition_by=['planet'],
    )

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Click the play icon button in the top right corner of the block to run the code:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fp45PSxlCSQqaEzb5Wtp0" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Fp45PSxlCSQqaEzb5Wtp0" alt="Image description" width="800" height="480"&gt;&lt;/a&gt; Run code&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Your final magical data pipeline should look something like this:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FuDBpBazBRg6CjjFcAN0R" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FuDBpBazBRg6CjjFcAN0R" alt="Image description" width="700" height="743"&gt;&lt;/a&gt; Data pipeline in Mage&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Data partitioning
&lt;/h3&gt;

&lt;p&gt;Partitioning your data can improve read performance when querying records. Delta Lake makes data partitioning very easy. In the last data exporter step, we used a keyword argument named &lt;code&gt;partition_by&lt;/code&gt; with the value &lt;code&gt;['planet']&lt;/code&gt;. This will partition the data by the values in the &lt;code&gt;planet&lt;/code&gt; column.&lt;/p&gt;

&lt;p&gt;To retrieve the data for a specific partition, use the following API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from deltalake import DeltaTable


dt = DeltaTable(
    # Change this to your unique URI from a previous step
    # if you’re using your own AWS credentials.
    's3://mage-demo-public/magic-energy-and-battle-history/1337',
    storage_options={
        'AWS_ACCESS_KEY_ID': '...',
        'AWS_SECRET_ACCESS_KEY': '...',
    },
)
dt.to_pandas(partitions=[('planet', '=', 'Gaia')])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will return data only for the planet Gaia.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final battle
&lt;/h2&gt;

&lt;p&gt;The Gold Legion’s armies descend upon Earth to annihilate all that stand in its way.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FiJS9GWx8TEGRtorIJXIa" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FiJS9GWx8TEGRtorIJXIa" alt="Image description" width="700" height="525"&gt;&lt;/a&gt; Invasion of Earth&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As Earth makes its final stand, mages across the planet channel their energy to summon the Avatar of the Lake from its century long slumber.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FS1EsBnzoTKCCwuGZRKwx" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FS1EsBnzoTKCCwuGZRKwx" alt="Image description" width="700" height="525"&gt;&lt;/a&gt; Summon the Avatar&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The Gold Legion’s forces clash with the Avatar. At the start of the battle, the Avatar of the Lake land several powerful blows against the enemy; destroying many of their forces. However, the Gold Legion combines all of its forces into a single entity and goes on the offensive.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FzKtX64jcQuuT5vz2gTj8" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FzKtX64jcQuuT5vz2gTj8" alt="Image description" width="800" height="599"&gt;&lt;/a&gt; Gold Legion’s final boss&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Earth’s Avatar is greatly damaged and weakened after a barrage of attacks from the Gold Legion’s unified entity. When all hope seemed lost, the magic energy from the cosmos and the battle data from the fabric of space finally merges together and is exported from Earth into the Avatar; filling it with unprecedented celestial power.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FrVX5s5xMT5KeTEa0v6yb" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FrVX5s5xMT5KeTEa0v6yb" alt="Image description" width="700" height="525"&gt;&lt;/a&gt; Avatar of the Lake at full power&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The Avatar of the Lake, filled with magic power, destroys the Gold Legion and crushes their will to fight. The invaders leave the galaxy and never return!&lt;/p&gt;

&lt;h2&gt;
  
  
  Epilogue
&lt;/h2&gt;

&lt;p&gt;Congratulations! You learned how to use Delta Lake to create tables and read tables. Using that knowledge, you successfully saved the multi-verse.&lt;/p&gt;

&lt;p&gt;In addition, you defended Earth by using &lt;a href="https://www.mage.ai/" rel="noopener noreferrer"&gt;Mage&lt;/a&gt; to create a data pipeline to load data from different sources, transform that data, and export the final data product using Delta Lake.&lt;/p&gt;

&lt;p&gt;The multi-verse can rest easy knowing heroes like you exist.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Ffl93zJZTEh3ilrkbkHAv" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2Ffl93zJZTEh3ilrkbkHAv" alt="Image description" width="700" height="333"&gt;&lt;/a&gt; You’re a Hero!&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Stay tuned for the next episode in the series where you’ll learn how to build low-code data integration pipelines syncing data between various sources and destinations with Delta Lake.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Link to original blog: &lt;a href="https://www.mage.ai/blog/how-to-build-a-data-pipeline-using-delta-lake" rel="noopener noreferrer"&gt;https://www.mage.ai/blog/how-to-build-a-data-pipeline-using-delta-lake&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Getting started with Apache Flink: A guide to stream processing</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Mon, 15 May 2023 23:05:15 +0000</pubDate>
      <link>https://forem.com/mage_ai/getting-started-with-apache-flink-a-guide-to-stream-processing-e19</link>
      <guid>https://forem.com/mage_ai/getting-started-with-apache-flink-a-guide-to-stream-processing-e19</guid>
      <description>&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;This guide introduces &lt;a href="https://flink.apache.org/" rel="noopener noreferrer"&gt;Apache Flink&lt;/a&gt; and stream processing, explaining how to set up a Flink environment and create simple applications. Key Flink concepts are covered along with basic troubleshooting and monitoring techniques. It ends with resources for further learning and community support.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction to Apache Flink and stream processing&lt;/li&gt;
&lt;li&gt;Setting up a Flink development environment&lt;/li&gt;
&lt;li&gt;A simple Flink application walkthrough: data ingestion, processing, and output&lt;/li&gt;
&lt;li&gt;Understanding Flink’s key concepts (DataStream API, windows, transformations, sinks, sources)&lt;/li&gt;
&lt;li&gt;Basic troubleshooting and monitoring for Flink applications&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction to Apache Flink and Stream Processing
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://flink.apache.org/" rel="noopener noreferrer"&gt;Apache Flink&lt;/a&gt; is an open-source, high-performance framework designed for large-scale data processing, excelling at real-time stream processing. It features low-latency and stateful computations, enabling users to process live data and generate insights on-the-fly. Flink is fault-tolerant, scalable, and provides powerful data processing capabilities that cater to various use cases.&lt;/p&gt;

&lt;p&gt;Stream processing, on the other hand, is a computing paradigm that allows &lt;strong&gt;real-time data processing&lt;/strong&gt; as soon as it arrives or is produced. Unlike traditional batch processing systems that deal with data at rest, stream processing handles data in motion. This paradigm is especially useful in scenarios where insights need to be derived immediately, such as real-time analytics, fraud detection, and event-driven systems. Flink's powerful stream-processing capabilities and its high-throughput, low-latency, and exactly-once processing semantics make it an excellent choice for such applications.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FXfzYO3WjQ7Wg5T3fL9XS" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FXfzYO3WjQ7Wg5T3fL9XS" alt="Image description" width="800" height="235"&gt;&lt;/a&gt;Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting up a Flink development environment
&lt;/h2&gt;

&lt;p&gt;Setting up a development environment for Apache Flink is a straightforward process. Here's a brief step-by-step guide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Install Java&lt;/em&gt;: Flink requires Java 8 or 11, so you need to have one of these versions installed on your machine. You can download Java from the &lt;a href="https://www.oracle.com/in/java/technologies/downloads/" rel="noopener noreferrer"&gt;Oracle&lt;/a&gt; website or use OpenJDK.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Download and Install Apache Flink&lt;/em&gt;: You can download the latest &lt;a href="https://flink.apache.org/downloads/" rel="noopener noreferrer"&gt;binary of Apache Flink&lt;/a&gt; from the official Flink website. Once downloaded, extract the files to a location of your choice.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Start a Local Flink Cluster&lt;/em&gt;: Navigate to the Flink directory in a terminal, then go to the &lt;strong&gt;'bin'&lt;/strong&gt; folder. Start a local Flink cluster using the command &lt;strong&gt;./start-cluster.sh&lt;/strong&gt; (for Unix/Linux/macOS) or &lt;strong&gt;start-cluster.bat&lt;/strong&gt; (for Windows).&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Check Flink Dashboard&lt;/em&gt;: Open a web browser and visit &lt;a href="http://localhost:8081/" rel="noopener noreferrer"&gt;http://localhost:8081&lt;/a&gt;, you should see the Flink Dashboard, indicating that your local Flink cluster is running successfully.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Set up an Integrated Development Environment (IDE)&lt;/em&gt;: For writing and testing your Flink programs, you can use an IDE such as &lt;strong&gt;IntelliJ IDEA&lt;/strong&gt; or Eclipse. Make sure to also install the Flink plugin if your IDE has one.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Create a Flink Project&lt;/em&gt;: You can create a new Flink project (Refer - &lt;a href="https://github.com/apache/flink-playgrounds" rel="noopener noreferrer"&gt;Apache Flink Playground&lt;/a&gt;) using a build tool like Maven or Gradle. Flink provides quickstart Maven archetypes to set up a new project easily.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you've set up your Flink development environment, you're ready to start developing Flink applications. Remember that while this guide describes a basic local setup, a production Flink setup would involve a distributed cluster and possibly integration with other big data tools.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FVrmaDEkrRgiDMgiFV1f0" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FVrmaDEkrRgiDMgiFV1f0" alt="Image description" width="480" height="480"&gt;&lt;/a&gt;Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  A simple Flink application walkthrough: Data ingestion, Processing and Output
&lt;/h2&gt;

&lt;p&gt;A simple Apache Flink application can be designed to consume a data stream, process it, and then output the results. Let's walk through a basic example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Data Ingestion (Sources)&lt;/em&gt;: Flink applications begin with one or more data sources. A source could be a file on a filesystem, a Kafka topic, or any other data stream.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Processing (Transformations)&lt;/em&gt;: Once the data is ingested, the next step is to process or transform it. This could involve filtering data, aggregating it, or applying any computation.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Output (Sinks)&lt;/em&gt;: The final step in a Flink application is to output the processed data, also known as a sink. This could be a file, a database, or a Kafka topic.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Job Execution&lt;/em&gt;: After defining the sources, transformations, and sinks, the Flink job needs to be executed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's a complete example that reads data from a Kafka topic, performs some basic word count processing on the stream, and then writes the results into a Cassandra table. This example uses Java and Flink's DataStream API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.connectors.cassandra.CassandraSink;
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer;
import org.apache.flink.util.Collector;
import org.apache.kafka.common.serialization.SimpleStringSchema;

import java.util.Properties;

public class KafkaToCassandraExample {

    public static void main(String[] args) throws Exception {

        final StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();

        Properties properties = new Properties();
        properties.setProperty("bootstrap.servers", "localhost:9092"); // address of your
Kafka server
        properties.setProperty("group.id", "test"); // specify your Kafka consumer group

        DataStream&amp;lt;String&amp;gt; stream = env.addSource(new FlinkKafkaConsumer&amp;lt;&amp;gt;("topic", new
SimpleStringSchema(), properties));

        DataStream&amp;lt;Tuple2&amp;lt;String, Integer&amp;gt;&amp;gt; processedStream = stream
                .flatMap(new Tokenizer())
                .keyBy(0)
                .sum(1);

        CassandraSink.addSink(processedStream)
                .setQuery("INSERT INTO wordcount.word_count (word, count) values (?, ?);")
                .setHost("127.0.0.1") // address of your Cassandra server
                .build();

        env.execute("Kafka to Cassandra Word Count Example");
    }

    public static final class Tokenizer implements FlatMapFunction&amp;lt;String, Tuple2&amp;lt;String,
Integer&amp;gt;&amp;gt; {
        @Override
        public void flatMap(String value, Collector&amp;lt;Tuple2&amp;lt;String, Integer&amp;gt;&amp;gt; out) {
            // normalize and split the line into words
            String[] words = value.toLowerCase().split("\\W+");

            // emit the words
            for (String word : words) {
                if (word.length() &amp;gt; 0) {
                    out.collect(new Tuple2&amp;lt;&amp;gt;(word, 1));
                }
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FwU9KSF8KS7mRcyasWM9g" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FwU9KSF8KS7mRcyasWM9g" alt="Image description" width="272" height="272"&gt;&lt;/a&gt;Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Flink’s key concepts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/dev/datastream/overview/" rel="noopener noreferrer"&gt;DataStream API&lt;/a&gt;: Flink's main tool for creating stream processing applications, providing operations to transform data streams.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/windows/" rel="noopener noreferrer"&gt;Windows&lt;/a&gt;: Defines a finite set of stream events for computations, based on count, time, or sessions.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-master/docs/dev/dataset/transformations/" rel="noopener noreferrer"&gt;Transformations&lt;/a&gt;: Operations applied to data streams to produce new streams, including map, filter, flatMap, keyBy, reduce, aggregate, and window.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/connectors/datastream/overview/" rel="noopener noreferrer"&gt;Sinks&lt;/a&gt;: The endpoints of Flink applications where processed data ends up, such as a file, database, or message queue.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/connectors/datastream/overview/" rel="noopener noreferrer"&gt;Sources&lt;/a&gt;: The starting points of Flink applications that ingest data from external systems or generate data internally, such as a file or Kafka topic.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-master/docs/concepts/time/" rel="noopener noreferrer"&gt;Event Time vs. Processing Time&lt;/a&gt;: Flink supports different notions of time in stream processing. Event time is the time when an event occurred, while processing time is the time when the event is processed by the system. Flink excels at event time processing, which is crucial for correct results in many scenarios.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-master/docs/libs/cep/#:~:text=FlinkCEP%20is%20the%20Complex%20Event,what's%20important%20in%20your%20data." rel="noopener noreferrer"&gt;CEP (Complex Event Processing)&lt;/a&gt;: Flink supports CEP, which is the ability to detect patterns and complex conditions across multiple streams of events.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/overview/" rel="noopener noreferrer"&gt;Table API &amp;amp; SQL&lt;/a&gt;: Flink offers a Table API and SQL interface for batch and stream processing. This allows users to write complex data processing applications using a SQL-like expression language.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-statefun-docs-master/" rel="noopener noreferrer"&gt;Stateful Functions (StateFun)&lt;/a&gt;: StateFun is a framework by Apache Flink designed to build distributed, stateful applications. It provides a way to define, manage, and interact with a dynamically evolving distributed state of functions.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/concepts/flink-architecture/" rel="noopener noreferrer"&gt;Operator Chain and Task&lt;/a&gt;: Flink operators (transformations) can be chained together into a task for efficient execution. This reduces the overhead of thread-to-thread handover and buffering.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-master/docs/ops/state/savepoints/" rel="noopener noreferrer"&gt;Savepoints&lt;/a&gt;: Savepoints are similar to checkpoints, but they are triggered manually and provide a way to version and manage the state of Flink applications. They are used for planned maintenance and application upgrades.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/fault-tolerance/state/" rel="noopener noreferrer"&gt;State Management&lt;/a&gt;: Flink provides fault-tolerant state management, meaning it can keep track of the state of an application (e.g., the last processed event) and recover it if a failure occurs.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/event-time/generating_watermarks/" rel="noopener noreferrer"&gt;Watermarks&lt;/a&gt;: These are a mechanism to denote progress in event time. Flink uses watermarks to handle late events in stream processing, ensuring the system can handle out-of-order events and provide accurate results.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-master/docs/ops/state/checkpoints/" rel="noopener noreferrer"&gt;Checkpoints&lt;/a&gt;: Checkpoints are a snapshot of the state of a Flink application at a particular point in time. They provide fault tolerance by allowing an application to revert to a previous state in case of failures.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FItrfQ7AJSSWiyezLHL89" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FItrfQ7AJSSWiyezLHL89" alt="Image description" width="480" height="480"&gt;&lt;/a&gt;Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic troubleshooting and monitoring in Flink
&lt;/h2&gt;

&lt;p&gt;Troubleshooting and monitoring are essential aspects of running Apache Flink applications. Here are some key concepts and tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.cloudera.com/csa/1.2.0/monitoring/topics/csa-hs-webui.html" rel="noopener noreferrer"&gt;Flink Dashboard&lt;/a&gt;: This web-based user interface provides an overview of your running applications, including statistics on throughput, latency, and CPU/memory usage. It also allows you to drill down into individual tasks to identify bottlenecks or issues.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/deployment/advanced/logging/" rel="noopener noreferrer"&gt;Logging&lt;/a&gt;: Flink uses SLF4J for logging. Logs can be crucial for diagnosing problems or understanding the behavior of your applications. Log files can be found in the log directory in your Flink installation.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-master/docs/ops/metrics/" rel="noopener noreferrer"&gt;Metrics&lt;/a&gt;: Flink exposes a wide array of system and job-specific metrics, such as the number of elements processed, bytes read/written, task/operator/JobManager/TaskManager statistics, and more. These metrics can be integrated with external systems like Prometheus or Grafana.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://catalog.us-east-1.prod.workshops.aws/workshops/429cec9e-3222-4943-82f7-1f45c45ed99a/en-US/2-flinkdashboard/job-level-insights" rel="noopener noreferrer"&gt;Exceptions&lt;/a&gt;: If your application fails to run, Flink will throw an exception with a stack trace, which can provide valuable information about the cause of the error. Reviewing these exceptions can be a key part of troubleshooting.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://catalog.us-east-1.prod.workshops.aws/workshops/429cec9e-3222-4943-82f7-1f45c45ed99a/en-US/2-flinkdashboard/job-level-insights" rel="noopener noreferrer"&gt;Savepoints/Checkpoints&lt;/a&gt;: These provide a mechanism to recover your application from failures. If your application isn't recovering correctly, it's worth investigating whether savepoints/checkpoints are being made correctly and can be successfully restored.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://nightlies.apache.org/flink/flink-docs-master/docs/ops/monitoring/back_pressure/" rel="noopener noreferrer"&gt;Backpressure&lt;/a&gt;: If a part of your data flow cannot process events as fast as they arrive, it can cause backpressure, which can slow down the entire application. The Flink dashboard provides a way to monitor this.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Network Metrics&lt;/em&gt;: Flink provides metrics on network usage, including buffer usage and backpressure indicators. These can be useful for diagnosing network-related issues.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember, monitoring and troubleshooting are iterative processes. If you notice performance degradation or failures, use these tools and techniques to investigate, identify the root cause, and apply a fix. Then monitor the system again to ensure that the problem has been resolved.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FrvCzYF1QeqhGRcxvfBFn" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.graphassets.com%2FrvCzYF1QeqhGRcxvfBFn" alt="Image description" width="480" height="270"&gt;&lt;/a&gt;Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, Apache Flink is a robust and versatile open-source stream processing framework that enables fast, reliable, and sophisticated processing of large-scale data streams. Starting with a simple environment setup, we've walked through creating a basic Flink application that ingests, processes, and outputs data. We've also touched on the foundational concepts of Flink, such as the DataStream API, windows, transformations, sinks, and sources, all of which serve as building blocks for more complex applications.&lt;/p&gt;

&lt;p&gt;In episode 4 of Apache Flink series, we'll see how to consume data from kafka in real time and process it with Mage.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Link to the original blog&lt;/em&gt;: &lt;a href="https://www.mage.ai/blog/getting-started-with-apache-flink-a-guide-to-stream-processing" rel="noopener noreferrer"&gt;https://www.mage.ai/blog/getting-started-with-apache-flink-a-guide-to-stream-processing&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flink</category>
      <category>streamprocessing</category>
      <category>dataprocessing</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Apache Flink vs Apache Spark: A detailed comparison for data processing</title>
      <dc:creator>Mage AI</dc:creator>
      <pubDate>Mon, 08 May 2023 22:01:10 +0000</pubDate>
      <link>https://forem.com/mage_ai/apache-flink-vs-apache-spark-a-detailed-comparison-for-data-processing-36d3</link>
      <guid>https://forem.com/mage_ai/apache-flink-vs-apache-spark-a-detailed-comparison-for-data-processing-36d3</guid>
      <description>&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;Dive into a comprehensive comparison of Apache Flink and Apache Spark, exploring their differences and strengths in data processing, to help you decide which framework best suits your data processing needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction to Apache Flink and Apache Spark&lt;/li&gt;
&lt;li&gt;Comparison of key features&lt;/li&gt;
&lt;li&gt;Performance benchmarks and scalability&lt;/li&gt;
&lt;li&gt;Recommendations for choosing the right tool for specific use cases&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction to Apache Flink and Apache Spark
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://flink.apache.org/" rel="noopener noreferrer"&gt;Apache Flink&lt;/a&gt; is an open-source, high-performance framework designed for large-scale data processing, excelling at real-time stream processing. It features low-latency and stateful computations, enabling users to process live data and generate insights on-the-fly. Flink is fault-tolerant, scalable, and provides powerful data processing capabilities that cater to various use cases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://spark.apache.org/" rel="noopener noreferrer"&gt;Apache Spark&lt;/a&gt;, on the other hand, is a versatile, open-source data processing framework that offers an all-in-one solution for batch processing, machine learning, and graph processing. It is known for its ease of use and comprehensive library of built-in tools and algorithms. Like Flink, Spark is fault-tolerant, scalable, and delivers high-performance data processing. Spark's versatility makes it suitable for a wide range of applications and industries.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1a5xgixwvpxg5shv2fi1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1a5xgixwvpxg5shv2fi1.gif" alt="Image description" width="480" height="270"&gt;&lt;/a&gt;Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparison of key features
&lt;/h2&gt;

&lt;p&gt;Apache Flink and Apache Spark differ in numerous ways; let's examine their distinctions by comparing key features.&lt;/p&gt;

&lt;h3&gt;
  
  
  Processing Models:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Apache Flink&lt;/em&gt;: Primarily focused on real-time stream processing, Flink efficiently processes large volumes of data with low-latency. Flink's processing engine is built on top of its own streaming runtime and can also handle batch processing.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Apache Spark&lt;/em&gt;: Originally designed for batch processing, Spark later introduced a micro-batching model for handling streaming data. While it can process streaming data, its performance in terms of latency is generally higher than Flink's.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  APIs and Libraries:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Apache Flink&lt;/em&gt;: Provides a robust set of APIs in Java, Scala, and Python for developing data processing applications. Flink's libraries include FlinkML for machine learning, FlinkCEP for complex event processing, and Gelly for graph processing.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Apache Spark&lt;/em&gt;: Offers APIs in Java, Scala, Python, and R, making it accessible to a wider range of developers. Spark also has comprehensive libraries, such as MLlib for machine learning, GraphX for graph processing, and Spark Streaming for processing real-time data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Fault Tolerance:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Apache Flink&lt;/em&gt;: Utilizes a distributed snapshotting mechanism, allowing for quick recovery from failures. The state of the processing pipeline is periodically checkpointed, ensuring data consistency in case of failures.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Apache Spark&lt;/em&gt;: Employs a lineage information-based approach for fault tolerance. Spark keeps track of the data transformation sequence, enabling it to recompute lost data in case of failures.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Windowing:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Apache Flink&lt;/em&gt;: Offers advanced windowing capabilities, including event-time and processing-time windows, as well as session windows for handling complex event patterns. Flink's windowing features are particularly suitable for real-time stream processing.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Apache Spark&lt;/em&gt;: Provides basic windowing functionality, such as tumbling and sliding windows, which work well for batch and micro-batching scenarios but may not be as suited for real-time stream processing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxmplxygwq7cp2c3h7t1z.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxmplxygwq7cp2c3h7t1z.gif" alt="Image description" width="480" height="480"&gt;&lt;/a&gt;Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance benchmark &amp;amp; scalability
&lt;/h2&gt;

&lt;p&gt;Dive into a comparison of Flink and Spark based on their performance benchmarks and scalability. Discover how they handle processing speed, in-memory computing, resource management, and more.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Processing Speed&lt;/em&gt;: Flink excels in &lt;strong&gt;low-latency&lt;/strong&gt;, high-throughput stream processing, while Spark is known for its fast batch processing capabilities. Both frameworks can process large volumes of data quickly, with Flink focusing on real-time analytics and Spark catering to &lt;strong&gt;batch&lt;/strong&gt; data processing tasks.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;In-Memory Computing&lt;/em&gt;: Both Flink and Spark leverage in-memory computing, which allows them to cache intermediate results during data processing tasks. This approach significantly reduces the time spent on &lt;strong&gt;disk I/O&lt;/strong&gt; operations and improves overall performance.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Resource Management&lt;/em&gt;: Flink and Spark can efficiently manage resources by &lt;strong&gt;dynamically&lt;/strong&gt; allocating and deallocating them according to workload requirements. This enables both frameworks to scale horizontally, handling large-scale data processing tasks across multiple nodes in a distributed environment.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Adaptive Query Execution&lt;/em&gt;: Spark's Adaptive Query Execution (&lt;strong&gt;AQE&lt;/strong&gt;) feature optimizes query execution plans at runtime, allowing it to adapt to changing data and workload characteristics. This results in improved performance and resource utilization. Flink, on the other hand, does not currently have an equivalent feature.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Backpressure Handling&lt;/em&gt;: Flink is designed to handle backpressure, ensuring that the system remains stable even under high loads. This is achieved through its built-in flow control mechanisms, which prevent data processing bottlenecks. Spark Streaming, in contrast, may &lt;strong&gt;struggle&lt;/strong&gt; to handle &lt;strong&gt;backpressure&lt;/strong&gt;, leading to potential performance degradation.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Data Partitioning&lt;/em&gt;: Both Flink and Spark utilize data partitioning techniques to improve parallelism and optimize resource utilization during data processing tasks. While Spark employs RDDs and data partitioning strategies like Hash and Range partitioning, Flink uses **operator chaining **and pipelined execution to optimize data processing performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0yxwez3vctmtr7yy2ue4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0yxwez3vctmtr7yy2ue4.gif" alt="Image description" width="237" height="185"&gt;&lt;/a&gt;Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Recommendations for choosing the right tool for specific use cases
&lt;/h2&gt;

&lt;p&gt;When selecting the right tool between Flink and Spark for specific use cases, consider the following unique technical aspects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Real-time processing&lt;/em&gt;: If low-latency, real-time processing is a priority, Flink is the better choice, as it was designed specifically for streaming data and offers near-instantaneous processing capabilities.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Batch processing&lt;/em&gt;: Spark excels in batch processing and large-scale data processing tasks, with its powerful in-memory processing capabilities and optimized execution engine. If your primary focus is on batch processing, Spark is the recommended choice.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Machine Learning&lt;/em&gt;: &lt;a href="https://spark.apache.org/mllib/" rel="noopener noreferrer"&gt;Spark's MLlib&lt;/a&gt; library offers a comprehensive suite of machine learning algorithms and utilities. If machine learning is a key aspect of your project, Spark is a more suitable choice.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Graph processing&lt;/em&gt;: If your use case involves graph processing, Spark's &lt;a href="https://spark.apache.org/graphx/" rel="noopener noreferrer"&gt;GraphX library&lt;/a&gt; provides a robust and flexible solution for large-scale graph computations. Flink, on the other hand, has Gelly for graph processing, but it is less mature compared to GraphX.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Stateful processing&lt;/em&gt;: Flink provides better support for stateful processing, making it ideal for use cases that require maintaining and updating state information during stream processing.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;API maturity&lt;/em&gt;: While both Flink and Spark provide APIs for various programming languages, Spark's APIs are more mature and stable, providing a better user experience and a wider range of features.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Community and ecosystem&lt;/em&gt;: Spark boasts a more extensive community and ecosystem, offering more resources, support, and third-party integrations. This can be a decisive factor if community support is important for your project.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Deployment options&lt;/em&gt;: Flink provides more flexibility in deployment, as it can be LLdeployed as a standalone cluster, on YARN, or Kubernetes. Spark, although it also supports YARN and Kubernetes, might have some limitations in standalone mode.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall, the choice between Flink and Spark depends on the specific requirements of your use case, such as machine learning capabilities, graph processing, stateful processing, API maturity, community support, and deployment options.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;center&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftfg1r3r27hri7g6syh70.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftfg1r3r27hri7g6syh70.gif" alt="Image description" width="500" height="276"&gt;&lt;/a&gt;Source: Giphy&lt;/center&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, Apache Flink and Apache Spark are both powerful data processing frameworks, each with its unique strengths and capabilities. The choice between the two depends on your specific use case and requirements. Flink is particularly well-suited for stateful and real-time stream processing, while Spark excels in machine learning and graph processing. Ultimately, understanding the key differences, performance benchmarks, and scalability aspects of both frameworks will help you make an informed decision for your project. Consider factors such as API maturity, community support, and deployment options, along with the technical requirements of your application, to select the best tool that meets your needs.&lt;/p&gt;

&lt;p&gt;In episode 3 of Apache Flink series, we'll see how to get started with Apache Flink.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Link to the original blog&lt;/em&gt;: &lt;a href="https://www.mage.ai/blog/apache-flink-vs-apache-spark-detailed-comparison-for-data-processing" rel="noopener noreferrer"&gt;https://www.mage.ai/blog/apache-flink-vs-apache-spark-detailed-comparison-for-data-processing&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apacheflink</category>
      <category>apachespark</category>
      <category>dataprocessing</category>
      <category>dataengineering</category>
    </item>
  </channel>
</rss>
