Skip to content

subscribe-sdk: Add the Rust SDK package - #37483

Closed
bobbyiliev wants to merge 4 commits into
MaterializeInc:mainfrom
bobbyiliev:subscribe-sdk-initial
Closed

bobbyiliev wants to merge 4 commits into
MaterializeInc:mainfrom
bobbyiliev:subscribe-sdk-initial

Conversation

@bobbyiliev

@bobbyiliev bobbyiliev commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Adds the Rust package (mz-subscribe) of the Subscribe SDK under misc/subscribe-sdk (its own isolated Cargo workspace), plus the shared top-level README: the layered, correct-by-construction client (raw stream, one shared min-frontier consistency engine, single-view consistent batches and multi-view cohorts, and a bounded background drain that never backpressures Materialize) with an opaque resume token that bakes in the AS OF frontier-1 arithmetic. The Python package is a companion PR (#37517); design in #37463.

@bobbyiliev bobbyiliev changed the title subscribe-sdk: Add initial Rust and Python packages subscribe-sdk: Add the Rust SDK package Jul 8, 2026
bobbyiliev added a commit that referenced this pull request Oct 21, 2026
…37463)

Proposes the Materialize SDK: a Rust protocol core with no I/O, compiled
into thin per-language packages that use their native drivers, with
`subscribe` and `sink` modules. It answers the Sink SDK product
requirements, includes the subscribe semantics review checked against
the code, plans the move onto durable subscriptions (#38468), and makes
turbopuffer the first sink. Prototypes: #37483 (Rust), #37517 (Python).
Diagrams (Materialize-internal):
https://claude.ai/artifact/Q6193A4KskJpfWgUuYNY6v

---

**TL;DR**

- **What:** an official SDK for building your own sink from Materialize
to anything: search indexes, caches, your own Postgres, webhooks. Rust
first, with Python and Node to follow.
- **Why customers care:** no lost or duplicate data after a crash or
restart. Several views can be written at one consistent point in time,
which log-based CDC tools cannot do from offsets alone. No Kafka needed.
- **How it's built:** every hand-written sink we found had a different
bug in the same logic: when a batch is safe to write, how to resume
without gaps, how to line up several views. So that logic lives once, in
a small Rust library (the protocol core) compiled into each language
package. It runs inside the customer's app, not as a service, and never
opens a connection. Each language keeps its usual Postgres driver.
Python, Node and later languages therefore behave the same, and one fix
reaches every language in one release.
- **What a sink author writes:** open the target, write a batch, commit.
The SDK handles the snapshot, resume after restart, retries,
dead-lettering and clear errors.
- **First proof:** a turbopuffer sink running on our internal context
graph in October.
- **Input wanted:** the name (deferred question 1), whether the SDK can
rely on subscribing by id (question 2), and what a sink should do when a
blue/green deploy swaps the view it reads (question 3).
@bobbyiliev

Copy link
Copy Markdown
Contributor Author

Closing in favor of the new stack, which builds the SDK from the merged design (#37463), starting with #39770. The Rust package is now built on a shared protocol core, and the whole stack is on the sdk-preview branch.

@bobbyiliev bobbyiliev closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant