Skip to content

About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Workshop: Shifting Left with Data Contracts

Duration: ~1 hour

Difficulty: Intermediate

Technical Requirements: Working knowledge of data streaming and schema management

πŸ“– Overview

This hands-on workshop demonstrates how to prototype data contracts as a shift-left strategy to prevent data quality issues before they impact downstream systems. You will play the role of a data engineer at River Hotels, a fictitious hospitality company, to build a proof-of-concept that showcases robust data governance practices and demonstrates how they ensure data reliability and prevent costly pipeline failures.

Traditional vs Shift-Left

graph TD
    subgraph "Shift Left Data Pipeline"
        A2[Data Source] --> B2[Process and Clean Data near the Source]
        B2 --> C2[Ingest High-Quality Data]
        C2 --> D2[Store in Data Warehouse/Lake]
        D2 --> E2[Analyze and Consume]
    end

    subgraph "Traditional Data Pipeline"
        A1[Data Source] --> B1[Ingest Raw Data]
        B1 --> C1[Store in Data Warehouse/Lake]
        C1 --> D1[Process and Clean Data]
        D1 --> E1[Analyze and Consume]
    end
Loading

Feedback

If you have any issues or feedback for this workshop, please let us know in this quick 2-minute survey!

βœ… Prerequisites

You must complete each of these to successfully go through this workshop:

Warning

Payment Method or Promo Code Required for Confluent Cloud

You must either add a payment method or redeem a coupon code to be able to run this workshop.

🏨 Use Case

River Hotels is facing a critical data reliability crisis. Despite having a modern data infrastructure, they're experiencing frequent pipeline failures, inconsistent analytics, and eroded trust in their data products. The root cause? No formal data contracts or governance practices to prevent bad data from propagating through their systems.

⚠️ The Challenge

River Hotels' current approach to data management is reactive - they discover data quality issues only after downstream systems break or business reports show inconsistencies. This "firefighting" approach is unsustainable and costly, leading to delayed insights, missed business opportunities, and frustrated stakeholders.

The leadership team has called an emergency meeting where each department shares their pain points:


πŸ“Š The Analytics Dilemma

"We can't trust our customer behavior reports," explains the Head of Analytics. "Last week, our clickstream data suddenly changed format without warning. Our customer segmentation models broke, and we had to spend three days rebuilding our entire pipeline. By then, the marketing campaign deadlines had passed."


πŸ”§ The Engineering Predicament

The Engineering Manager shares equally frustrating experiences: "Every time upstream teams make 'simple' changes to their data structures, our applications crash. We spend more time fixing data-related bugs than building new features. We need a way to catch these issues before they reach production."


πŸ’Ό The Business Impact

The Chief Data Officer is concerned about the broader implications: "Our data products are becoming unreliable. Business teams are losing confidence in our analytics, and we're making decisions based on incomplete or incorrect data. We need to shift our approach from reactive to proactive data governance."


🎯 The Solution: Shift-Left Data Contracts

Your CTO has made the directive clear: "We need to implement data contracts that catch issues at the source, not at the destination. If we can shift data quality validation to the left - closer to where data is produced - we can prevent cascading failures and build trust in our data ecosystem."


πŸŽ–οΈ Your Mission

Your task is to build a proof-of-concept data contracts framework that demonstrates how River Hotels can transform from a reactive data organization into a proactive, governed data ecosystem.

Solution Requirements

  1. πŸ“‹ Prototype formal data contracts with schema registry
  2. πŸ›‘οΈ Demonstrate data quality rules that prevent bad data propagation
  3. πŸ”„ Showcase schema evolution without breaking downstream systems
  4. 🚨 Implement dead letter queues for contract violations
  5. πŸ“ˆ Validate the shift-left approach with an enriched data set

πŸ› οΈ What You'll Build

By the end of this workshop, you will have prototyped a data contracts framework that:

  1. Establishes Schema Registry: Set up centralized schema management for all data streams
  2. Implements Data Quality Rules: Create automated validation that prevents bad data from entering topics
  3. Handles Schema Evolution: Safely evolve schemas while maintaining backward compatibility
  4. Manages Contract Violations: Route invalid data to dead letter queues for review and remediation
  5. Provides Governance Visibility: Monitor contract compliance and data quality metrics

Important: This is a proof-of-concept environment designed for learning and demonstration. For production deployment, additional considerations around feature sets, security, scalability, and operational monitoring would be required.

πŸŽ“ Key Learning Outcomes

  • Data Contracts: Understand how to establish formal agreements between data producers and consumers
  • Schema Registry: Learn to implement centralized schema management for data governance
  • Data Quality Rules: Demonstrate automated validation to prevent bad data propagation
  • Schema Evolution: Practice handling schema changes without breaking downstream systems
  • Shift-Left Strategy: Experience proactive data governance practices in a controlled environment

Focus: This workshop emphasizes hands-on learning and concept demonstration rather than production deployment patterns.

πŸ›οΈ Architecture Overview

The following diagrams represent the proof-of-concept data contracts architecture you will implement and the governance framework that demonstrates data quality principles.

Workshop architecture

πŸ”— Entity Relationship Diagram

erDiagram
    CUSTOMER {
        string CUSTOMER_ID PK
        string EMAIL UK
        string FIRST_NAME
        string LAST_NAME
        string BIRTH_DATE
        long CREATED_AT
    }

    HOTEL {
        string HOTEL_ID PK
        string NAME
        string CLASS
        string DESCRIPTION
        string CITY
        string COUNTRY
        int ROOM_CAPACITY
        long CREATED_AT
    }

    CLICKSTREAM {
        string CLICKSTREAM_ID PK
        string CUSTOMER_EMAIL FK
        string HOTEL_ID FK
        string ACTION
        int EVENT_DURATION
        string URL
        long CREATED_AT
    }

    %% Relationships
    CUSTOMER ||--o{ CLICKSTREAM : "generates"
    HOTEL ||--o{ CLICKSTREAM : "viewed_in"
Loading

🌊 Data Contracts Pipeline

The data contracts architecture you'll implement follows this flow:

graph LR
    A[Data Producers] --> B[Schema Registry]
    B --> C[Data Quality Rules]
    C --> D{Contract Valid?}
    D -->|Yes| E[Kafka Topics]
    D -->|No| F[Dead Letter Queue]
    E --> G[Downstream Consumers]
    F --> H[Data Steward Review]
    H --> I[Remediation]
    I --> A
Loading

This architecture demonstrates proactive data governance by validating data contracts before issues propagate downstream.

πŸ”¬ Workshop Labs

This workshop is organized into six sequential labs that build a proof-of-concept step by step.

Each lab builds upon the previous one, so start with LAB 1 and continue until you are done.

  • LAB 1: Setup accounts and deploy infrastructure with Terraform
  • LAB 2: Prototype data contracts with schema registry and governance
  • LAB 3: Validate data contracts with realistic data generation
  • LAB 4: Test schema evolution and contract enforcement
  • LAB 5: Analytics with Tableflow and Databricks
  • LAB 6: Workshop cleanup and summary
  • RECAP: Review takeaways from this workshop

➑️ What's Next

Congratulations! You've completed a comprehensive proof-of-concept for data contracts and shift-left governance.

Feedback and Improvement

Please help us improve this workshop by leaving your feedback in this quick 2-minute survey!

Thanks!

About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages