Data Engineering with Apache Spark, Delta Lake, and Lakehouse

Book description

Understand the complexities of modern-day data engineering platforms and explore strategies to deal with them with the help of use case scenarios led by an industry expert in big data

Key Features

  • Become well-versed with the core concepts of Apache Spark and Delta Lake for building data platforms
  • Learn how to ingest, process, and analyze data that can be later used for training machine learning models
  • Understand how to operationalize data models in production using curated data

Book Description

In the world of ever-changing data and schemas, it is important to build data pipelines that can auto-adjust to changes. This book will help you build scalable data platforms that managers, data scientists, and data analysts can rely on.

Starting with an introduction to data engineering, along with its key concepts and architectures, this book will show you how to use Microsoft Azure Cloud services effectively for data engineering. You'll cover data lake design patterns and the different stages through which the data needs to flow in a typical data lake. Once you've explored the main features of Delta Lake to build data lakes with fast performance and governance in mind, you'll advance to implementing the lambda architecture using Delta Lake. Packed with practical examples and code snippets, this book takes you through real-world examples based on production scenarios faced by the author in his 10 years of experience working with big data. Finally, you'll cover data lake deployment strategies that play an important role in provisioning the cloud resources and deploying the data pipelines in a repeatable and continuous way.

By the end of this data engineering book, you'll know how to effectively deal with ever-changing data and create scalable data pipelines to streamline data science, ML, and artificial intelligence (AI) tasks.

What you will learn

  • Discover the challenges you may face in the data engineering world
  • Add ACID transactions to Apache Spark using Delta Lake
  • Understand effective design strategies to build enterprise-grade data lakes
  • Explore architectural and design patterns for building efficient data ingestion pipelines
  • Orchestrate a data pipeline for preprocessing data using Apache Spark and Delta Lake APIs
  • Automate deployment and monitoring of data pipelines in production
  • Get to grips with securing, monitoring, and managing data pipelines models efficiently

Who this book is for

This book is for aspiring data engineers and data analysts who are new to the world of data engineering and are looking for a practical guide to building scalable data platforms. If you already work with PySpark and want to use Delta Lake for data engineering, you'll find this book useful. Basic knowledge of Python, Spark, and SQL is expected.

Table of contents

  1. Data Engineering with Apache Spark, Delta Lake, and Lakehouse
  2. Foreword
  3. Contributors
  4. About the author
  5. About the reviewers
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. Download the example code files
    4. Download the color images
    5. Conventions used
    6. Get in touch
    7. Share Your Thoughts
  7. Section 1: Modern Data Engineering and Tools
  8. Chapter 1: The Story of Data Engineering and Analytics
    1. The journey of data
    2. Exploring the evolution of data analytics
      1. Core capabilities of storage and compute resources
      2. Availability of varying datasets
      3. The paradigm shift to distributed computing
      4. Adoption of cloud computing
      5. Data storytelling
    3. The monetary power of data
      1. Organic growth
    4. Summary
  9. Chapter 2: Discovering Storage and Compute Data Lakes
    1. Introducing data lakes
      1. Exploring the benefits of data lakes
      2. Adhering to compliance frameworks
      3. Segregating storage and compute in a data lake
    2. Discovering data lake architectures
      1. The CAP theorem
    3. Summary
  10. Chapter 3: Data Engineering on Microsoft Azure
    1. Introducing data engineering in Azure
    2. Performing data engineering in Microsoft Azure
      1. Self-managed data engineering services (IaaS)
      2. Azure-managed data engineering services (PaaS)
      3. Data processing services in Microsoft Azure
      4. Data engineering as a service (SaaS)
      5. Data cataloging and sharing services in Microsoft Azure
    3. Opening a free account with Microsoft Azure
    4. Summary
  11. Section 2: Data Pipelines and Stages of Data Engineering
  12. Chapter 4: Understanding Data Pipelines
    1. Exploring data pipelines
      1. Components of a data pipeline
    2. Process of creating a data pipeline
      1. Discovery phase
      2. Design phase
      3. Development phase
      4. Deployment phase
    3. Running a data pipeline
    4. Sample lakehouse project
    5. Summary
  13. Chapter 5: Data Collection Stage – The Bronze Layer
    1. Architecting the Electroniz data lake
      1. The cloud architecture
      2. The pipeline design
      3. The deployment strategy
    2. Understanding the bronze layer
    3. Configuring data sources
      1. Data preparation
    4. Configuring data destinations
    5. Building the ingestion pipelines
      1. Building a batch ingestion pipeline
      2. Testing the ingestion pipelines
      3. Building the streaming ingestion pipeline
    6. Summary
  14. Chapter 6: Understanding Delta Lake
    1. Understanding how Delta Lake enables the lakehouse
    2. Understanding Delta Lake
      1. Preparing Azure resources
    3. Creating a Delta Lake table
    4. Changing data in an existing Delta Lake table
    5. Performing time travel
    6. Performing upserts of data
    7. Understanding isolation levels
    8. Understanding concurrency control
    9. Cleaning up Azure resources
    10. Summary
  15. Chapter 7: Data Curation Stage – The Silver Layer
    1. The need for curating raw data
      1. Unstandardized data
      2. Invalid data
      3. Non-uniform data
      4. Inconsistent data
      5. Duplicate data
      6. Insecure data
    2. The process of curating raw data
      1. Inspecting data
      2. Getting approval
      3. Cleaning data
      4. Verifying data
    3. Developing a data curation pipeline
      1. Preparing Azure resources
      2. Creating the pipeline for the silver layer
    4. Running the pipeline for the silver layer
    5. Verifying curated data in the silver layer
      1. Verifying unstandardized data
      2. Verifying invalid data
      3. Verifying non-uniform data
      4. Verifying duplicate data
      5. Verifying insecure data
    6. Cleaning up Azure resources
    7. Summary
  16. Chapter 8: Data Aggregation Stage – The Gold Layer
    1. The need to aggregate data
    2. The process of aggregating data
    3. Developing a data aggregation pipeline
      1. Preparing the Azure resources
      2. Creating the pipeline for the gold layer
    4. Running the aggregation pipeline
    5. Understanding data consumption
      1. Accessing silver layer data
      2. Accessing gold layer data
    6. Verifying aggregated data in the gold layer
    7. Meeting customer expectations
    8. Summary
  17. Section 3: Data Engineering Challenges and Effective Deployment Strategies
  18. Chapter 9: Deploying and Monitoring Pipelines in Production
    1. The deployment strategy
    2. Developing the master pipeline
    3. Testing the master pipeline
    4. Scheduling the master pipeline
    5. Monitoring pipelines
      1. Adding durability features
      2. Dealing with failure conditions
      3. Adding alerting features
    6. Summary
  19. Chapter 10: Solving Data Engineering Challenges
    1. Schema evolution
    2. Sharing data
      1. Preparing the Azure resources
      2. Creating a data share
    3. Data governance
      1. Preparing the Azure resources
      2. Creating a data catalog
    4. Cleaning up Azure resources
    5. Summary
  20. Chapter 11: Infrastructure Provisioning
    1. Infrastructure as code
    2. Deploying infrastructure using Azure Resource Manager
      1. Creating ARM templates
      2. Deploying ARM templates using the Azure portal
      3. Deploying ARM templates using the Azure CLI
      4. Deploying ARM templates containing secrets
    3. Deploying multiple environments using IaC
    4. Cleaning up Azure resources
    5. Summary
  21. Chapter 12: Continuous Integration and Deployment (CI/CD) of Data Pipelines
    1. Understanding CI/CD
      1. Traditional software delivery cycle
      2. Modern software delivery cycle
    2. Designing CI/CD pipelines
    3. Developing CI/CD pipelines
      1. Creating an Azure DevOps organization
      2. Creating the Electroniz infrastructure CI/CD pipeline
      3. Creating the Electroniz code CI/CD pipeline
      4. Creating the CI/CD life cycle
    4. Summary
    5. Why subscribe?
  22. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts

Product information

  • Title: Data Engineering with Apache Spark, Delta Lake, and Lakehouse
  • Author(s): Manoj Kukreja
  • Release date: October 2021
  • Publisher(s): Packt Publishing
  • ISBN: 9781801077743