A Sample Implementation
In this chapter, we’ll walk through a sample implementation of data contracts. We’ll use it to illustrate the concepts we have been learning about throughout the book and put what we have learned into practice.
We’ll start by creating a YAML-based interface for the data generator to use to create a data contract. Then, using that data contract as the foundation, we’ll provide a few examples of how we can use it to drive our contract-driven architecture.
Firstly, we’ll create a table in our BigQuery data warehouse from the data contract, with a matching schema that will stay in sync with the contract as it evolves. We’ll also introduce an Infrastructure as Code (IaC) tool to help us build this. Then we’ll look at how we can create libraries for the data generators to aid the generation of data that matches the contract and conforms to the data quality checks we have defined in the contract.
Next, we’...