Data access rules between warehouse layers

Updated at:

After defining the layers of a data warehouse, you must establish rules for how data in one layer is accessed from another.

Data access rules between warehouse layers

The ADS application layer should preferentially access data from the common layer of the data warehouse. If data already exists in the CDM layer, ADS must not bypass CDM and reprocess data from ODS. CDM should identify the data requirements of the application layer and consolidate reusable data in the common layer to serve other layers. ADS should also work with CDM to continuously improve shared data. Avoid excessive references to ODS, unnecessary data copying, and redundant subsets. Follow these rules for access between layers:

  • Application-layer tasks must not reference ODS data directly. If the intermediate layer has not consolidated the required ODS data, access it through a view in the CDM layer. CDM views must be encapsulated in scheduled programs so that they remain maintainable and manageable.

  • CDM task chains should not be too deep. We recommend no more than 10 levels.

  • A computation and refresh task should output only one table, except in special cases.

  • If multiple tasks refresh and output to one table by writing to different partitions, create a virtual task in DataWorks that depends on the refresh and output of those tasks. Downstream tasks should generally depend on this virtual task.

  • The CDM summary layer should preferentially access the CDM detail layer when calculating additive metrics. Where possible, it should first use existing coarse-grained summaries instead of calculating large amounts of summary data directly from massive detail-layer datasets.

  • Cumulative snapshot fact tables in the CDM detail layer should preferentially access CDM transactional fact tables to maintain data consistency.

  • Build the CDM common summary layer for specific needs to prevent the application layer from relying excessively on CDM detail data.