LDM Series

Logical Data Model - Five Pro-Tips for Data Modelling

  • 19 October 2020
  • 1 reply
  • 1023 views

Userlevel 2

Five Data Modeling Pro-Tips

 

We are continuing in our series of articles about Logical Data Model in GoodData, in previous articles you’ve learned first what Logical Data Model in GoodData is, then what objects it consist of and previous article what are the basic rules for creating a viable model. If you have missed any of the articles, please read them before continuing with this one.

 

Today we will show you a few tips you should always follow when designing a Logical Data Model. Here are some more tips to work with LDM in GoodData like a pro:

  • Tip 1: Not all datasets have to be connected. It is possible to have several unrelated “silos” in one data model. You will just not be able to combine the unrelated datasets in a single insight.

 

  • Tip 2: The arrows (references) go from Primary Key to the Foreign Key in GoodData (opposite than in most other tools).
    So do not get confused by this. Each arrow means a one-to-many relationship (with the  tip of the arrow pointing to the “many” side).
    What can also help is to know that in the Modeller you will always see the foreign keys at the bottom of the dataset under a line.

This is, for example, how to model that each Order Line has one product and each product can be mentioned in zero or more sales records.

lmTVA7ly2BQh17YP8ZtqXRh9xJj0Hd8ByhzZn3mxgk6y58wl4r1PkbtZM2lHmcEEYGkosdyq7CFBmwHXK92AKDn6rZ20Ui2Ln172XIbW-bUFMQuSRn8E3SuZKx6B_csF33rt36M


 

  • Tip 3: Always think of the granularity of your dataset - understand what a single record in it means. All facts in a dataset should have the same granularity.

 

  • Tip 4: If you need to join/reference two datasets using a multi-column key (which is not possible in GoodData), generate a separate single attribute which will contain concatenated values of all the columns used in the key. For example, if you plan to  join by companyID + orderID, create an attribute which combines these two.

 

  • Tip 5: It is good practice to arrange the Logical Data Model diagram in a way that all the arrows go from left to right. It might seem weird at the beginning (because then it does not look much like a star or a snowflake), but it makes it much easier to understand the model, because you always know which direction each arrow is pointing and where the primary and  foreign keys are. Since all arrows are pointing from left to right, you are left with no ambiguity. This is also how all GoodData tools handling the data model display it by default.

    Compare this 
     


    With picture of exactly the same data model, just aligned by the rules described above. Which one is easier to follow the arrows?

 

Next article in this series is: Logical Data Model - Performance Considerations

Let us know how you like this series and feel free to post questions if something is not clear to you. For more information and practice about data modelling, please also attend our free courses at GoodData university


1 reply

For Tip #4, how do you do this?  So far, I have only been able to map logic model fields to underlying physical model columns.  I have not found a way to map an attribute to a function expression, which would concatenate the values of two or more other attributes for each row.

Reply