Skip to main content
Committed ⭐️⭐️
Jul 26, 2023 12:27 PM UTC
Solved

FDM/Data modelling versioning management

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 

Expert ⭐️⭐️⭐️⭐️
Jul 27, 2023 4:39 PM UTC

@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

1 reply

Expert ⭐️⭐️⭐️⭐️
Jul 27, 2023 4:39 PM UTC

@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