AnsweredAssumed Answered

Mapr DB rowkey design for fact and dimension

Question asked by bhabaniranjan on Jul 30, 2017
Latest reply on Aug 2, 2017 by bhabaniranjan

Hi Experts,

I am very new to the MapR community. I apologize in case I have not followed the forum etiquette  properly.


We are currently designing an initial dimensional modelling for our warehouse. To make it simple I will explain the scale down version. We have a fact called FACT_SALES and four dimensions (DIM_CUSTOMER, DIM_DATE, DIM_PRODUCT, DIM_RETAILER).  I have attached the image as well. All these tables will be on MapR DB.


Questions 1: Should we use Binary or Json type table.

My assumption: Since most of the data that we will get from upstream are having flat structure we are planning to use binary type of tables.


Question 2: With all the best practices what type of rowkey we should use.  My query criteria on FACT table would be based on Date, Product, Customer and Retailer or any one.

My assumption:  Instead using sequence to create rowkey (to avoid hot-spotting), I am planning to use composite key where the the columns in composite key will be in a order from low cardinality to high cardinality. For example RETAILERKEY-CUSTOMERKEY-PRODUCTKEY-DIMDATE. 


Please correct me if I am doing something wrong.

Thanks in advance