Share E-Book
Scan to open this page

Scan with your phone to open this page

AuthorBartosz Konieczny

Data projects are an intrinsic part of an organization’s technical ecosystem, but data engineers in many companies continue to work on problems that others have already solved. This hands-on guide shows you how to provide valuable data by focusing on various aspects of data engineering, including data ingestion, data quality, idempotency, and more. Author Bartosz Konieczny guides you through the process of building reliable end-to-end data engineering projects, from data ingestion to data observability, focusing on data engineering design patterns that solve common business problems in a secure and storage-optimized manner. Each pattern includes a user-facing description of the problem, solutions, and consequences that place the pattern into the context of real-life scenarios. Throughout this journey, you’ll use open source data tools and public cloud services to apply each pattern. You'll learn: Challenges data engineers face and their impact on data systems How these challenges relate to data system components Useful applications of data engineering patterns How to identify and fix issues with your current data components TTechnology-agnostic solutions to new and existing data projects, with open source implementation examples Bartosz Konieczny is a freelance data engineer who's been coding since 2010. He's held various senior hands-on positions that allowed him to work on many data engineering problems in batch and stream processing.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# Data Engineering Design Patterns ## 【One-Line Pitch】 A practical recipe book for experienced data engineers who want to stop reinventing the wheel, offering battle-tested design patterns for ingestion, error management, and data quality that solve recurring business problems with technology-agnostic solutions and open-source implementations. ## 【Book Arc】 - **Opening (~0%–9%)**: Introduces the concept of design patterns in data engineering, establishes the target audience (minimum six months commercial experience), and sets expectations for the book's structure—each pattern includes a problem statement, solution, and consequences. The author emphasizes that patterns provide a common language for teams and save time by avoiding repeated problem-solving. - **Early (~9%–28%)**: Covers data ingestion design patterns, starting with the Full Loader for slowly evolving reference datasets, then moving through Incremental Loader with partition-based implementations using Apache Airflow and Spark, Replication for cross-environment data copying, and the Compactor pattern to solve the small files problem that plagues object store–based lakehouses. - **Early (~28%–34%)**: Concludes the ingestion chapter with the External Trigger pattern for event-driven ingestion, explaining pull versus push semantics and how to handle unpredictable data arrival. The section emphasizes that ingestion is not always a predictable process and requires flexible architectural responses. - **Middle (~34%–47%)**: Shifts to error management design patterns, beginning with the Dead-Letter pattern for handling unprocessable records (poison pill messages) in streaming jobs, distinguishing between transient and nontransient errors, and showing how to keep pipelines running while preserving bad records for investigation. - **Middle (~47%–end of excerpts)**: Continues error management with the Windowed Deduplicator for handling at-least-once delivery semantics, the Dynamic Late Data Integrator for managing late-arriving data with state tables and lookback windows, and the Filter Interceptor for tracking filtering statistics—noting the challenges of implementing these patterns in declarative languages like SQL versus programmatic APIs. ## 【Key Takeaways】 - **Design patterns give data teams a shared vocabulary** (Early): Just as cooking recipes prevent reinventing the wheel, patterns like Dead-Letter and Compactor let engineers discuss solutions concisely with teammates they've just met, saving time and reducing miscommunication. - **The Full Loader pattern is deceptively simple but has hidden pitfalls** (Early): While it's just extract-and-load in two steps, you must avoid data transformations that introduce quality issues like type conversions or floating-point rounding—use native copy commands or raw text APIs instead of JSON I/O when possible. - **The small files problem is still alive in modern lakehouses** (Early): Even with virtually unlimited object storage, metadata operations like listing files can consume 70% of execution time. The Compactor pattern merges small files into larger ones, with Apache Iceberg's rewrite data file action and Delta Lake's OPTIMIZE command as implementations. - **Dead-Letter pattern keeps pipelines alive without losing bad data** (Middle): Instead of failing the entire job on poison pill messages, route unprocessable records to a separate table for investigation. However, implementing this in declarative SQL requires verbose custom try-catch logic that's hard to maintain. - **Exactly-once delivery is rare; deduplication is the practical answer** (Middle): The Windowed Deduplicator pattern treats data as limited within time boundaries, enabling both batch and streaming pipelines to process each occurrence only once despite at-least-once delivery semantics. - **Late data integration requires stateful thinking** (Middle): The Dynamic Late Data Integrator uses a state table to track last processed times per partition, with BigQuery's INFORMATION_SCHEMA.PARTITIONS and Iceberg's metadata tables providing this out of the box—but concurrency can cause duplicate integration runs. - **Declarative languages struggle with complex error handling** (Middle): Patterns like Filter Interceptor are easier to implement and maintain with programmatic APIs than SQL, and streaming implementations may require converting stateless jobs to stateful ones with additional overhead. ## 【Reading Tips】 - **Skim the opening chapter** if you're already familiar with design pattern concepts—the real value starts with Chapter 2's ingestion patterns, but do read the "What Should I Know" section to verify you have the prerequisites (ETL/ELT, cloud basics, and production experience with Java, Scala, Python, or SQL). - **Deep-read the Compactor and Dead-Letter patterns**—these address the most common real-world pain points (small files and poison pill messages) and include concrete implementation details across multiple technologies like Iceberg, Delta Lake, and Hudi. - **Pay attention to the "Consequences" sections**—each pattern includes trade-offs (like added complexity from Dead-Letter logic or concurrency issues in Dynamic Late Data Integrator) that are crucial for deciding when NOT to use a pattern. - **Use the GitHub repository alongside the book**—code examples are organized by chapter with README files and require Docker Compose, making it easy to run demos and see patterns in action rather than just reading about them. - **Skip ahead if you're only interested in batch processing**—the streaming-specific content (External Trigger, Dead-Letter for Kafka) is clearly marked, and you can focus on the ingestion and compaction patterns without losing context. ## 【Coverage Limits】 The excerpts cover the introduction, data ingestion patterns (Full Loader, Incremental Loader, Replication, Compactor, External Trigger), and the beginning of error management patterns (Dead-Letter, Windowed Deduplicator, Dynamic Late Data Integrator, Filter Interceptor). Later chapters on data quality, idempotency, and observability mentioned in the blurb are not covered in this guide. ##
Page 7
. . . . . . . . . . . . . . . . 1 What Are Design Patterns? 1 Yet More Design Patterns? 3 Common Data Engineering Patterns 3 Case Study Used in This Book 5 S...
View in text
Excerpt 2
a few times a week. It’s also a very slowly evolving entity with the total number of rows not exceeding one million. Unfortunately, the data pro‐ vider doesn...
View in text
Excerpt 3
can be configured as a merge-on-read (MoR) table where the dataset is written in columnar format and any subsequent changes are written in row 4 There’s a de...
View in text
Excerpt 4
k window, but it also has its own shortcomings. Concurrency. If your pipeline supports concurrent executions, dynamic late data inte‐ gration may generate du...
View in text
Excerpt 5
u should slightly adapt the implementation to your use case. In that scenario, the pipeline will be composed of the steps in Figure 4-6. Figure 4-6. The Stat...
View in text
Excerpt 6
ched dataset or vice versa. To mitigate this issue, dynamic joins are often completed with additional time conditions. Defining these time conditions implies...
View in text
Excerpt 7
e state in case of failure or restart, the job synchronizes the state regularly to a more resilient fault tolerance storage. The data processing logic can re...
View in text
Excerpt 8
quence | 173 Figure 6-4. Confusing Unaligned Fan-In example To mitigate this issue it is always better to check if the data orchestration tool pro‐ vides cus...
View in text
Tags
AI categories
data engineeringCloud NativeProgramming
ISBN: 1098165780
Publish Year: 2024
Language: English
Pages: 393
File Format: PDF
File Size: 7.1 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…