The schema of a data contract
We’ll start this section by looking at the schema of a data contract, what to put in it, and why. Then we’ll look at how to make these schemas accessible to both data generators and consumers, by storing them in a system (or a registry) that is recognized as the source of truth.
We’ll cover these topics in the following subsections:
- Defining a schema
- Using a schema registry as the source of truth
Defining a schema
The schema defines the structure of the data. At a minimum, it will hold the complete list of the fields available and their data type.
The following code block shows an example of a schema that defines a Customer
record with fields and their types using Protocol Buffers (https://protobuf.dev), as well as a unique field number, as required by Protocol Buffers:
message Customer {   string id       = 1;   string name    ...