Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Schemas #229

Open
philippguertler opened this issue Dec 5, 2019 · 0 comments
Open

Dynamic Schemas #229

philippguertler opened this issue Dec 5, 2019 · 0 comments

Comments

@philippguertler
Copy link

philippguertler commented Dec 5, 2019

⚠️ This document is still WIP! ⚠️

Dynamic Schemas

A weakness in Gentics Mesh is the adaption to changes in a project. This is apparent in early stages by creating and frequently updating schemas during development. In later stages of the project, the customer might want a change in their project, which often requires a schema migration, updating every node of the schema in the process. To alleviate the pains in these cases, I propose the introduction of dynamic schemas in Gentics Mesh.

Example Usage

POST /demo/nodes

{
  "schema": "$dynamic",
  "parentUuid": "558c145de32843bc9831b87e5d1f7534",
  "language": "en",
  "fields": {
    "name": "StartPage",
    "title": "Hello World!"
  }
}

This creates a node with the dynamic schema. You do not need to create a schema before creating the node. After that you can update the node like usual:

POST /demo/nodes/ca6c7df3f45b48d4ac7df3f45ba8d42f

{
  "language": "en",
  "fields": {
    "name": "StartPage",
    "title": "Hello World!",
    "content": "Welcome to my site!"
  }
}

As you can see, a new field has been added to the node without changing the schema.

You can use any structure you like:

POST /demo/nodes/ca6c7df3f45b48d4ac7df3f45ba8d42f

{
  "language": "en",
  "fields": {
    "name": "StartPage",
    "title": "Hello World!",
    "content": "Welcome to my site!",
    "footer": {
      "editors": [
        "John Doe",
        "Jane Doe"
      ],
      "text": "Powered by Gentics Mesh"
    }
  }
}

This is the core usage of the dynamic schema and allows for more convenient development and adaptation to changes. However, this concept raises a lot of questions regarding existing features of Gentics Mesh.

Pros & Cons

Existing Features

Containers

Webroot

Elasticsearch

GraphQL

Binaries

Micronodes / Microschemas

@philippguertler philippguertler changed the title The Dynamic Schema Dynamic Schemas Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant