Organizing Your Data Model: The Power of Subdiagrams

Organizing Your Data Model: The Power of Subdiagrams

small image of office building in Leiden

The Datanamic Team
25 APR, 2025

In DeZign for Databases, subdiagrams are a very useful way to manage complexity when you are working with large data models. Rather than overwhelming yourself or your audience with an entire enterprise-wide schema all at once, subdiagrams allow you to zoom in on specific parts of the model and present them in a clear, focused manner.

What is a Subdiagram?

In addition to the default Main Diagram, you can create subdiagrams. At its core, a subdiagram is a custom visual representation of a portion of your data model. It doesn't create a separate copy of the data. The underlying entities, attributes, and relationships all remain part of the same unified model. A subdiagram is an independent view of a subset of the objects in a project. Each subdiagram and each object in a subdiagram has its own display characteristics. One object can be placed in multiple subdiagrams. Modifications to subdiagram objects automatically propagate to the main diagram and other subdiagrams where we can find this object. There is no limitation in the number of subdiagrams in a project. A project must at least have one main diagram.

Why Use Subdiagrams?

Large Data Models

It is recommended to use subdiagrams when dealing with large data models. When the number of entities on an ER diagram grows beyond roughly 30 entities, it becomes difficult to maintain a clear overview in a single diagram. Subdiagrams help by allowing you to break down the model into smaller views. This makes it easier to manage and understand you data model.

Subdiagram for Each Database Schema

It is a good practice to create subdiagrams for each database schema in your database when you're working in environments with multiple schemas. Each schema often serves a specific purpose or is tied to a particular application module or business function. By creating a subdiagram for each schema, you keep your data model organized and aligned with the logical structure of your database. Having subdiagrams per schema is not only useful for clarity but also for collaboration, since different teams may be responsible for different database schemas.

Difference Between the Main Diagram and a Subdiagram

The main diagram is usually the default view of your entire model, or at least a high-level representation of it. It's where many modelers start when building out their schema. The main diagram tends to be more comprehensive and serves as the foundation for the structure of your data model.

A subdiagram, on the other hand, is more like a lens. You define what portion of the model you want to see through that lens, and DeZign for Databases lets you lay it out however you like. This doesn't mean you're duplicating entities - you're just referencing them in a different visual context. Any changes you make to the entity structure (like renaming an attribute or adding an attribute) will reflect across all diagrams where that entity appears, because it's still the same object in the model.

Working with Subdiagrams in DeZign for Databases

DeZign for Databases allows you to create subdiagrams to organize and manage your data models. You can create a new empty subdiagram, generate one based on selected objects, or automatically create/update a subdiagram for each database schema. You can also add or remove objects from any subdiagram at a later stage.

Create a New Empty Subdiagram

To create a new subdiagram:

  • Right-click the Diagrams node or an existing diagram in the Object Browser, then select New Diagram from the context menu.

Or:

  • Go to the application menu and select Diagram | New Subdiagram.

A new empty diagram will be created and activated, usually with a default name such as Diagram_1. The Diagram Properties dialog will be opened now. You can rename the diagram here and make a selection of objects to add to the new diagram.

Rename and select entities and views you want to add to the diagram in the Diagram Properties dialog.

Rename and select entities and views you want to add to the diagram in the Diagram Properties dialog.

Create a Subdiagram from Selected Objects

To create a subdiagram based on a selection of objects:

  • Open an existing (sub)diagram and select the entities or objects you want to include.
  • Right-click on the diagram surface and choose New Diagram from Selection from the context menu.
    Or:
  • Go to Diagram | New Diagram from Selection in the application menu.
Create a new subdiagram from selected objects.

Create a new subdiagram from selected objects.

A new diagram containing the selected objects will be created. The layout of these objects will be copied from your original diagram and positioned in the upper-left corner of the new diagram. If you're not satisfied with the initial layout, you can manually rearrange the objects to your preference. You can also use the built-in auto-layout feature by selecting Diagram | Layout Diagram... from the application menu.

Automatically Create a Subdiagram for Each Database Schema

When working with databases containing multiple schemas, it's a good practice to create separate subdiagrams for each one. DeZign for Databases can automatically generate and update these subdiagrams during reverse engineering or through the following tool:

  • Go to Diagram | Create (or Update) Diagrams for Each Schema from the application menu.

This will open the Create Diagrams for Each Schema dialog, showing which subdiagrams will be created, updated, or removed. Click OK to apply the changes.

Create (and update) subdiagrams for each schema dialog.

Create (and update) subdiagrams for each schema dialog.

Adding and Removing Objects in Subdiagrams

There are multiple ways to manage objects in subdiagrams:

Using the Add/Remove Objects Dialog

  • Select Diagram | Add/Remove Objects or right-click a diagram in the Object Browser and choose Add/Remove Objects.
  • The Diagram Properties dialog opens with the Add/Remove Objects tab active. Check or uncheck objects to add or remove them from the active diagram.
Note: Relationships are automatically added when both parent and child objects are present in the diagram. If only one (or neither) is present, the relationship won't appear.

You cannot use this feature with the main diagram.

Dragging from the Object Browser

You can also drag entities and views directly into a subdiagram:

  • In the Object Browser, select an entity or view.
  • Drag it to the active diagram window and drop it at the desired location in the diagram.
Note: Each entity/view/relationship can appear only once in a subdiagram. You cannot drag objects into the main diagram.

Using the Manage Occurrences in Diagrams Dialog

To add/remove objects from a diagram using the Manage Occurrences in Diagrams dialog:

  • Right-click an object's node in the Object Browser or right-click on an object in the diagram and select In diagrams | Manage Occurrences in Diagrams... from the context menu.
  • This will open the Manage Occurrences in Diagrams dialog, showing a list with all diagrams in the project. Each diagram in the list has a checkbox.
  • When you check a diagram and click OK, the object will appear in the diagram.
  • When you uncheck a diagram and click OK, the object will be removed from the diagram.
Add or remove an object to/from subdiagrams with the Manage Occurrences in Diagrams tool.

Add or remove an object to/from subdiagrams with the Manage Occurrences in Diagrams tool.

Removing Objects from a Subdiagram

To remove objects:

  • Select the object(s) in the diagram.
  • Press the Delete key. You will be prompted to choose:
    • Remove only from the diagram
    • Remove from both the diagram and the project

Exception: Relationships are always removed from the project entirely when deleted from a diagram.

Deleting a Subdiagram

To delete a subdiagram:

  • Right-click the diagram in the Object Browser, then choose Delete.
Or:
  • Go to Diagram | Delete Subdiagram, select the diagram from the list, and confirm deletion.
Note: The main diagram cannot be deleted. Every project must have one.

When a diagram is deleted, the underlying objects are preserved (except for elements like text areas and stamps).

Conclusion

Subdiagrams are a powerful way to bring structure to complex data models. By breaking your model into manageable, topic-specific diagrams, you not only maintain clarity but also improve collaboration between teams and communication with stakeholders. Whether you're working on a large enterprise database or a modular system with multiple database schemas, subdiagrams in our data modeling tool DeZign for Databases give you the flexibility to model with focus, without ever losing sight of the bigger picture.