Presentation is loading. Please wait.

Presentation is loading. Please wait.

2014 Fall 1 Chapter 11: Data Warehousing 楊立偉教授 台灣大學工管系 註 : 於 11 版為 Chapter 10.

Similar presentations


Presentation on theme: "2014 Fall 1 Chapter 11: Data Warehousing 楊立偉教授 台灣大學工管系 註 : 於 11 版為 Chapter 10."— Presentation transcript:

1 2014 Fall 1 Chapter 11: Data Warehousing 楊立偉教授 台灣大學工管系 註 : 於 11 版為 Chapter 10

2 Chapter 11 2Definition Data Warehouse: Data Warehouse: A subject-oriented, integrated, time-variant, non- updatable collection of data used in support of management decision-making processes A subject-oriented, integrated, time-variant, non- updatable collection of data used in support of management decision-making processes Subject-oriented: e.g. customers, patients, students, products Subject-oriented: e.g. customers, patients, students, products Integrated: Consistent naming conventions, formats, encoding structures; from multiple data sources Integrated: Consistent naming conventions, formats, encoding structures; from multiple data sources Time-variant: Can study trends and changes Time-variant: Can study trends and changes Non-updatable: Read-only, periodically refreshed Non-updatable: Read-only, periodically refreshed Data Mart: Data Mart: A data warehouse that is limited in scope A data warehouse that is limited in scope Ex. Corporate (Data Warehouse) v.s. Department (Data Mart) Ex. Corporate (Data Warehouse) v.s. Department (Data Mart)

3 Chapter 11 3 History Leading to Data Warehousing Improvement in database technologies, especially relational DBMSs 資料庫技術的進步 Improvement in database technologies, especially relational DBMSs 資料庫技術的進步 Advances in computer hardware, including mass storage and parallel architectures Advances in computer hardware, including mass storage and parallel architectures配合大量儲存與平行運算架構的進步 Emergence of end-user computing with powerful interfaces and tools 使用者自行操作 Emergence of end-user computing with powerful interfaces and tools 使用者自行操作 Advances in middleware, enabling heterogeneous database connectivity 相互整合 Advances in middleware, enabling heterogeneous database connectivity 相互整合 Recognition of difference between operational and informational systems Recognition of difference between operational and informational systems 體認到日常作業與資訊分析是不同的 體認到日常作業與資訊分析是不同的

4 Chapter 11 4 Need for Data Warehousing Integrated, company-wide view of high-quality information (from disparate databases) 整合各種資訊 Integrated, company-wide view of high-quality information (from disparate databases) 整合各種資訊 Separation of operational and informational systems and data (for improved performance) 獨立於日常作業外 Separation of operational and informational systems and data (for improved performance) 獨立於日常作業外 Table 11-1 – Comparison of Operational and Informational Systems

5 Chapter 11 5 Issues with Company-Wide View Inconsistent key structures 不一致的 PK Inconsistent key structures 不一致的 PK Synonyms 同義字問題 Synonyms 同義字問題 Free-form vs. structured fields Free-form vs. structured fields Inconsistent data values 資料值不一致 Inconsistent data values 資料值不一致 Missing data 缺值問題 Missing data 缺值問題 See figure 11-1 for example

6 Chapter 11 6 Figure 11-1 Examples of heterogeneous data

7 Chapter 11 7 Organizational Trends Motivating Data Warehouses No single system of records No single system of records Multiple systems not synchronized Multiple systems not synchronized Organizational need to analyze activities in a balanced way Organizational need to analyze activities in a balanced way 從組織角度, 看資料需要整體來看 for Customer relationship management (CRM) and Supplier relationship management (SRM) for Customer relationship management (CRM) and Supplier relationship management (SRM)

8 Chapter 11 8 Data Warehouse Architectures Independent Data Mart Independent Data Mart Dependent Data Mart and Operational Data Store Dependent Data Mart and Operational Data Store Logical Data Mart and Real-Time Data Warehouse Logical Data Mart and Real-Time Data Warehouse Three-Layer architecture Three-Layer architecture ETL All involve some form of extraction, transformation and loading (ETL)

