Data publishing and subscription¶
Publish tables from a source database to target workspaces, or accept an invitation and create a subscription database in a target workspace. This page covers the complete publication and subscription workflow. To create and maintain source tables, see Manage catalogs, databases, and tables.
Prerequisites¶
Prepare access for the target workspace; see Prepare to call an API for common rules.
Before creating a publication, identify the source database and all or selected tables to publish.
Before accepting a subscription, obtain the target subscription from the subscription list and choose the subscription-database name for the target workspace.
Call sequence¶
Publishers list source database tables available for publication and check the publication name to use. Query or resolve workspace names only when you need to verify names in an existing data-sharing relationship.
Create a data publication and record its ID. Creation means that the publication was established; the target workspace must still accept the subscription.
Use the publication list and summary to confirm the current publication and its coverage. Update it to adjust table scope, target workspaces, or remarks.
Subscribers list received subscriptions, select the target subscription, accept it, and specify the subscription-database name. List subscriptions again afterward to confirm the result.
Before unsubscribing or deleting a publication, confirm that downstream workspaces no longer depend on the data. Query the relevant list again after the operation to confirm the result.
API operations¶
Prepare and maintain data publications¶
What you need to do |
API operation |
Use it when |
|---|---|---|
Query source database tables |
Select source database tables for a publication. |
|
Check a publication name |
Check whether the name is available in the current workspace before creation. |
|
Query workspace names |
Query names using workspace IDs from an existing data-sharing relationship. |
|
Resolve workspace names in bulk |
Resolve names for multiple workspace IDs. |
|
Create a data publication |
You identified the source database, table scope, and target workspaces. |
|
Query data publications |
Select, confirm, or check data publications in the current workspace again. |
|
Query a publication summary |
View the number of publications and target workspaces in the current workspace. |
|
Update a data publication |
Adjust a publication’s table scope, target workspaces, or remarks. |
|
Delete a data publication |
Target workspaces no longer need the publication. |
Accept and unsubscribe from data subscriptions¶
What you need to do |
API operation |
Use it when |
|---|---|---|
Query data subscriptions |
View subscriptions received by the current workspace and select an invitation to handle. |
|
Accept a data subscription |
You identified a subscription and target subscription-database name. |
|
Unsubscribe from data |
An accepted subscription is no longer needed. |
Confirm the result¶
Publishers use List publications and Get a publication summary to confirm publication status. After accepting or unsubscribing, subscribers use List subscriptions to confirm current subscriptions. A successful publication creation does not mean that a target workspace accepted the subscription.
Limitations and notes¶
Checking a publication name does not replace the final uniqueness check at creation.
Deleting a publication affects related subscription access. Confirm target workspaces no longer need the publication first.
After unsubscribing from an accepted subscription, its subscription database in the target workspace is deleted and the record returns to an invitation that can be accepted again.