You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by li...@apache.org on 2023/08/22 01:04:10 UTC
[pulsar-site] branch main updated: [improve][doc] SEO for Pulsar Schema (#675)
This is an automated email from the ASF dual-hosted git repository.
liuyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/main by this push:
new b88510aea4f [improve][doc] SEO for Pulsar Schema (#675)
b88510aea4f is described below
commit b88510aea4f52d9d89ccd0b701622ab946f36b9d
Author: Zhang Yuxuan <13...@qq.com>
AuthorDate: Tue Aug 22 09:04:04 2023 +0800
[improve][doc] SEO for Pulsar Schema (#675)
---
docs/schema-get-started.md | 1 +
docs/schema-overview.md | 24 +++++++++++-------------
docs/schema-understand.md | 10 ++++++----
3 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/docs/schema-get-started.md b/docs/schema-get-started.md
index 817cd601e0b..d95f909e551 100644
--- a/docs/schema-get-started.md
+++ b/docs/schema-get-started.md
@@ -2,6 +2,7 @@
id: schema-get-started
title: Get started
sidebar_label: "Get started"
+description: Get started to construct Pulsar schemas and customize Pulsar schema storage.
---
diff --git a/docs/schema-overview.md b/docs/schema-overview.md
index d117818dc0f..a9a503b9d47 100644
--- a/docs/schema-overview.md
+++ b/docs/schema-overview.md
@@ -2,16 +2,10 @@
id: schema-overview
title: Overview
sidebar_label: "Overview"
+description: Get a comprehensive understanding of Pulsar schema.
---
-This section introduces the following content:
-* [What is Pulsar Schema](#what-is-pulsar-schema)
-* [Why use it](#why-use-it)
-* [How it works](#how-it-works)
-* [Use case](#use-case)
-* [What's next?](#whats-next)
-
-## What is Pulsar Schema
+## Definitions
Pulsar messages are stored as unstructured byte arrays and the data structure (as known as schema) is applied to this data only when it's read. So both the producer and consumer need to agree upon the data structure of the messages, including the fields and their associated types.
@@ -27,7 +21,7 @@ Currently, Pulsar schema is available for [Java clients](client-libraries-java.m
:::
-## Why use it
+## Benefits
Type safety is extremely important in any application built around a messaging and streaming system. Raw bytes are flexible for data transfer, but the flexibility and neutrality come with a cost: you have to overlay data type checking and serialization/deserialization to ensure that the bytes fed into the system can be read and successfully consumed. In other words, you need to make sure the data is intelligible and usable to applications.
@@ -38,15 +32,17 @@ Pulsar schema resolves the pain points with the following capabilities:
* keeps data compatibility on-track between schema versions. When new schemas are uploaded, the new versions can be read by old consumers.
* stored in the existing storage layer BookKeeper, without additional system required.
-## How it works
+## Workflow
Pulsar schemas are applied and enforced at the **topic** level. Producers and consumers can upload schemas to brokers, so Pulsar schemas work on both sides.
### Producer side
-This diagram illustrates how Pulsar schema works on the Producer side.
+This diagram illustrates how Pulsar schema works on the producer side.
+
+
-
+Below are explanations for each step.
1. The application uses a schema instance to construct a producer instance.
The schema instance defines the schema for the data being produced using the producer instance. Take Avro as an example, Pulsar extracts the schema definition from the POJO class and constructs the `SchemaInfo`.
@@ -69,7 +65,9 @@ This diagram illustrates how Pulsar schema works on the Producer side.
This diagram illustrates how schema works on the consumer side.
-
+
+
+Below are explanations for each step.
1. The application uses a schema instance to construct a consumer instance.
diff --git a/docs/schema-understand.md b/docs/schema-understand.md
index 772779ee926..73e6d5c311a 100644
--- a/docs/schema-understand.md
+++ b/docs/schema-understand.md
@@ -2,6 +2,7 @@
id: schema-understand
title: Understand schema
sidebar_label: "Understand schema"
+description: Get a comprehensive understanding of Pulsar schemas.
---
````mdx-code-block
@@ -38,9 +39,10 @@ The following table outlines the fields that each `SchemaInfo` consists of.
## Schema type
-Pulsar supports various schema types, which are mainly divided into two categories:
+Pulsar supports various schema types, which are mainly divided into following categories:
* [Primitive type](#primitive-type)
* [Complex type](#complex-type)
+* [Auto schema](#auto-schema)
### Primitive type
@@ -100,9 +102,9 @@ The following table outlines the `struct` types that Pulsar schema supports:
| `NativeAvroBytesSchema` | [`NativeAvroBytesSchema`](schema-get-started.md#native-avro) wraps a native Avro schema type `org.apache.avro.Schema`. The result is a schema instance that accepts a serialized Avro payload without validating it against the wrapped Avro schema. <br /><br />When you migrate or ingest event or messaging data from external systems (such as Kafka and Cassandra), the data is often already serialized in Avro format. The applications producing the data typically have [...]
Pulsar provides the following methods to use the `struct` schema.
-* `static`
-* `generic`
-* `SchemaDefinition`
+* static
+* generic
+* SchemaDefinition
This example shows how to construct a `struct` schema with these methods and use it to produce and consume messages.