gentics / mesh-incubator

Project which is home for planned enhancements for Gentics Mesh
3 stars 0 forks source link

Restructure Schema Model #210

Open philippguertler opened 5 years ago

philippguertler commented 5 years ago

Motivation

The current schema model looks like this:

Schema_Migration_Old

Labels: B -> Branch, S -> Schema, SV -> Schema Version, N -> Node, NC -> Node Content

When updating a schema, a new version is created and all nodes have to be migrated to the new version. A migration creates a new node content for every node which is costly when there are many nodes in that schema. Because of that, schema migrations should be avoided when possible. Nodes only have to be migrated when structural changes have been made to the schema (one or more fields have been added, deleted or changed). However, currently a migration is triggered even when only non-structural changes have been made (#185). This proposal aims to eliminate these unnecessary migrations.

Proposal

The proposed schema model looks like this:

Schema_Migration_New

Labels: SSV -> Schema Structure Version

There is now an additional type of node in the graph, the Schema Structure Version. A new SSV will only be created when a structural change has been made. When a non-structural update has been made, only a new SV will be created and no migration is necessary.

Pros

Cons

Tasks