Principle:Risingwavelabs Risingwave Sink Connector Framework
| Knowledge Sources | |
|---|---|
| Domains | Connectors, Software_Architecture, Extensibility |
| Last Updated | 2026-02-09 07:00 GMT |
Overview
An extensible plugin architecture that defines standard interfaces for creating, validating, and managing sink connectors that deliver streaming data to external systems.
Description
The Sink Connector Framework provides a set of Java interfaces that all sink implementations must follow. This abstraction layer enables RisingWave to support dozens of different target systems (JDBC databases, Elasticsearch, Cassandra, Iceberg, Kafka, etc.) through a uniform protocol.
The framework consists of three core interfaces:
- SinkFactory: Creates sink writer and coordinator instances, validates configuration
- SinkWriter: Handles the actual data writing lifecycle (beginEpoch, write, barrier, drop)
- SinkCoordinator: Manages distributed commit coordination across multiple writers
New sink connectors are added by implementing these interfaces and registering them via Java ServiceLoader. The framework handles the gRPC communication, serialization, and epoch management automatically.
Usage
Use this framework when:
- Understanding how sink connectors work internally
- Implementing a custom sink connector for a new target system
- Debugging sink write failures or checkpoint issues
- Evaluating which sink connectors are available
Theoretical Basis
Plugin Architecture:
SinkFactory (interface)
├── createWriter(schema, properties) → SinkWriter
├── createCoordinator(properties) → SinkCoordinator
└── validate(schema, properties, type) → void
SinkWriter (interface)
├── beginEpoch(epoch)
├── write(rows) → boolean
├── barrier(isCheckpoint) → Optional<SinkMetadata>
└── drop()
SinkCoordinator (interface)
├── commit(epoch, metadataList)
└── drop()
Discovery:
ServiceLoader<SinkFactory> → discovers all registered factories
SinkUtils.getSinkFactory(connectorName) → returns matching factory