9 Chapter 11 9 Figure 11-2 Independent data mart data warehousing architecture Data marts: Mini-warehouses, limited in scope E T L Separate ETL for each independent data mart Data access complexity due to multiple data marts

10 Chapter 11 10 Source: adapted from Strange (1997). Table 11-2 – Data Warehouse Versus Data Mart

11 Chapter 11 11 Data Characteristics Status vs. Event Data Status Event = a database action (create/update/delete) that results from a transaction Figure 11-6 Example of DBMS log entry

12 Chapter 11 12 Other Data Warehouse Changes 加新欄位 New descriptive attributes 加新欄位 New descriptive attributes New business activity attributes New business activity attributes New classes of descriptive attributes New classes of descriptive attributes Descriptive attributes become more refined Descriptive attributes become more refined 加描述資料 Descriptive data are related to one another 加描述資料 Descriptive data are related to one another 加新資料源 New source of data 加新資料源 New source of data

13 Chapter 11 13 Derived Data 加入衍生性資料 Objectives Objectives Ease of use for decision support applications Ease of use for decision support applications Fast response to predefined user queries Fast response to predefined user queries Customized data for particular target audiences Customized data for particular target audiences Ad-hoc query support Ad-hoc query support Data mining capabilities Data mining capabilities Characteristics Characteristics Detailed (mostly periodic) data Detailed (mostly periodic) data Aggregate (for summary) Aggregate (for summary) Distributed (to departmental servers) Distributed (to departmental servers) star schema Most common data model = star schema (also called “dimensional model”) 與一般資料庫設計準則略有不同

14 Chapter 11 14 star schema Figure 11-9 Components of a star schema Fact tables contain factual or quantitative data Dimension tables contain descriptions about the subjects of the business 1:N relationship between dimension tables and fact tables Excellent for ad-hoc queries, but bad for online transaction processing Dimension tables are denormalized to maximize performance → 日常作業(有寫入或修改)還是要用正規化後的表格

15 Chapter 11 15 Figure 11-10 Star schema example Fact table provides statistics for sales broken down by product, period and store dimensions

16 Chapter 11 16 Figure 11-11 Star schema with sample data

17 Chapter 11 17 Issues Regarding Star Schema (1) Dimension table keys must be surrogate (non- intelligent and non-business related), because: Dimension table keys must be surrogate (non- intelligent and non-business related), because: Keys may change over time Keys may change over time Length/format consistency Length/format consistency 資料的精細度 Granularity of Fact Table–what level of detail do you want? 資料的精細度 Granularity of Fact Table–what level of detail do you want? Transactional grain–finest level Transactional grain–finest level Aggregated grain–more summarized Aggregated grain–more summarized Finer grains  better market basket analysis capability Finer grains  better market basket analysis capability Finer grain  more dimension tables, more rows in fact table Finer grain  more dimension tables, more rows in fact table

18 Chapter 11 18 Issues Regarding Star Schema (2) 資料期間 Duration of the database–how much history should be kept? 資料期間 Duration of the database–how much history should be kept? Natural duration–13 months or 5 quarters Natural duration–13 months or 5 quarters Financial institutions may need longer duration Financial institutions may need longer duration Older data is more difficult to source and cleanse Older data is more difficult to source and cleanse

19 Chapter 11 Size of Fact Table Depends on the number of dimensions and the grain of the fact table Depends on the number of dimensions and the grain of the fact table Number of rows = product of number of possible values for each dimension associated with the fact table Number of rows = product of number of possible values for each dimension associated with the fact table Example: Assume the following for the next Figure: Example: Assume the following for the next Figure: Total rows calculated as follows (assuming only half the products record sales for a given month): Total rows calculated as follows (assuming only half the products record sales for a given month): 19

20 Chapter 11 20 (new) Figure 9-12 Modeling dates Fact tables contain time-period data  Date dimensions are important

