---
title: "Schema registry"
description: "A schema registry is a centralized service that stores, versions, and validates data schemas — typically for Avro, Protobuf, or JSON Schema — used to keep producers and consumers in streaming systems like Kafka compatible as schemas change."
canonical: "https://motherduck.com/glossary/schema-registry/"
related:
  - title: "DuckLake Architecture Deep Dive"
    url: "https://motherduck.com/blog/ducklake-architecture-deep-dive/"
  - title: "Information schema | MotherDuck Docs"
    url: "https://motherduck.com/docs/sql-reference/duckdb-sql-reference/information-schema/"
  - title: "DuckDB, the great federator?"
    url: "https://motherduck.com/blog/duckdb-the-great-federator/"
gated_asset:
  title: "DuckLake on MotherDuck"
  url: "https://motherduck.com/product/ducklake/"
---

# Schema registry

> A schema registry is a centralized service that stores, versions, and validates data schemas — typically for Avro, Protobuf, or JSON Schema — used to keep producers and consumers in streaming systems like Kafka compatible as schemas change.

## Overview
In a streaming pipeline, producers and consumers of messages are usually separate services deployed and evolved independently. A schema registry gives them a shared, versioned source of truth for what a message's structure looks like, so a producer can safely add a field or change a type without silently breaking every consumer downstream.

<glossary-callout guide="duckdb-cheatsheet-full" />

## How it works
When a producer writes a message, it registers (or references) its schema with the registry, which returns a schema ID. That ID is embedded in the message instead of the full schema, keeping messages small. Consumers look up the schema by ID when they need to deserialize a message. The registry enforces compatibility rules — commonly backward compatibility (new schema can read data written with the old one) or forward compatibility (old schema can read data written with the new one) — and rejects schema changes that would break those guarantees.

## Common implementations
The Confluent Schema Registry is the most widely used implementation, built for and tightly integrated with Apache Kafka, and it supports Avro, Protobuf, and JSON Schema. AWS Glue Schema Registry provides similar functionality for AWS-native streaming pipelines.

## Where DuckDB fits
DuckDB is a query engine, not a streaming system, so it doesn't interact with a schema registry directly. In practice, schema-registry-governed messages (Avro or Protobuf records flowing through Kafka) are typically consumed and landed into files — often Parquet, via a stream processor or connector — before being queried analytically. Once that data lands as Parquet or Avro files, DuckDB can read it directly:

```sql
INSTALL avro;
LOAD avro;

SELECT * FROM read_avro('s3://bucket/kafka-topic-exports/*.avro');
```

The schema evolution guarantees enforced upstream by the registry are what make it safe for that landed data to change shape over time without breaking downstream queries.