Skip to content

Instantly share code, notes, and snippets.

@rido-min
Last active May 16, 2024 00:06
Show Gist options
  • Save rido-min/6115085a402111391f58c3577c829146 to your computer and use it in GitHub Desktop.
Save rido-min/6115085a402111391f58c3577c829146 to your computer and use it in GitHub Desktop.
SchemaRegistryFlows

Schema Registration Diagrams

No versioning

sequenceDiagram;
    participant Connector
    participant SREdge
    participant SRCloud

    Connector -->>+ SREdge: Register(Schema: string)
    SREdge -->>+ SREdge: IsValid()
    SREdge -->>+ SREdge: ComputeId(Sha256)
    SREdge ->>+ SRCloud: Register(id: string, schema: string)
    SRCloud -->>+ SREdge: returns Version 1.0.0
    SREdge ->>+ Connector: returns SchemaMD(id, version)
Loading

Versioning without tags

sequenceDiagram;
    participant Connector
    participant SREdge
    participant SRCloud

    Connector -->>+ SREdge: Register(Schema: string, lastId: string)
    SREdge -->>+ SREdge: IsValid()
    SREdge -->>+ SREdge: ComputeId(Sha256)
    SREdge ->>+ SRCloud: GetSchema(lastId: string)
    SRCloud ->>+ SREdge: returns SchemaMD(id+version)
    
    SREdge ->>+ SREdge: CompatCheck(lastSchema) : newVersion
    SREdge ->>+ SRCloud: Register(id: string, schema: string, tag: string, newVersion: string)
    SRCloud ->>+ SREdge: returns SchemaMD (id+newVersion)
    
    SREdge ->>+ Connector: returns SchemaMD(id, version)
    
Loading

Versioning with Tags

sequenceDiagram;
    participant Connector
    participant SREdge
    participant SRCloud

    Connector -->>+ SREdge: Register(Schema: string, Tag: string)
    SREdge -->>+ SREdge: IsValid()
    SREdge -->>+ SREdge: ComputeId(Sha256)
    SREdge ->>+ SRCloud: GetLatestByTag(tag: string)
    SRCloud ->>+ SREdge: returns schemaId[]
    par new_tag
        SREdge ->>+ SRCloud: Register(id: string, schema: string, tag: string, "1.0.0")
        SRCloud ->>+ SREdge: returns SchemaMD (id+tag+version)
    end
    par existing_tag
        SREdge->>+ SRCloud: GetSchema(string id)
        SRCloud ->>+ SREdge: returns SchemaMD (id+tag+version)
        SREdge ->>+ SREdge: CompatCheck()
        SREdge ->>+ SRCloud: Register(id: string, schema: string, tag: string, compatVersion: string)
        SRCloud ->>+ SREdge: returns SchemaMD (id+tag+version)
    end
    SREdge ->>+ Connector: returns SchemaMD(id, tag, version)
    
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment