Skip to content

feat(connectors): add SurrealDB sink connector #3438

@countradooku

Description

@countradooku

Description

Apache Iggy should support SurrealDB as a first-class sink connector target.

SurrealDB is a multi-model database with document, graph, relational, time-series, geospatial, full-text, vector, hybrid search, and realtime capabilities. Its Rust SDK supports remote connections, async querying, authentication, and SurrealQL operations, making it a useful backend for storing Iggy stream data in queryable records.

This issue tracks the SurrealDB sink only. Source ingestion from SurrealDB is tracked separately in #3439 so the write path and read/changefeed path can be designed, reviewed, and tested independently.

Affected area / component: Connectors

Proposed solution

Add core/connectors/sinks/surrealdb_sink.

Expected sink support:

  • Remote SurrealDB endpoint configuration.
  • Namespace and database selection.
  • Credential fields stored as SecretString and never logged.
  • Configurable table target.
  • Insert, create, update, and upsert modes.
  • Optional record ID mapping from message headers, metadata, or payload field.
  • Payload formats: json, text, and raw.
  • Optional Iggy metadata fields.
  • Configurable batch size, retry count, retry delay, and verbose_logging.
  • Proper transient/permanent error mapping.

Implementation requirements:

  • Follow existing connector layout and naming conventions.
  • Keep the plugin crate as cdylib plus lib.
  • Add README and example runtime config files.
  • Add unit tests for config validation, payload mapping, write mode mapping, and error classification.
  • Add Docker-backed integration tests for sink writes, record ID mapping, upsert behavior, and payload formats.
  • Run cargo fmt --all, cargo sort --no-format --workspace, targeted tests, and connector-relevant CI scripts.
  • Validate any new dependency through the repo's third-party license workflow before merging.

Dependency note

Use the SurrealDB Rust SDK only after confirming it is acceptable for Apache Iggy's dependency policy. Avoid embedded SurrealDB storage features unless their licensing and transitive dependencies are explicitly reviewed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions