mcpField
R
risingwave-best-practices

risingwave-best-practices

github.com/risingwavelabsData & databases994 installsUpdated 29w ago
Repository

About risingwave-best-practices

risingwave-best-practices is a review skill for RisingWave designs and SQL. It organizes 14 rules across schema design, materialized views, streaming SQL, sinks, and performance, explaining issues and fixes.

Key features

  1. 01覆盖 14 条设计与性能规则
  2. 02检查 Schema 与数据源选择
  3. 03审查物化视图及流式 SQL
  4. 04检查 Sink 配置与输出行为
  5. 05评估共享数据源、索引和并行度

Use cases

  1. 01审查 RisingWave Schema 设计
  2. 02检查物化视图定义与创建方式
  3. 03评估流式 SQL 和 CDC 模式
  4. 04排查 Sink 配置与性能问题

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/risingwavelabs/agent-skills --skill risingwave-best-practices

After installing, type/risingwave-best-practicesin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
rules/
_sections.md
_template.md
mv-background-ddl.md
mv-emit-on-window-close.md
mv-no-order-by.md
perf-indexes-on-mv.md
perf-parallelism.md
perf-shared-source.md
schema-append-only.md
schema-source-vs-table.md
schema-watermark.md
sink-force-compaction.md
sink-snapshot-false.md
stream-cdc-pattern.md
stream-temporal-join.md
stream-tumble-windows.md

Details

From the project README

RisingWave Best Practices

14 rules covering schema design, streaming SQL patterns, sink configuration, and performance.

How to Apply

  1. Read the relevant rule files for the review type below
  2. Apply rules to the design or code under review
  3. Explain violations with their impact and the fix

Review Procedures

Schema Review
Materialized View Review
Streaming SQL Review
Sink Review
Performance Review

Rule Categories

PriorityCategoryImpactPrefixRules
1Schema DesignCRITICAL / HIGHschema-3
2Materialized ViewsCRITICAL / HIGHmv-3
3Streaming SQLCRITICAL / HIGHstream-3
4Sink ConfigurationHIGH / MEDIUMsink-2
5PerformanceHIGH / MEDIUMperf-3

Quick Reference

Schema:

  • schema-source-vs-table — CDC requires TABLE; SOURCE is for append-only streams
  • schema-append-only — APPEND ONLY enables optimizations; use for immutable event data
  • schema-watermark — Define watermarks at ingestion point (source/table), not in MVs

Materialized Views:

  • mv-emit-on-window-close — Use EOWC for final window results; default emits partial updates
  • mv-background-ddl — SET BACKGROUND_DDL=true before creating MVs over large tables
  • mv-no-order-by — ORDER BY in MV applies only at creation, not to ongoing results

Streaming SQL:

  • stream-tumble-windows — Use TUMBLE/HOP/SESSION, not date_trunc, for streaming windows
  • stream-cdc-pattern — Two-step: CREATE SOURCE (shared) → CREATE TABLE ... FROM source
  • stream-temporal-join — Join streaming source with CDC table using FOR SYSTEM_TIME AS OF

Sinks:

  • sink-snapshot-false — Always use snapshot = false when adding sinks to existing MVs
  • sink-force-compaction — Use force_compaction = true for high-cardinality upsert sinks

Performance:

  • perf-shared-source — Multiple MVs from one Kafka topic should use shared source
  • perf-indexes-on-mv — Create indexes on MV columns used in WHERE/JOIN predicates
  • perf-parallelism — Increase parallelism for high-throughput MVs

Comments

Markdown supported