Schema Mapping
This page describes how to configure schema mapping in a Restore.
Schema Mapping
Schema mapping allows migration of data from one environment to another that use schema registries.
With schema mapping, you can, for example, copy data from a production environment to a QA environment where there are different schema registries.
The restore process will map the schema IDs from the source environment to the schema IDs of the target environment. It will do so by looking up the schema mapping in a lookup table and replacing the magic byte that represents the schema ID in the message when restoring the data.
To use schema mapping, you need to:
- Define or generate a schema mapping*
- Create a ConfigMap with the schema mapping
- Reference the ConfigMap in the Restore for schema mapping
The operator will automatically configure both the Payload Schema Mapping plugin, and the Key Schema Mapping plugin with the schema mapping.
First, create a YAML file with a mapping
field that contains pairs of schema IDs.
Then, create a ConfigMap with the schema mapping:
This will create a ConfigMap with the following content:
Finally,
set the schema mapping in the Restore by setting the .spec.config.schemaMappingFrom
field to load the mapping from the field in the ConfigMap,
using a ConfigMapKeySelector.
The operator will validate the schema mapping.
To check if the schema mapping is valid,
check the SchemaMappingValidated
condition in the status of the Restore resource.