Anonymitaet commented on a change in pull request #4786: Add *Understand Schema* Section URL: https://github.com/apache/pulsar/pull/4786#discussion_r306345623
########## File path: site2/docs/schema-understand.md ########## @@ -0,0 +1,319 @@ +--- +id: schema-understand +title: Understand schema +sidebar_label: Understand schema +--- + +## `SchemaInfo` + +Pulsar schema is defined in a data structure called `SchemaInfo`. + +The `SchemaInfo` is stored and enforced on a per-topic basis and cannot be stored at the namespace or tenant level. + +A `SchemaInfo` consists of the following fields: + +| Field | Description | +|---|---| +| `name` | Schema name (a string). | +| `type` | Schema type, which determines how to interpret the schema data. | +| `schema` | Schema data, which is a sequence of 8-bit unsigned bytes and schema-type specific. | +| `properties` | A map of string key/value pairs, which is application-specific. | + +**Example** + +This is the `SchemaInfo` of a string. + +```text +{ + “name”: “test-string-schema”, + “type”: “STRING”, + “schema”: “”, + “properties”: {} +} +``` + +## Schema type + +Pulsar supports various schema types, which are mainly divided into two categories: + +* Primitive type + +* Complex type + +> #### Note +> +> If you create a schema without specifying a type, producers and consumers can only handle raw bytes. Review comment: @sijie I add this Note based on my understanding, is it correct? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services