ADR: New API to handle system schemas

Status

  • Proposed
  • Trialing
  • Under review
  • Approved
  • Retired

Context:

Public schemas are schemas which are available to all the tenants out of the box. Today the public schema includes schema from OSDU or SLB and are located in Schema service repository here: https://community.opengroup.org/osdu/platform/system/schema-service/-/tree/master/deployments/shared-schemas

How it's done today:

  • Deployment expects existence of a special partition (generally termed as common) which will be used to load public schemas
  • Schema service has only one endpoint today /schema. Based on the data-partition-id passed in the request headers, it's decided whether the schema is public or private.
  • If the data-partition-id passed is "special partition", then the created schema is public, otherwise it's private. This is indicated by a field named SCOPE in crated schema.

Issue with current design:

  1. The API behavior of /schema endpoint changes based on the data-partition-id header and can be confusing to users. Users might end up unknowingly creating public schemas by passing data-partition-id of special partition.
  2. The special partition is expected to be provisioned for provisioning public schemas.

Proposal:

There are two types of schemas in the system, public (or system) schemas and private schema. The proposal is to create a dedicated API to created/ update system schemas. Hence-

  • The new API shall be termed as /schemas/system
  • To create/ updated public schema- /schemas/system endpoint shall be used
  • To read public schema- existing GET /schema endpoint shall be used (same as current behaviour)
  • The new API shall not accept data-partition-id as a header. Service would be aware where the public schemas are located.
  • The authorization of new end point shall be different from exiting schema.editor/viewer role.

Sequence diagram for creating public schemas image

Sequence diagram for reading public schema

image

Edited by Abhishek Chowdhry