Skip to content

Cross-Database Subscription Does Not Require Primary Key #955

@rmbeddor14

Description

@rmbeddor14

DOCUMENTATION ISSUE: Cross-Database Subscription Does Not Require Primary Key

Page: https://docs.risingwave.com/operate/workload-isolation-interaction#cross-database-streaming-ddl-create-mv-create-sink-requires-subscriptions

Summary

The documentation states that the upstream object "must also have a primary key defined"
before creating a subscription for cross-database streaming. This is inaccurate — we
successfully created a subscription on a materialized view with no primary key and used
it for cross-database MV creation.

What the docs say

"The upstream object must also have a primary key defined."

The example reinforces this:
CREATE TABLE t1 (v1 INT PRIMARY KEY); -- Ensure PK exists
CREATE subscription sub_t1 FROM t1 WITH (retention = '1D');

Suggested doc changes

  1. Describe the differences in RisingWave behavior between upstream pk and upstream without pk:
    Change "The upstream object must also have a primary key defined."
    To something like (verify for accuracy):
    "If the upstream object has a primary key, the changelog will track changes
    by key (insert, update, delete). Without a primary key, the changelog is
    append-oriented — updates are represented as delete + insert of full rows.
    A primary key is recommended for tables with frequent updates but is not
    required."

  2. Update the example to show both cases — with PK and without — so users
    understand the tradeoff rather than thinking it's a hard requirement.

  3. Clarify that subscriptions work on materialized views (not just tables).
    The current example only shows CREATE TABLE. A user reading the docs might
    assume subscriptions are table-only.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions