Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Data Warehousing University of California, Berkeley School of Information Management and Systems SIMS 257: Database Management 10/31/2000 Database Management -- R. Larson Today • Data Warehousing 10/31/2000 Database Management -- R. Larson Review • WebDB • ORACLE SQL 10/31/2000 Database Management -- R. Larson Today • Introduction to Data Warehouses • Data Warehousing • (Based on lecture notes from Joachim Hammer of University of Florida and Joe Hellerstein and Mike Stonebraker of UCB) 10/31/2000 Database Management -- R. Larson Overview • Data Warehouses and Merging Information Resources • What is a Data Warehouse? • History of Data Warehousing • Types of Data and Their Uses • Data Warehouse Architectures • Data Warehousing Problems and Issues 10/31/2000 Database Management -- R. Larson Problem: Heterogeneous Information Sources “Heterogeneities are everywhere” Personal Databases Scientific Databases Digital Libraries World Wide Web Different interfaces Different data representations Duplicate and inconsistent information 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Problem: Data Management in Large Enterprises • Vertical fragmentation of informational systems (vertical stove pipes) • Result of application (user)-driven development of operational systems Sales Planning Suppliers Num. Control Stock Mngmt Debt Mngmt Inventory ... ... ... Sales Administration 10/31/2000 Finance Manufacturing Database Management -- R. Larson ... Slide credit: J. Hammer Goal: Unified Access to Data Integration System World Wide Web Digital Libraries Scientific Databases Personal Databases • Collects and combines information • Provides integrated view, uniform user interface • Supports sharing 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer The Traditional Research Approach • Query-driven (lazy, on-demand) Clients Integration System Metadata ... Wrapper Source 10/31/2000 Wrapper Source Wrapper ... Database Management -- R. Larson Source Slide credit: J. Hammer Disadvantages of Query-Driven Approach • Delay in query processing – Slow or unavailable information sources – Complex filtering and integration • Inefficient and potentially expensive for frequent queries • Competes with local processing at sources • Hasn’t caught on in industry 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer The Warehousing Approach • Information integrated in advance • Stored in WH for direct querying and analysis Extractor/ Monitor Source 10/31/2000 Clients Data Warehouse Integration System Metadata ... Extractor/ Monitor Source Extractor/ Monitor ... Database Management -- R. Larson Source Slide credit: J. Hammer Advantages of Warehousing Approach • High query performance – But not necessarily most current information • Doesn’t interfere with local processing at sources – Complex queries at warehouse – OLTP at information sources • Information copied at warehouse – Can modify, annotate, summarize, restructure, etc. – Can store historical information – Security, no auditing • Has caught on in industry 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Not Either-Or Decision • Query-driven approach still better for – Rapidly changing information – Rapidly changing information sources – Truly vast amounts of data from large numbers of sources – Clients with unpredictable needs 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Data Warehouse Evolution Relational Databases 1960 1975 Company DWs 1980 PC’s and Spreadsheets 10/31/2000 End-user Interfaces 1985 1990 Data Replication Tools 1995 2000 Information“Middle Data Based Revolution Ages” Management 1st DW Article Database Management -- R. Larson DW Confs. TIME “Prehistoric Times” “Building the DW” Inmon (1992) Vendor DW Frameworks Slide credit: J. Hammer What is a Data Warehouse? “A Data Warehouse is a – subject-oriented, – integrated, – time-variant, – non-volatile collection of data used in support of management decision making processes.” -- Inmon & Hackathorn, 1994: viz. McFadden, Chap 14 10/31/2000 Database Management -- R. Larson DW Definition… • Subject-Oriented: – The data warehouse is organized around the key subjects (or high-level entities) of the enterprise. Major subjects include • • • • • 10/31/2000 Customers Patients Students Products Etc. Database Management -- R. Larson DW Definition… • Integrated – The data housed in the data warehouse are defined using consistent • • • • 10/31/2000 Naming conventions Formats Encoding Structures Related Characteristics Database Management -- R. Larson DW Definition… • Time-variant – The data in the warehouse contain a time dimension so that they may be used as a historical record of the business 10/31/2000 Database Management -- R. Larson DW Definition… • Non-volatile – Data in the data warehouse are loaded and refreshed from operational systems, but cannot be updated by end-users 10/31/2000 Database Management -- R. Larson What is a Data Warehouse? A Practitioners Viewpoint “A data warehouse is simply a single, complete, and consistent store of data obtained from a variety of sources and made available to end users in a way they can understand and use it in a business context.” -- Barry Devlin, IBM Consultant 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer A Data Warehouse is... • Stored collection of diverse data – A solution to data integration problem – Single repository of information • Subject-oriented – Organized by subject, not by application – Used for analysis, data mining, etc. • Optimized differently from transactionoriented db • User interface aimed at executive decision makers and analysts 10/31/2000 Database Management -- R. Larson … Cont’d • Large volume of data (Gb, Tb) • Non-volatile – Historical – Time attributes are important • Updates infrequent • May be append-only • Examples – All transactions ever at WalMart – Complete client histories at insurance firm – Stockbroker financial information and portfolios 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Warehouse is a Specialized DB Standard DB • • • • • • • Warehouse Mostly updates Many small transactions Mb - Gb of data Current snapshot Index/hash on p.k. Raw data Thousands of users (e.g., clerical users) 10/31/2000 • • • • • • • Mostly reads Queries are long and complex Gb - Tb of data History Lots of scans Summarized, reconciled data Hundreds of users (e.g., decision-makers, analysts) Database Management -- R. Larson Slide credit: J. Hammer Summary Business Information Guide Data Warehouse Catalog Business Information Interface Data Warehouse Data Warehouse Population Enterprise Modeling 10/31/2000 Operational Systems Database Management -- R. Larson Slide credit: J. Hammer Warehousing and Industry • Warehousing is big business – $2 billion in 1995 – $3.5 billion in early 1997 – Predicted: $8 billion in 1998 [Metagroup] • WalMart has largest warehouse – 900-CPU, 2,700 disk, 23 TB Teradata system – ~7TB in warehouse – 40-50GB per day 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Types of Data • Business Data - represents meaning – Real-time data (ultimate source of all business data) – Reconciled data – Derived data • Metadata - describes meaning – Build-time metadata – Control metadata – Usage metadata • Data as a product* - intrinsic meaning – Produced and stored for its own intrinsic value – e.g., the contents of a text-book 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Data Warehousing Architecture 10/31/2000 Database Management -- R. Larson “Ingest” Clients Data Warehouse Integration System Metadata ... Extractor/ Monitor Source/ File 10/31/2000 Extractor/ Monitor Source / DB Extractor/ Monitor ... Database Management -- R. Larson Source / External Data Warehouse Architectures: Conceptual View Operational systems • Single-layer – Every data element is stored once only – Virtual warehouse • Two-layer – Real-time + derived data – Most commonly used approach in industry today Informational systems “Real-time data” Operational systems Informational systems Derived Data Real-time data 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Three-layer Architecture: Conceptual View • Transformation of real-time data to derived data really requires two steps Operational systems Informational systems Derived Data Reconciled Data View level “Particular informational needs” Physical Implementation of the Data Warehouse Real-time data 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Issues in Data Warehousing • Warehouse Design • Extraction – Wrappers, monitors (change detectors) • Integration – Cleansing & merging • Warehousing specification & Maintenance • Optimizations • Miscellaneous (e.g., evolution) 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Data Warehousing: Two Distinct Issues (1) How to get information into warehouse “Data warehousing” (2) What to do with data once it’s in warehouse “Warehouse DBMS” • Both rich research areas • Industry has focused on (2) 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Data Extraction • Source types – Relational, flat file, WWW, etc. • How to get data out? – – – – 10/31/2000 Replication tool Dump file Create report ODBC or third-party “wrappers” Database Management -- R. Larson Slide credit: J. Hammer Wrapper Converts data and queries from one data model to another Data Model A Queries Data Data Model B Extends query capabilities for sources with limited capabilities Queries 10/31/2000 Wrapper Database Management -- R. Larson Source Slide credit: J. Hammer Wrapper Generation • Solution 1: Hard code for each source • Solution 2: Automatic wrapper generation Wrapper 10/31/2000 Wrapper Generator Definition Database Management -- R. Larson Slide credit: J. Hammer Data Transformations • Convert data to uniform format – Byte ordering, string termination – Internal layout • Remove, add & reorder attributes – Add key – Add data to get history • Sort tuples 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Monitors • Goal: Detect changes of interest and propagate to integrator • How? – – – – – 10/31/2000 Triggers Replication server Log sniffer Compare query results Compare snapshots/dumps Database Management -- R. Larson Slide credit: J. Hammer Data Integration • Receive data (changes) from multiple wrappers/monitors and integrate into warehouse • Rule-based • Actions – – – – – – Resolve inconsistencies Eliminate duplicates Integrate into warehouse (may not be empty) Summarize data Fetch more data from sources (wh updates) etc. 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Data Cleansing • Find (& remove) duplicate tuples – e.g., Jane Doe vs. Jane Q. Doe • Detect inconsistent, wrong data – Attribute values that don’t match • Patch missing, unreadable data • Notify sources of errors found 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Warehouse Maintenance • Warehouse data materialized view – Initial loading – View maintenance • View maintenance 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Differs from Conventional View Maintenance... • Warehouses may be highly aggregated and summarized • Warehouse views may be over history of base data • Process large batch updates • Schema may evolve 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Differs from Conventional View Maintenance... • Base data doesn’t participate in view maintenance – – – – 10/31/2000 Simply reports changes Loosely coupled Absence of locking, global transactions May not be queriable Database Management -- R. Larson Slide credit: J. Hammer Warehouse Maintenance Anomalies • Materialized view maintenance in loosely coupled, non-transactional environment • Simple example Data Warehouse Sold (item,clerk,age) Sold = Sale Emp Integrator Sales Sale(item,clerk) 10/31/2000 Comp. Emp(clerk,age) Database Management -- R. Larson Slide credit: J. Hammer Warehouse Maintenance Anomalies Data Warehouse Sold (item,clerk,age) Integrator Sales Sale(item,clerk) Comp. Emp(clerk,age) 1. Insert into Emp(Mary,25), notify integrator 2. Insert into Sale (Computer,Mary), notify integrator 3. (1) integrator adds Sale (Mary,25) 4. (2) integrator adds (Computer,Mary) Emp 5. View incorrect (duplicate tuple) 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Maintenance Anomaly - Solutions • Incremental update algorithms (ECA, Strobe, etc.) • Research issues: Self-maintainable views – What views are self-maintainable – Store auxiliary views so original + auxiliary views are self-maintainable 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Self-Maintainability: Examples Sold(item,clerk,age) = Sale(item,clerk) Emp(clerk,age) • Inserts into Emp If Emp.clerk is key and Sale.clerk is foreign key (with ref. int.) then no effect • Inserts into Sale Maintain auxiliary view: Emp-clerk,age(Sold) • Deletes from Emp Delete from Sold based on clerk 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Self-Maintainability: Examples • Deletes from Sale Delete from Sold based on {item,clerk} Unless age at time of sale is relevant • Auxiliary views for self-maintainability – Must themselves be self-maintainable – One solution: all source data – But want minimal set 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Partial Self-Maintainability • Avoid (but don’t prohibit) going to sources Sold=Sale(item,clerk) Emp(clerk,age) • Inserts into Sale – Check if clerk already in Sold, go to source if not – Or replicate all clerks over age 30 – Or ... 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer View Definitions Warehouse Specification (ideally) Warehouse Configuration Module Integration rules Warehouse Change Detection Requirements Integrator Extractor/ Monitor Extractor/ Monitor Metadata Extractor/ Monitor ... 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Optimization • Update filtering at extractor – Similar to irrelevant updates in constraint and view maintenance • Multiple view maintenance – If warehouse contains several views – Exploit shared sub-views 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer Additional Research Issues • • • • Historical views of non-historical data Expiring outdated information Crash recovery Addition and removal of information sources – Schema evolution 10/31/2000 Database Management -- R. Larson Slide credit: J. Hammer More Information on DW Agosta, Lou, The Essential Guide to Data Warehousing. Prentise Hall PTR, 1999. Devlin, Barry, Data Warehouse, from Architecture to Implementation. Addison-Wesley, 1997. Inmon, W.H., Building the Data Warehouse. John Wiley, 1992. Widom, J., “Research Problems in Data Warehousing.” Proc. of the 4th Intl. CIKM Conf., 1995. Chaudhuri, S., Dayal, U., “An Overview of Data Warehousing and OLAP Technology.” ACM SIGMOD Record, March 1997. 10/31/2000 Database Management -- R. Larson