Solved

FDM/Data modelling versioning management

  • 26 July 2023
  • 1 reply
  • 33 views

Badge

Hi, 

I am looking for documentation regarding what kind of DM structure change is considered as safe change, breaking change or unsupported change in the data modelling but couldn’t find it.  And is it possible to provide best practices for DM versioning management? 

Kind advice.

Thank you, 

Kind regards, Carrie 

icon

Best answer by Jason Dressel 27 July 2023, 18:39

View original

1 reply

Userlevel 4
Badge

@carriechung,
Regarding model structure changes: https://developer.cognite.com/dm/graphql/modeling#versioning
In short, every structure change to your Type will be a new version. 

In regards to versioning best practices it’s important to understand that a data model is a versioned collection of versioned views.  You can see this when you query the data models endpoint: GET /models/datamodels.  This returns a response like the following:

The model is versioned and each view (type) of that model are versioned.  You explicitly control the version of the model and views.  A discussion can be found here: https://docs.cognite.com/cdf/data_modeling/guides/manage_dm
Versioning can be done in multiple ways.  If you are using the Fusion user interface, you can specify the version of the model when you publish and explicitly version each view using the @view directive.  If you are publishing your models via the API, then you set the version in the API request.

{
"items": [
{
"space": "imdb",
"externalId": "imdb",
"version": "1",
"createdTime": 1690391187165,
"lastUpdatedTime": 1690391233930,
"isGlobal": false,
"name": "imdb",
"description": "",
"views": [
{
"type": "view",
"space": "imdb",
"externalId": "Person",
"version": "1"
},
{
"type": "view",
"space": "imdb",
"externalId": "Actor",
"version": "1"
},
{
"type": "view",
"space": "imdb",
"externalId": "Director",
"version": "1"
},
{
"type": "view",
"space": "imdb",
"externalId": "Movie",
"version": "1"
},
{
"type": "view",
"space": "imdb",
"externalId": "ActedIn",
"version": "1"
}
]
}
]
}

 

Hope this helps,

Jason

Reply