Synadia Platform
Overview
A brief introduction of Schema Registry and how to use Schema Registry from Control Plane.
Schemas
Schemas are subject-based addresses with the subject representing a key within Schema Registry's Key Value (KV) store.
The KV subject hierarchy looks like this:
# {bucket_name}.{account_id}.{schema_registry_version}.{format}.{version}.{revision}.{name}
schemas.*.v1.jsonschema.1.1.Person
Or another way of looking at the above,
Subject token details:
- Schema Registry Bucket is the KV bucket which all schemas are stored in. By default, this is the
SynadiaPlatform
account. This is not the account the schemas are being used within. - Account is the public NKEY for the account which the schema belongs to.
- This provides schema isolation from other accounts meaning schema names do not need to be globally unique, only unique within the context of an account.
- Schema Registry Version is an internal versioning system for the Schema Registry. This is not user editable.
- Format is the schema's format such as
jsonschema
,avro
, and so on. - Version is the version of the schema. It always starts from
1
. - Revision is incremented each time a schema is updated starting from
1
. - Name is the user assigned schema name. It is not editable once a schema has been created.
Using subjects allows for a lot of flexibility when generating schemas. As a example it would be possible to create several different formats of the Person
schema:
v1.jsonschema.1.1.Person
v1.avro.1.1.Person
v1.protobuf.1.1.Person
Only jsonschema
is supported during the initial roll-out of Schema Registry.
Versions and Revisions
All schema versions will be fixed to version 1
during the initial roll-out of the registry.
A schema's format and name cannot be changed once it has been created but version (see above note) and revision can.
When a schema is created it always starts with version and revision set to 1
. Each Update to a schema will increment the revision by 1
resulting in the following, assuming we've updated our Person
schema twice since creation.
v1.jsonschema.1.1.Person
- Initial schemav1.jsonschema.1.2.Person
- Updated, incremented by 1v1.jsonschema.1.3.Person
- Updated, incremented by 1
Revisions cannot be edited once they are created, only deleted. Each revision is an immutable KV entry.
Prerequisites
Schema Registry will need to be set up and running as a Platform Component. Follow the deployment steps if you haven't already.
Schemas are scoped by account so it's also important to select the appropriate account for your needs. If you create a schema in the wrong account, don't worry, deleting schemas is simple as we'll demonstrate in these guides.
Dashboard
Once the Schema Registry is running, you will be able to navigate to, and start interacting with, it's dashboard.
The initial dashboard should look like the following.
And, a schema's detail view page will look something like this.
The table on the right-hand side allows for viewing other versions and revisions by clicking the link in the first column.
Now that everything is configured and running we can get started with creating, updating and deleting schemas in the following sections within the guide.