Database Modeling Tip: Color Your ERD Diagrams

In real-world applications, a database model can have a few hundreds of tables and views. How can you make such a diagram more readable? A solution is to color the entities in the diagram.

What do I color?

The coloring strategy is up to you and your team. Use colors so that they help you. Here are some of my suggestions.

Strategy 1: Color the aspects of the system

You can color tables associated with one aspect of the system. Take a look at this model of a simple conference registration system, which uses an external payment system to handle online payments. There are:

  • green (think $$$) tables associated with the order,
  • orange (for conference logo) tables representing conference participant,
  • blue (external system logo) tables associated with an external payment system, and finally
  • gray (not really part of the data model) technical tables which store the application setup.

The diagram is readable, and the colors tell you where to look if you want to find information about a piece of data. Plus, the colors brighten your day and make it fun to work with the diagram.

Strategy 2: Color the table role in the system

Another solution is to color the role of the tables in the system. Here is the same model as before using this coloring. Here

  • ordinary tables are plain white,
  • violet entities are views,
  • tables with initial data are light blue,
  • dictionary tables are gray.

Distinguishing between the four roles in this way might be useful if you use OneWebSQL's dictionary feature.

What else to think about: printing

When you choose colors for the diagram, you should take into account that programmers often work with the printed version of the diagram (often hung as wallpaper). The colorful diagram that you love so much on screen loses all the colors in print. The black-white-blue color palette in the other version of diagram prints much better, you can still see the difference between the four colors in print.

Ultimately, the coloring strategy is up to you and how you plan to use your diagrams.

Find out how to color diagrams in the modeler you use:

How do you use colors in your diagrams?