Reader small image

You're reading from  Building ETL Pipelines with Python

Product typeBook
Published inSep 2023
PublisherPackt
ISBN-139781804615256
Edition1st Edition
Right arrow
Authors (2):
Brij Kishore Pandey
Brij Kishore Pandey
author image
Brij Kishore Pandey

Brij Kishore Pandey stands as a testament to dedication, innovation, and mastery in the vast domains of software engineering, data engineering, machine learning, and architectural design. His illustrious career, spanning over 14 years, has seen him wear multiple hats, transitioning seamlessly between roles and consistently pushing the boundaries of technological advancement. He has a degree in electrical and electronics engineering. His work history includes the likes of JP Morgan Chase, American Express, 3M Company, Alaska Airlines, and Cigna Healthcare. He is currently working as a principal software engineer at Automatic Data Processing Inc. (ADP). Originally from India, he resides in Parsippany, New Jersey, with his wife and daughter.
Read more about Brij Kishore Pandey

Emily Ro Schoof
Emily Ro Schoof
author image
Emily Ro Schoof

Emily Ro Schoof is a dedicated data specialist with a global perspective, showcasing her expertise as a data scientist and data engineer on both national and international platforms. Drawing from a background rooted in healthcare and experimental design, she brings a unique perspective of expertise to her data analytic roles. Emily's multifaceted career ranges from working with UNICEF to design automated forecasting algorithms to identify conflict anomalies using near real-time media monitoring to serving as a subject matter expert for General Assembly's Data Engineering course content and design. Her mission is to empower individuals to leverage data for positive impact. Emily holds the strong belief that providing easy access to resources that merge theory and real-world applications is the essential first step in this process.
Read more about Emily Ro Schoof

View More author details
Right arrow

Understanding the ETL Process and Data Pipelines

With a firm foundation of Python under our belts and a clean development environment established, we can now pivot to talking about the fundamentals of data pipelines.

Within this chapter, we will define what a data pipeline is, as well as take a more in-depth look at the process of building robust pipelines. We will then discuss different approaches, such as the Extract, Transform, and Load (ETL) and Extract, Load, and Transform (ELT) methodologies, and how they tie into effectively automating data movement.

By the end of this chapter, you will have an established workflow for building data pipelines within your local environment and will have covered the following topics:

  • What is a data pipeline?
  • Creating robust data pipelines
  • What is an ETL pipeline? How do ETL pipelines differ from ELT pipelines?
  • Automating ETL pipelines
  • Examples of use cases of ETL pipelines

What is a data pipeline?

A data pipeline is a series of tasks, such as transformations, filters, aggregations, and merging multiple sources, before outputting the processed data into some target. In layman’s terms, a data pipeline gets data from the “source” to the “target,” as depicted in the following diagram:

Figure 2.1: A sample ETL process illustration

Figure 2.1: A sample ETL process illustration

You can think of pipelines as transport tubes in a mailroom. Mail can be placed in specific tubes and sucked up to specific processing centers. Based on specific labels, the mail is then moved and sorted into specific pathways that eventually bring it to its destination. The core concept of data pipelines is quite similar. Like mail, packets of raw data are ingested into the entry of the pipeline and, through a series of steps and processes, the raw material is formatted and packaged into an output location, which is most commonly used for storage.

From a business...

How do we create a robust pipeline?

A data pipeline is only as scalable as its foundation is strong. It is crucial to meticulously design an architectural plan, which includes anything from defining the types of data that need to be collected to the methodologies used to analyze the data, to create a sustainable data environment (Reference #2). Just as a data pipeline built with a strong architecture is easily maintainable and scalable, so too is a weak data pipeline at high risk of failure, either structurally or analytically producing an inaccurate product, and having staggering consequences.

The following are the attributes of a robust data pipeline:

  • Clearly defined expectations
  • Scalable architecture
  • Reproducible and clear

A robust data pipeline should have clearly defined expectations in terms of the data it is processing and the results it is expected to produce. This includes specifying the types and sources of data, as well as the desired output format...

What is an ETL data pipeline?

ETL stands for Extract, Transform, and Load. In an ELT process, data is first extracted from a source, then transformed and formatted in a specific way, and finally loaded into a final storage location. These pipelines are useful for organizing and preparing data for future purposes such as performing analysis and model creation smoothly and efficiently:

Figure 2.4: Sample ETL pipeline

Figure 2.4: Sample ETL pipeline

ELT stands for Extract, Load, and Transform, and is similar to ETL, but the data is first loaded into the target system and then transformed within the target system.

Which one to use depends on the specific requirements and characteristics of the systems involved and the data being moved. Here are a few factors that you might consider when deciding between ETL and ELT:

  • Data volume: If the volume of data is very large, ELT might be more efficient because the transformation step can be done in parallel within the target system
  • ...

Automating ETL pipelines

To streamline and optimize the ETL process in a production environment, there are several tools and technologies available to automate the pipeline. These tools are particularly important in an enterprise setting, where the volume and complexity of data can be significant. In this section, we will discuss the most important and relevant tools used in an enterprise environment.

There are several key benefits to automating ETL pipelines:

  • Data democratization: Automating the ETL process can make it easier for a wider range of users to access and use data since the process of extracting, transforming, and loading data is streamlined and made more efficient
  • Robust data availability and access: By automating the ETL process, data is made more consistently available and accessible to users since the pipelines are designed to run regularly and can be easily configured to handle any changes or updates to the source data
  • Team focus: Automating ETL...

Exploring use cases for ETL pipelines

Now, we will cover the benefits and uses of ETL pipelines in organizations:

  • Benefits of ETL pipelines:
    • Allow developers and engineers to focus on useful tasks rather than worrying about data
    • Free up time for developers, engineers, and scientists to focus on actual work
    • Help organizations move data from one place to another and transform it into a desired format efficiently and systematically
  • Applications of ETL pipelines:
    • Migrating data from a legacy platform to the cloud and vice versa
    • Centralizing data sources to have a consolidated view of data
    • Providing stable data sources for data-driven applications and data analytic tools
    • Acting as a blueprint for organizational data, serving as a single source of truth
  • Example of an ETL pipeline in action:
    • Netflix has a very robust ETL pipeline that manages petabytes of data, allowing them to employ a small team of engineers to handle admin tasks related to data
  • Overall benefits of ETL pipelines...

Summary

In this chapter, we learned about data pipelines and the ETL process, as well as the different approaches and types of ETL pipelines, including batch processing, streaming, and cloud-native. We also learned about the benefits of automating ETL pipelines, such as schema management and data quality. In the next chapter, we will learn about the process of creating a scalable and resilient pipeline.

References

To learn more about the topics that were covered in this chapter, take a look at the following resources:

  1. ETL and its impact on Business Intelligence: https://www.academia.edu/11434594/ETL_and_its_impact_on_Business_Intelligence?email_work_card=title
  2. A Five-Layered Business Intelligence Architecture: https://www.academia.edu/25962611/A_Five_Layered_Business_Intelligence_Architecture?email_work_card=view-paper
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Building ETL Pipelines with Python
Published in: Sep 2023Publisher: PacktISBN-13: 9781804615256
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Brij Kishore Pandey

Brij Kishore Pandey stands as a testament to dedication, innovation, and mastery in the vast domains of software engineering, data engineering, machine learning, and architectural design. His illustrious career, spanning over 14 years, has seen him wear multiple hats, transitioning seamlessly between roles and consistently pushing the boundaries of technological advancement. He has a degree in electrical and electronics engineering. His work history includes the likes of JP Morgan Chase, American Express, 3M Company, Alaska Airlines, and Cigna Healthcare. He is currently working as a principal software engineer at Automatic Data Processing Inc. (ADP). Originally from India, he resides in Parsippany, New Jersey, with his wife and daughter.
Read more about Brij Kishore Pandey

author image
Emily Ro Schoof

Emily Ro Schoof is a dedicated data specialist with a global perspective, showcasing her expertise as a data scientist and data engineer on both national and international platforms. Drawing from a background rooted in healthcare and experimental design, she brings a unique perspective of expertise to her data analytic roles. Emily's multifaceted career ranges from working with UNICEF to design automated forecasting algorithms to identify conflict anomalies using near real-time media monitoring to serving as a subject matter expert for General Assembly's Data Engineering course content and design. Her mission is to empower individuals to leverage data for positive impact. Emily holds the strong belief that providing easy access to resources that merge theory and real-world applications is the essential first step in this process.
Read more about Emily Ro Schoof