21 Chapter 11 Slowly Changing Dimensions (SCD) How to maintain knowledge of the past How to maintain knowledge of the past Kimble’s approaches: Kimble’s approaches: Type 1: just replace old data with new (lose historical data) Type 1: just replace old data with new (lose historical data) Type 2: for each changing attribute, create a current value field and several old-valued fields (multivalued) Type 2: for each changing attribute, create a current value field and several old-valued fields (multivalued) Type 3: create a new dimension table row each time the dimension object changes, with all dimension characteristics at the time of change. Most common approach Type 3: create a new dimension table row each time the dimension object changes, with all dimension characteristics at the time of change. Most common approach 21

22 Chapter 11 22 (new) Figure 9-18 Example of Type 2 SCD Customer dimension table The dimension table contains several records for the same customer. The specific customer record to use depends on the key and the date of the fact, which should be between start and end dates of the SCD customer record.

23 Chapter 11 23 (new) Figure 9-19 Dimension segmentation For rapidly changing attributes (hot attributes), Type 2 SCD approach creates too many rows and too much redundant data. Use segmentation instead.

24 Chapter 11 10 Essential Rules for Dimensional Modeling Use atomic facts Use atomic facts Create single-process fact tables Create single-process fact tables Include a date dimension for each fact table Include a date dimension for each fact table Enforce consistent grain Enforce consistent grain Disallow null keys in fact tables Disallow null keys in fact tables Honor hierarchies Honor hierarchies Decode dimension tables Decode dimension tables Use surrogate keys Use surrogate keys Conform dimensions Conform dimensions Balance requirements with actual data Balance requirements with actual data 24

25 Chapter 11 Columnar databases Columnar databases for Big Data (huge volume, often unstructured) for Big Data (huge volume, often unstructured) Columnar databases optimize storage for summary data of few columns (different need than OLTP) Columnar databases optimize storage for summary data of few columns (different need than OLTP) Data compression Data compression NoSQL NoSQL “Not only SQL” “Not only SQL” Deals with unstructured data Deals with unstructured data Hadoop HBase, Cassandra, MongoDB Hadoop HBase, Cassandra, MongoDB 25 Other Data Warehouse Advances

26 Chapter 11 26 Online Analytical Processing (OLAP) Tools The use of a set of graphical tools that provides users with multidimensional views of their data and allows them to analyze the data using simple windowing techniques The use of a set of graphical tools that provides users with multidimensional views of their data and allows them to analyze the data using simple windowing techniques Relational OLAP (ROLAP) Relational OLAP (ROLAP) Traditional relational representation Traditional relational representation Multidimensional OLAP (MOLAP) Multidimensional OLAP (MOLAP) Cube structure Cube structure OLAP Operations OLAP Operations Cube slicing–come up with 2-D view of data Cube slicing–come up with 2-D view of data Drill-down–going from summary to more detailed views Drill-down–going from summary to more detailed views

27 Chapter 11 27 Figure 11-21 Slicing a data cube

28 Chapter 11 28 Figure 11-22 Example of drill-down Summary report Drill-down with color added Starting with summary data, users can obtain details for particular cells

29 Chapter 11 29 Data Mining and Visualization Knowledge discovery using a blend of statistical, AI, and computer graphics techniques Knowledge discovery using a blend of statistical, AI, and computer graphics techniques Goals: Goals: Explain observed events or conditions Explain observed events or conditions Confirm hypotheses Confirm hypotheses Explore data for new or unexpected relationships Explore data for new or unexpected relationships Techniques Techniques Statistical regression Statistical regression Decision tree Decision tree Clustering Clustering Association rule Association rule Sequence association Sequence association … and so on. … and so on. Data visualization–representing data in graphical/multimedia formats for analysis Data visualization–representing data in graphical/multimedia formats for analysis


Download ppt "2014 Fall 1 Chapter 11: Data Warehousing 楊立偉教授 台灣大學工管系 註 : 於 11 版為 Chapter 10."

Similar presentations


Ads by Google