Repository navigation
Replies: 1 comment
|
For our records, a few members (including me) had two offline discussions and went through a lot of the details in the design. @bobbai00 Thanks for the excellent proposal. I agree with most of it. A few minor comments:
|
Uh oh!
There was an error while loading. Please reload this page.
Existing Data Model
As illustrated in #9394 , today's Texera's resource management are scattered and ad-hoc. This reflects in Texera's current relational model
This model has three limitations:
wid,did, andmid, and repeats the attributes they all share, such as the name. A new kind has to repeat them again.ownandaccessare defined once per kind, which gives ten relationships for two ideas. They also differ by kind: a warehouse and an environment cannot be shared, and an execution has neither.Part 1 addresses the first two limitations, and Parts 2 and 3 address the third.
Part 1: Unified Resource And Resource Access
Unified Resource
Today each kind of resource, such as a workflow, a dataset, or a computing unit, is its own entity, with its own identifier and its own relationships to
User. I propose one supertype,Resource, and making every kind a subtype of it through an ISA relationship.Resourceholds what all kinds share, starting with one identifier,rid, and each kind keeps only the attributes and relationships that are specific to it.For example, here is what
Resourcekeeps and what each kind keeps:rid,kind,name,description, andcreation time.content, which is the operators and links on its canvas.repository, which is where its files are stored.framework, such as PyTorch.type, such as Kubernetes, and itsuri, which is its address.bucket, which is where the results of executions are stored.packages, which are the Python packages it installs.status, such as running or completed.So the workflow "Iris classifier" has its name, description, and creation time in
Resource, and its content inWorkflow. The attributes listed for each kind are representative ones, not all of them.I think this has two benefits:
Resource, such as the name or access, applies to every kind through inheritance.Resource, and it inherits everythingResourcealready has.Resource Access
Access is modeled between
UserandResource, so every kind inherits it. I see two alternative designs. Both keepcreated byas its own relationship, which records the user who created the resource. They differ in whetherownis also its own relationship or a level ofaccess.Design A: Separate Own And Access
In this design
UserandResourcehave three relationships:Design B: Own As A Level Of Access
In this design
ownandaccessare combined into oneaccessrelationship with three levels, andcreated bystays as it is in Design A:Recommendation
I prefer Design A, for two reasons:
ownis its own relationship rather than a level ofaccess.ownis many-to-one, and every resource takes part in it, so the database can enforce that every resource has exactly one owner. In Design B, that is a rule kept outside the model.Part 2: Versions And Version Access
Three kinds of resources have versions today: workflows, datasets, and models. I propose adding environments as a fourth, and giving each of the four its own version entity, so a
WorkflowhasWorkflow Versions, aDatasethasDataset Versions, aModelhasModel Versions, and anEnvironmenthasEnvironment Versions. Every version belongs to exactly one resource. The other kinds, such as computing units, have no version entity.I propose modeling each version entity as a weak entity. A version has no identifier of its own: it is identified by the
ridof the resource it belongs to, together with its own version number,vno. For example, the third version of workflow 7 is identified byrid7 andvno3. In the diagram below, a double border marks a weak entity and the relationship that identifies it, and a dashed underline marks its partial key.Access to a version comes from its resource. As in Part 1,
accessis only betweenUserandResource, and a version has no access of its own. For example, a user who can read the dataset "Iris flowers" can read every version of it, including versions added later.Part 3: Lineage
Lineage records how resources and their versions depend on each other, and who started each execution. I propose modeling each kind of dependency as its own relationship:
As a result, a dataset version can be traced back to the execution that exported it, and from there to the workflow version it executed, the dataset versions that workflow version read, the user who started it, the computing unit that hosted it, the environment versions it used, and the warehouse that stores its results. The diagram shows these seven relationships; other pairs, such as an execution exporting a model version, are added the same way. Access works as in Parts 1 and 2 and is left out of the diagram.
All reactions