Chapter 7. Implementing Data Contracts
Chapters 5 and 6 covered the four components of the data contract architecture in depth. In this chapter, we’ll move from theory to actually implementing data contracts via open source tools. Our corresponding GitHub repo provides a full sandbox environment you can run locally or in the browser via GitHub Codespaces with:
-
A full walkthrough of a data contract architecture implementation and its corresponding scripts
-
Implementation of a data contract spec
-
A scenario project simulating a data contract violation workflow
While we highly encourage using the code repository, this chapter is sufficient as a stand-alone, featuring architecture diagrams, the corresponding tools, and highlights of relevant code snippets. The goals of this chapter are for you to:
-
Understand how to implement the four data contract components: data assets, data contract spec, detection, and prevention
-
Create a data contract spec via JSON Schema as a means to understand how to evaluate available specs on the market or whether to build one of your own for specific use cases
-
Learn how to leverage the metadata of databases to create your own “data catalog” that you will compare data contract specs to
-
Embed data contracts within unit tests for local testing and embedding within the CI/CD workflow
-
Fully walk through the data contract violation workflow on a pull request
Finally, we suggest the following three ways to work through the material in this chapter, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access