---
id: "google-pubsub-schema"
type: "component"
kind: "schema-registry"
provider: "gcp"
category: "data"
docs: "https://docs.cloud.google.com/pubsub/docs/schemas"
url: "https://localhost:3000/catalogue/components/google-pubsub-schema"
---

# Pub/Sub schema

Avro or Protocol Buffer contract enforced on messages published to a topic.

| | |
|---|---|
| Provider | [gcp](https://localhost:3000/catalogue?provider=gcp) |
| Kind | [Schema registry](https://localhost:3000/catalogue/kinds/schema-registry) |
| Category | Data |
| Official docs | [https://docs.cloud.google.com/pubsub/docs/schemas](https://docs.cloud.google.com/pubsub/docs/schemas) |

## Properties

| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| `compatibility` | enum | `none`, `backward`, `forward`, `full` | no | "backward" | inherited |
| `enforced` | boolean | — | no | false | **true** |
| `managed` | boolean | — | no | false | **true** |
| `maxDefinitionSizeKb` | integer | — | no | 300 | inherited |
| `maxRevisions` | integer | — | no | 20 | inherited |
| `maxSchemasPerProject` | integer | — | no | 10000 | inherited |
| `schemaType` | enum | `avro`, `protocol-buffer` | no | — | inherited |

Bold values are the ones this component pins.

## Rules that apply · 0

No rule selects this kind or its category.

## Other products of the same kind · 7

- [Amazon EventBridge Schema Registry](https://localhost:3000/catalogue/components/aws-eventbridge-schemas.md) `aws-eventbridge-schemas` — aws
- [AWS Glue Schema Registry](https://localhost:3000/catalogue/components/glue-schema-registry.md) `glue-schema-registry` — aws
- [Azure Schema Registry](https://localhost:3000/catalogue/components/azure-schema-registry.md) `azure-schema-registry` — azure
- [Apicurio Registry](https://localhost:3000/catalogue/components/apicurio.md) `apicurio` — default
- [Confluent Schema Registry](https://localhost:3000/catalogue/components/confluent-schema-registry.md) `confluent-schema-registry` — default
- [Karapace](https://localhost:3000/catalogue/components/karapace.md) `karapace` — default
- [Generic schema registry](https://localhost:3000/catalogue/components/schema-registry.md) `schema-registry` — default

## Use it in a design

```yaml
nodes:
  - { id: "google-pubsub-schema", component: "google-pubsub-schema" }
```

## Source (`component` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../../schema/component.schema.json
# Pub/Sub schema: Avro or Protocol Buffer contract attached to a topic. "Schema overview": when a
# schema is associated with a topic a message that does not conform is not published; a schema keeps
# at most 20 revisions, a definition is at most 300 KB, and a project holds at most 10,000 schemas.
schemaVersion: "1"
type: "component"
id: "google-pubsub-schema"
kind: "schema-registry"
provider: "gcp"
docs: "https://docs.cloud.google.com/pubsub/docs/schemas"
defaults:
  managed: true
  enforced: true
properties:
  schemaType:
    type: "enum"
    values: ["avro", "protocol-buffer"]
  maxRevisions:
    type: "integer"
    default: 20
  maxDefinitionSizeKb:
    type: "integer"
    default: 300
  maxSchemasPerProject:
    type: "integer"
    default: 10000
```

Human page: https://localhost:3000/catalogue/components/google-pubsub-schema
