Skip to main content
Solved

FDM/Data modelling versioning management

  • July 26, 2023
  • 1 reply
  • 43 views

Forum|alt.badge.img

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 

Best answer by Jason Dressel

@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

View original
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img
  • Seasoned Practitioner
  • 285 replies
  • Answer
  • July 27, 2023

@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


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings