Skip to content

Conversation

slinkydeveloper
Copy link
Contributor

@slinkydeveloper slinkydeveloper commented Oct 8, 2025

This PR is a continuation of the past few PRs related to the schema registry.

The goal here it to make the module restate_types::schema self-contained, creating a single place where we have the schema registry:

  • Update logic -> SchemaRegistry data structure
  • Access logic -> SchemaRegistry data structure and submodules deployment, service, invocation_target, etc
  • Internal representation -> Schema data structure

Now restate_types::schema could even be moved in its own crate (still depends on a bunch of restate_types, but not too many!)

This PR also simplifies some of the access logic API, such as removing the nesting DeploymentMetadata.

slinkydeveloper and others added 7 commits October 8, 2025 11:46
* Moved SchemaRegistry in types, together with updater.
* Abstract away the dependencies required by the SchemaRegistry
* Privatized the schema updater types, especially errors.
* Split registry in multiple files.
* Flatten DeploymentMetadata in just Deployment
* Group the arguments for add_deployment and update_deployment
Copy link
Contributor

@muhamadazmy muhamadazmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @slinkydeveloper for this PR. the changes in general looks good to me. I left couple of nits :)

I am also wondering if we really need the generic type parameters that is leaking everywhere, mainly <Metadata, Discovery, Telemetry>. Or can we get away with using the concrete implementations of those objects since it seems we only have mainly one implementation of each. Are they used in testing ?


#[derive(Debug, thiserror::Error, codederror::CodedError)]
pub enum SchemaError {
pub(in crate::schema) enum SchemaError {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL :)

@slinkydeveloper
Copy link
Contributor Author

Or can we get away with using the concrete implementations of those objects since it seems we only have mainly one implementation of each. Are they used in testing ?

Yes I would like to be able to test the rest api endpoints, plus I needed to abstract away metadata, discovery and telemetry to bring this inside restate_types. An example of such test is here: #3887

Originally, I wanted to just use dyn traits here, but unfortunately I cannot because they have GATs and generics :(

@slinkydeveloper slinkydeveloper merged commit 1241350 into restatedev:main Oct 10, 2025
25 checks passed
@slinkydeveloper slinkydeveloper deleted the schema-registry-abstract branch October 10, 2025 07:47
@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants