Skip to main content

Manage data models

To get ann even deeper and more complete insight into data modeling, take a look at the Advanced data modeling tutorials.

Overview of data model management

When managing data models, you need to look at four dimensions:

  1. How to move data models from development to stage to production environments (projects).
  2. How data models are organised in spaces.
  3. How to evolve data models over time using versioning.
  4. How data flows from source data models through domain data models to solution data models.

Let's look at a simple example of how these dimensions interact.

The center of your universe should be the domain data model. You can think about this model as a complete and consistent view of a part of the physical world. It should contain all the ways of structuring and relating data that you need to solve your business problems. The domain data model can be small and for example consist of an actor, a movie, and a relationship between them. Or it can be a large data model based on an industry standard with hundreds or thousands of data types, relationships, and tens of thousands of properties.

Below is a simple example of a movie and actor domain data model. Since you don't want others to break your data model, you put it in a space called domain_models that only has read access. This is your version 1, and you use a development project called dev to test your data model.

You want to evolve the data model to add a new property nationality to the Actor data type. You create a new version of your data model called 1-test-newproperty (not shown).

  1. Now, you realize it could be a good idea to generalize the Actor type to Person. A Person may be used by many other data models, so you create a new space, generics, and add the Person type there. As part of this change, you create a new version of your data model, 2, where the Actor inherits Person and nationality is an added property (see below).
  1. Now, other data models can reuse your Person data type. Then, you get a request from an enthusiast who wants to build an application with many details about actors only. You create a new solution data model, ActorDetails, in a new space, actor_details_app, inheriting the Actor class from your domain_models space. This is version 1 of the ActorDetails data model and can be used to build an application to manage and search for actors and their details.
  1. You are now satisfied with your data models and want to move them to production. You need three spaces: generics, domain_models, and actor_details_app. Load the GraphQL schema for Person in generics, the Actor v2 schema in domain_models, and the ActorDetails v1 schema in actor_details_app space.

Note: We do not require v1 and v1-test-newproperty versions of the Actor class in the production environment.