Content Hub Tip #5: Best practices for schema modelling

Content Hub Tips

One of the coolest things about the Content Hub is its limitless extensibility of the schema. If you can imagine it, you can create it. It doesn't stop with the creation of custom entity definitions, you can also create the custom pages that you require for its schema. However, you need the Free Modeling license to do so.

IMPORTANT

To create entity definitions, you require the Free Modeling license. To purchase this license, contact your Sitecore account manager.

Best practices

  1. Only one person should be making changes to the schema at any given time. When making changes with multiple people at the same time, will be sure to result in schema conflicts

  2. After each change, hit the Apply changes / Publish button each time. This will prevent conflicts as much as possible.

  3. Make small changes and verify those changes. After a couple of changes, you probably lose track of what you've changed in the first place. So make the changes small.

  4. If you want to change the data type of a property, you can only do so by recreating it. First, delete the property from the schema, then hit Apply changes / Publish first! If you forget this step, you will run into a schema conflict. When saved, recreate the property.

  5. How to solve schema conflicts? The only thing that you can do, discard the changes made to the schema. That's why it's important to do small changes and save them regularly.

  6. As you might have noticed already, all entity definitions within the schema are prefixed by Sitecore. It's a best practice to prefix your custom assets as well. I like to use the prefix C of Custom to mark the entity definition as custom. Discuss it with your team and write them down as guidelines.

  7. Next to the prefix guidelines, also discuss the naming of properties for instance. I prefer to use Pascal Casing for the Name.

  8. When creating a relationship between two entity definitions, name the relation with a descriptive name. A best practice is to start with the parent and then the child. For example: ParentToChild. When doing this consequent, everyone understands the relationship at the first glance.

  9. Fill in the Associated label for relations. This is the label that will be shown on the other side of the relationship. Making it easier to understand the relationship of the definitions.

Keep in mind: Fail fast, fail often and learn!

On the Sitecore docs, I've found the video about the Schema extension.


Until next time!