Full text
T BII D C Requirement-driven Design and Optimization of Data-Intensive Flows Ph.D. Dissertation Petar Jovanovic Dissertation submitted July, 2016 A thesis submitted to Universitat Politecnica de Catalunya, BarcelonaTech (UPC) and the Faculty of Engineering at Universite Libre De Bruxelles (ULB), in partial fulllment of the requirements within the scope of the IT4BI-DC programme for the joint Ph.D. degree in computer science. The thesis is not submitted to any other organization at the same time.
To my family Mojoj porodici
Thesis submitted: July, 2016 UPC Main Ph.D. Supervisors: Prof. Alberto Abello Prof. Oscar Romero Universitat Politecnica de Catalunya, BarcelonaTech, Barcelona, Spain ULB Ph.D. Supervisor: Prof. Toon Calders Universite Libre de Bruxelles, Brussels, Belgium PhD Series: Barcelona School of Informatics, Universitat Politecnica de Catalunya, BarcelonaTech © Copyright by Petar Jovanovic. Author has obtained the right to include the published and accepted articles in the thesis, with a condition that they are cited, DOI pointers and/or copyright/credits are placed prominently in the references. Printed in Spain, 2016
Curriculum Vitae Petar Jovanovic Petar Jovanovic graduated with honors from high-school gymnasium Milos Savkovic, in 2006, with specialization in math and natural sciences, in his hometown of Aran d elovac (Serbia). In August 2010, he graduated Software Engineering, at the School of Electrical Engineering, University of Belgrade. In October 2010, he continued his education at the Barcelona School of Informatics (FIB), Universitat Politecnica de Catalunya (UPC), and graduated Master in Computing, with specialization in Information Systems, in July 2011. In October 2011, he decided to pursue his PhD studies under the supervision of professors Alberto Abello and Oscar Romero inside the Group of Information Modelling and Processing (MPI), at the department of Service and Information System Engineering (ESSI), at Universitat Politecnica de Catalunya. In 2013, he has been awarded a four year PhD grant by the Spanish Ministry of Education, Culture, and Sport, under the FPU grant program. During his master and PhD program, he has been working on the problems of requirement-driven design and optimization of data-intensive ows in Business Intelligence systems. His research interests mainly fall into the business intelligence eld, namely: Big Data management, Management and optimization of data-intensive ows, Data warehousing, ETL, Distributed data processing, MapReduce, Hadoop ecosystem. During his PhD studies, with MPI research group he has been part of the research project funded by the Spanish Ministry of Science and Inovation (TIN2011-24747), working on the development of new techniques for information integration (2012-2014). Additionally, with his supervisors Alberto Abello and Oscar Romero, he has participated in the collaborative research project between Universitat Politecnica de Catalunya and HP Labs, Palo Alto, Califorvii
Curriculum Vitae nia (USA). From the HP Labs' side, the project was led and supervised by the HP Labs' senior researcher Alkis Simitsis. This project focused on automating the logical design and optimization of hybrid data ows, enabling engine independent design and composition of data ows spanning dierent execution and storage engines, hence enabling inter-engine management and optimization of hybrid data ows. The project also included two research stays (July - September 2012, and March - July 2013) at the HP Labs facilities in Palo Alto, California, where Petar was also working on the development of HP Labs' proprietary Hybrid Flow Management System (HFMS). In 2014, Petar joined the Erasmus Mundus Joint Doctorate program of Information Technologies for Business Intelligence, Doctoral College (IT4BI-DC), and continued his PhD studies in cohort with Universite Libre de Bruxelles (ULB). Professor Toon Calders from ULB has joined the supervision of his PhD thesis as a host co-advisor. As part of his joint PhD studies, Petar performed two research stays at Universite Libre de Bruxelles, his host university, working with professor Toon Calders (September - December 2014, and August - November 2015). For both of these research stays, he was awarded with competitive research stay grants by the Spanish Ministry of Education, Culture, and Sport, under the FPU Estancias Breves grant program. He has published 13 peer-reviewed publications, including 3 JCR indexed journal articles, 1 Springer LNCS journal article, 2 research track, full conference papers, 3 full workshop papers, and 4 tool demonstrations. During the collaborative research project with HP Labs, he also co-authored 2 patent applications with the researchers from HP Labs (Alkis Simitsis and Kevin Wilkinson). He has been one of the initiators and developer inside the Quarry project at Universitat Politecnica de Catalunya, which aims to automate the complex and time-consuming task of the incremental data warehouse (DW) design from high-level information requirements. This project is one of the main contributions of his PhD work, and during the years, the project has gathered several researchers, PhD, master, and bachelor students. Petar has also participated in teaching and advisory work at Universitat Politecnica de Catalunya. During spring semesters of 2013/2014, 2014/2015, and 2015/2016, he has taught lab sessions of the Data Warehousing course, in the Master in Innovation and Research in Informatics (MIRI), at Barcelona School of Informatics. In addition, in 2016, he has also taught lab sessions of the Big Data Management and Analytics (BDMA) postgraduate program, at UPC School of Professional and Executive Development. Besides that, he has also co-advised 7 master thesis and 1 nal (bachelor) degree project. viii
Contents 5 Evaluation .............................. 83 5.1 Prototype .......................... 83 5.2 Experimental setup ..................... 83 5.3 Scrutinizing CoAl ..................... 84 6 Related Work ............................ 87 7 Conclusions and Future Work ................... 89 8 Acknowledgments .......................... 89 4 A Requirement-Driven Approach to the Design and Evolution of Data Warehouses 91 1 Introduction ............................. 92 2 Overview of our Approach ..................... 95 2.1 Running example ...................... 95 2.2 Formalizing Information Requirements .......... 96 2.3 Formalizing the Problem .................. 100 2.4 ORE in a Nutshell ..................... 102 3 Traceability Metadata ....................... 106 4 The ORE Approach ........................ 109 4.1 Matching facts ....................... 111 4.2 Matching dimensions .................... 113 4.3 Complementing the MD design .............. 115 4.4 Integration ......................... 116 5 Theoretical Validation ....................... 118 5.1 Soundness and Completeness ............... 118 5.2 Commutativity and Associativity ............. 122 5.3 Computational complexity ................. 122 6 Evaluation .............................. 124 6.1 Prototype .......................... 125 6.2 Output validation ..................... 126 6.3 Experimental setup ..................... 127 6.4 Scrutinizing ORE ..................... 128 6.5 The LEARN-SQL Case Study ............... 133 7 Related Work ............................ 140 8 Conclusions and Future Work ................... 142 9 Acknowledgements ......................... 143 5 Engine Independence for Logical Analytic Flows 145 1 Introduction ............................. 146 2 Problem Formalization ....................... 147 2.1 Preliminaries ........................ 147 2.2 Logical and physical ows ................. 148 2.3 Normalized ow ...................... 148 2.4 Dictionary .......................... 149 xv
Contents 2.5 Conversion process ..................... 149 2.6 Problem statements .................... 150 3 Architecture ............................. 151 3.1 System overview ...................... 151 3.2 Example ........................... 152 3.3 Flow encoding ....................... 152 3.4 Dictionary .......................... 154 3.5 Error handling ....................... 155 4 Physical to Logical ......................... 156 4.1 Single ow ......................... 156 4.2 Multi-ow import ..................... 158 5 Flow Processor ........................... 161 6 Logical to Physical ......................... 162 6.1 Creating an engine specic ow .............. 162 6.2 Code generation ...................... 164 7 Evaluation .............................. 167 7.1 Preliminaries ........................ 167 7.2 Experiments ........................ 168 8 Related Work ............................ 172 9 Conclusions ............................. 173 6 H-WorD: Supporting Job Scheduling in Hadoop with Workload-driven Data Redistribution 175 1 Introduction ............................. 176 2 Running Example ......................... 178 3 The Problem of Skewed Data Distribution ............ 179 4 Workload-driven Redistribution of Data ............. 181 4.1 Resource requirement framework ............. 181 4.2 Execution modes of map tasks .............. 182 4.3 Workload estimation .................... 184 4.4 The H-WorD algorithm .................. 185 5 Evaluation .............................. 186 6 Related Work ............................ 189 7 Conclusions and Future Work ................... 190 8 Acknowledgements ......................... 191 7 Conclusions and Future Directions 193 1 Conclusions ............................. 193 2 Future Directions .......................... 197 Bibliography 199 References ................................. 199 xvi
Contents Appendices 215 A Quarry: Digging Up the Gems of Your Data Treasury 217 1 Introduction ............................. 218 2 Demonstrable Features ....................... 219 2.1 Requirements Elicitor ................... 221 2.2 Requirements Interpreter ................. 221 2.3 Design Integrator ...................... 221 2.4 Design Deployer ...................... 223 2.5 Communication & Metadata Layer ............ 223 2.6 Implementation details ................... 224 3 Demonstration ........................... 224 4 Acknowledgements ......................... 225 xvii
Contents xviii
Thesis Details Thesis Title: Requirement-driven Design and Optimization of Data- Intensive Flows Ph.D. Student: Petar Jovanovic Supervisors: Prof. Alberto Abello, Universitat Politecnica de Catalunya, BarcelonaTech, Barcelona, Spain (UPC Main Supervisor) Prof. Oscar Romero, Universitat Politecnica de Catalunya, BarcelonaTech, Barcelona, Spain (UPC Co-Supervisor) Prof. Toon Calders, Universite Libre de Bruxelles, Brussels, Belgium (ULB Supervisor) The main body of this thesis consist of the following papers. [1] Petar Jovanovic, Oscar Romero, Alberto Abello. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey. Trans. Large-Scale Data- and Knowledge-Centered Systems, InPress (2016) [2] Petar Jovanovic, Oscar Romero, Alkis Simitsis, Alberto Abello. Incremental Consolidation of Data-Intensive Multi-Flows. IEEE Trans. Knowl. Data Eng. 28(5): 1203-1216 (2016) [3] Petar Jovanovic, Oscar Romero, Alkis Simitsis, Alberto Abello, Daria Mayorova. A requirement-driven approach to the design and evolution of data warehouses. Inf. Syst. 44: 94-119 (2014) [4] Petar Jovanovic, Alkis Simitsis, Kevin Wilkinson. Engine independence for logical analytic ows. ICDE 2014: 1060-1071 [5] Petar Jovanovic, Oscar Romero, Toon Calders, Alberto Abello. H-WorD: Supporting Job Scheduling in Hadoop with Workload-driven Data Redistribution, accepted for publication at 20th East-European Conference on Advances in Databases and Information Systems, August 2016. In addition to the main papers, the following peer-reviewed publications have also been made. xix
Thesis Details • Journal articles: [1] Vasileios Theodorou, Petar Jovanovic, Alberto Abello, Emona Nak- uci. Data generator for evaluating ETL process quality. Inf. Syst. InPress (2016) • Conference and workshop full papers: [2] Petar Jovanovic, Oscar Romero, Alkis Simitsis, Alberto Abello. Integrating ETL Processes from Information Requirements. DaWaK 2012: 65-80 [3] Petar Jovanovic, Oscar Romero, Alkis Simitsis, Alberto Abello. ORE: an iterative approach to the design and evolution of multi-dimensional schemas. DOLAP 2012: 1-8 [4] Emona Nakuci, Vasileios Theodorou, Petar Jovanovic, Alberto Abello. Bijoux: Data Generator for Evaluating ETL Process Quality. DOLAP 2014: 23-32 [5] Rizkallah Touma, Oscar Romero, Petar Jovanovic: Supporting Data Integration Tasks with Semi-Automatic Ontology Construction. DOLAP 2015: 89-98 • Tool demonstrations: [6] Petar Jovanovic, Oscar Romero, Alkis Simitsis, Alberto Abello. Requirement-Driven Creation and Deployment of Multidimensional and ETL Designs. ER Workshops 2012: 391-395 [7] Alkis Simitsis, Kevin Wilkinson, Petar Jovanovic. xPAD: a platform for analytic data ows. SIGMOD Conference 2013: 1109-1112 [8] Petar Jovanovic, Alkis Simitsis, Kevin Wilkinson. BabbleFlow: a translator for analytic data ow programs. SIGMOD Conference 2014: 713-716 [9] Petar Jovanovic, Oscar Romero, Alkis Simitsis, Alberto Abello, Hector Candon, Sergi Nadal. Quarry: Digging Up the Gems of Your Data Treasury. EDBT 2015: 549-552 This thesis has been submitted for assessment in partial fulllment of the PhD degree. The thesis is based on the submitted or published scientic papers which are listed above. Parts of the papers are used directly or indirectly in the extended summary of the thesis. xx
Chapter 1 Introduction 1 Background and Motivation We have certainly entered the era in which data volumes are uncontrollably generated with immense speeds, by humans, as well as by machines. To make the situation clearer, until 2014 we had that the amount of data collected in the last two years is higher than the amount of data collected since the dawn of time [11]. At the same time, data and even more the knowledge extracted from them, have become number one assets in businesses world-wide, namely the gems of the enterprise [146] The companies thus strive to obtain information from these data, and acquire useful knowledge for making their business and strategic decisions. Traditional business intelligence (BI) systems were introduced to support such strategic needs of business users [119]. Intuitively, a BI system typically refers to a set of tools and techniques that enable a company to transform its business data into timely and accurate information for the decisional process, to be made available to the right persons in the most suitable form [139]. For enabling smoother data analysis, a variety of data transformations need to be applied over raw data. Besides well-studied relational algebra operations (e.g., selection, join, Cartesian product) [171], other, more complex, and typically ad hoc built operations are additionally required to conform the raw data to the formats suitable to end users' analytical needs (e.g., data cleaning, pivot, data mappers, or in general operators with black-box semantics [186]). As pointed out in [186], the situation becomes more challenging, as these data transformations typically need to be combined in a workow. A prominent solution studied in the past twenty years for enabling data analysis over historical data is data warehousing (DW). The rst and the most complete denition of a DW is given by Bill Inmon in 1992 [82]: A data warehouse is a subject-oriented, integrated, time-variant and non-volatile collection 1
Chapter 1. Introduction of data in support of management's decision making process. Intuitively, a DW system assumes a unied data storage, typically modeled following the multidimensional (MD) paradigm [140], to support analytical needs of business users. In the back stage, a DW system includes a batched data workow known as extract-transform-load (ETL) process, responsible for orchestrating the ow of data from relevant data sources towards a data warehouse. The complexity and high costs of building an ETL process have been largely discussed both by practitioners and researchers in the peak years of data warehousing [169,185], reporting that the correct ETL process implementation can take up to 80% of the entire DW project [170]. The situation, however, has become unbearable for traditionally built BI systems [119], given the inherent complexity that the new data characteristics (a.k.a., BigData) brought into picture. As initially dened [81], the three main challenges, also known as the 3 V's of BigData are: large volumes of data being collected (i.e., volume), growing speed in which data are arriving into systems (i.e., velocity), and plethora of dierent formats in which these data are supplied (i.e., variety). At the same time, the high dynamics of global markets demand moving from typical long-term and strategic only, towards medium and short term (i.e., tactical and operational) decision making, such that it provides the right information to the right people at the right time so they can make a positive impact on business outcomes [50]. In addition, businesses have become more situation-dependent, thus combining in-house data with external data sources (e.g., govermental data, social networks, open data initiatives) has become essential for providing useful, context-aware knowledge to decision makers [110]. Lastly, there is also a demand for more agility in the BI systems development in order to more easily accommodate new, unanticipated, or changed needs of a broader set of business users [34,79]. These challenges inevitably required changes in the roadmap for previously long-lasting, BI and DW projects [119], which typically, as other software projects, required long requirement elicitation cycles, followed by several, mostly manual rounds of reconciliation and redesigning, before all the business needs were met [146]. Being the most complex part of BI projects, but at the same time the most critical processes in today's BI applications, problems related to data workows, like ETL processes, still occupy the attention of both researchers and practitioners. For meeting complex requirements of next generation BI systems [87], we often need an eective combination of the traditionally batched ETL processes that populate a DW from integrated data sources, and more real-time and operational data ows that integrate source data and provide results to users at runtime. Thus, throughout this document, we use the term data-intensive ow (DIF), or simply, data ow, for capturing in a more general manner the variety of data workows in the next generation BI systems. 2
2. The Lifecycle of Data-intensive Flows 2 The Lifecycle of Data-intensive Flows Data-intensive ows are critical processes in BI applications with the common goal of delivering the data in user-preferred and analysis-ready formats, from a multitude of data sources. In general, a DIF starts by extracting data from individual data sources, cleans and conforms extracted data to satisfy certain quality standards and business requirements, and nally brings the data to end users. Similar to other software products, the lifecycle of a DIF in BI applications typically consists of several phases. We further dene the lifecycle of DIFs (see Figure 1.1), and give an overview of its phases, along with example approaches that either fully or partially facilitate them. Fig. 1.1: The lifecycle of DIFs in BI applications • Requirements analysis. The lifecycle of DIFs starts by eliciting and analyzing user requirements. In the context of data-centric (analytical) applications, user requirements are typically related to the analytical needs of end users, hence they express the information or knowledge a user wants to acquire from input data. We further refer to them as information requirements. 3
Chapter 1. Introduction • Design. The next phase is dedicated to the conceptual and logical design of DIFs that will answer the information requirements of end users. Having a plethora of dierent commercial and open-source design tools in the market, the research has been rather focused on providing a unied way for the conceptual or logical design of data ows. • Optimization. Being time-critical processes in BI application, a special attention is dedicated to the optimization of DIFs. Thus, once a DIF is designed to answer user information requirements, the following phase deals with optimizing the data ow considering other, non-functional, requirements, e.g., performance, reliability, fault-tolerance, to mention a few [176]. Consequently, a considerable amount of research has been dedicated to the problems of non-functional requirements of DIFs, especially to the problems of optimizing their performance. • Implementation. Furthermore, once a DIF is designed to satisfy both information and non-functional requirements, in the following phase a designer needs to select the execution engine(s) for executing DIFs. Consequently, conceptual or logical DIFs need to be translated to the format of the engine of choice (e.g., SQL, PIG scripts, Java/Scala/Python code). • Testing. Given the inherent complexity of DIFs in BI applications, verifying and testing DIFs for satisfying both information and non-functional requirements represents an important part of the DIF lifecycle. Testbed platforms with banchmarking and syntactic data generation functionalities are needed to support the DIF evaluation tasks. • Execution. Once ready, the execution of DIFs needs to be properly scheduled and monitored at the selected execution engine(s). Today, execution environments are typically distributed (e.g., organized in a form of a computing cluster), and shared among various applications coming from one or many users. Thus, proper scheduling and runtime optimization are essential for achieving better performance of DIFs and better resource utilization of a computing cluster. • Maintenance. Lastly, once in place, DIFs are subject to changes, either due to the changed end users' information requirements, or to changes of the considered data sources. Thus, maintenance techniques, capable of eciently accommodating such changes to the existing DIFs are needed. 2.1 Research Problems and Challenges The businesses today are undoubtedly in a need for the means to support and automate the complex DIF lifecycle. To this end, this PhD thesis focuses 4
4. Thesis Overview lenges of data-intensive ows in the next generation BI setting. On the one hand, the results of this survey provide us with a clear understanding of the foundations of DIFs, while on the other hand, identied characteristics help us dene the main remaining challenges in the eld of DIFs. Finally, as the main outcome of this survey, we outlined the envisioned architecture of next generation BI systems, focusing on managing the lifecycle of data-intensive ows, which represents the framework of this PhD thesis study. 4.2 Chapter 3: Incremental Consolidation of Data-Intensive Multi- ows (Data Flow Integrator) A data integration process combines data residing in various data sources and provides a unied view of this data to a user [106]. For instance, in a data warehousing (DW) context, data integration is implemented through backend, batched ETL processes. Generally, data integration processes are typically represented in a form of a DIF that extracts, cleans, and transforms data from multiple, often heterogeneous data sources, and nally delivers data to users for further analysis or visualization. As we discuss in Chapter 2, there are various remaining challenges related to the design and optimization of DIFs. In Chapter 3, we focus on the challenges of incremental design and maintenance of DIFs. A major problem that BI decision-makers face relates to the evolution of business requirements. These changes are more frequent at the early stages of a BI project [34] and in part, this is due to a growing use of agile methodologies in data ow design and BI systems in general [79]. But changes may happen during the entire BI lifecycle. Having an up-and-running DW system satisfying an initial set of requirements is still subject to various changes as the business evolves. The DIFs, as other software artifacts, do not lend themselves nicely to evolution events and in general, due to their complexity, maintaining them manually is hard. The situation is even more critical in today's BI settings, where on-the-y decision making requires faster and more ecient adaptation to changes. Changes in business needs may result in new, changed, or removed information requirements. Thus having an incremental and agile solution that can automatically absorb occurred changes and produce a ow satisfying the complete set of requirements would largely facilitate the design and maintenance of DIFs. At the same time, in an enterprise environment, data is usually shared among users with varying technical skills and needs, involved in dierent parts of a business process. Typical real-world data-intensive workloads have high temporal locality, having 80% of data reused in a range from minutes to hours [36]. However, the cost of accessing these data, especially in distributed scenarios, is often high [24], while intertwined business processes often imply overlapping of data processing. For instance, a sales department may analyze the 11
Chapter 1. Introduction revenue of the sales for the past year, while nance may be interested in the overall net prot. Computing the net prot can largely benet from the total revenue already computed for the sales department and thus, it could benet from the sales data ow too. Such data ow reuse could result in a signicant reduction in design complexity, but also in intermediate ow executions and thus, in total execution time too [24]. In Chapter 3, we present Consolidation Algorithm (CoAl), our approach to ecient, incremental consolidation of DIFs. CoAl deals with design evolution by providing designers with an agile solution for the design of DIFs. CoAl can assist the early stages of the design process when for only a few requirements we need to build a running data ow from scratch. But, it also helps during the entire lifecycle of a DIF, when the existing data ow must be eciently accommodated to satisfy new, changed, or removed information requirements. CoAl reduces design complexity with aggressive information and software reuse. Per requirement, it searches for the largest data and operation overlap in the existing data ow design. To boost the reuse of existing design elements when trying to satisfy a new information requirement (i.e., when integrating a new data ow), CoAl aligns the order of data ow operations by applying generic equivalence rules. Note that in the context of data integration, the reuse of both data and code besides reducing ow complexity, might also lead to faster execution, better resource usage, and higher data quality and consistency [24, 94,148]. CoAl also accounts for the cost of produced data ows when searching for opportunities to integrate new data ows. CoAl uses a tunable cost model to perform multi-ow, logical optimization, while creating a unied ow design that satises all information requirements. Here, we focus on maximizing the reuse of data and operations, but the algorithm can be congured to work with dierent cost models, taking into account dierent quality factors of data ows (e.g., [161]). 4.3 Chapter 4: A Requirement-Driven Approach to the Design and Evolution of Data Warehouses (Target Schema Integrator) As mentioned earlier, DW systems have been widely recognized to successfully support strategic decision making. The most common design approach suggests building a centralized decision support repository (like a DW) that gathers the organization's data and which, to better support its analytical tasks, follows a multidimensional (MD) design [140]. The MD design is distinguished by the fact/dimension dichotomy, where facts represent the subjects of analysis and dimensions show dierent perspectives from which the subjects can be analyzed. In the context of DW systems, the batched, periodically executed DIFs (i.e., ETL processes) typically populate a unied DW storage. Thus, 12
4. Thesis Overview the design and evolution of the target schema represents an additional design challenge, having that a design of DIFs is largely dependent on the constraints implied by the target DW schema (see Chapter 2). While the design of DW systems has been typically considered as static, the dynamic nature of the businesses today requires a more agile approach for building the components of a DW system. Typically, assuming that all information and business requirements are available from the beginning and remain intact is not realistic. Indeed, the complexity of the monolithic approach for building a DW satisfying all information requirements, has also been largely characterized in the literature as a stumbling stone in DW projects, and dierent techniques, like the Data Warehouse Bus Architecture [97], were proposed as a step-by-step approach for building a DW. However, such design guidelines still assume a tremendous manual eort from a DW architect and hence, DW experts still encounter the burdensome and time-lasting problem of translating end user's information requirements into an appropriate DW design. Therefore, automating the design process would largely support DW designers during the complex and time-lasting DW projects. Moreover, automation is also recognized as a way to assure the inherent contraints of a DW design (i.e., MD integrity constraints of target schemas [114]). Various approaches thus recognized the need for automation, and proposed the solution for generating the MD schema design either from data source (i.e., supply-driven; [168,131,142]), or from information requirements (i.e., demand-driven; [69,115,146]). Other approaches have also proposed hybrid solutions, combining both information about data sources and information requirements (e.g., [113]). However, the evolution of the design and integration of new information requirements is mostly overlooked, or at best left to be done manually, following the proposed guidelines (e.g., [69,115]). To cope with such complexity (both at the beginning of the design process and when potential evolution events occur), in Chapter 4, we present a semi-automatic method called ORE, for creating DW designs in an iterative fashion based on a given set of information requirements. We start from MD interpretations of individual requirements and present an iterative method that consolidates them into a single, unied MD schema design satisfying the entire set of information requirements. ORE is useful for the early stages of a DW project, when we need to create an MD schema design from scratch, but it can also serve during the entire DW lifecycle to accommodate potential evolution events. The correctness of the proposed MD schemata is guaranteed according to the MD integrity constraints [114]. While incrementally building a MD schema design of a DW, ORE systematically traces the metadata about the required schema transformation actions in the case of evolution changes. On the one side, such metadata is used for enabling designers to reconsider some of the previous design choices, while on the other side, it also provides a valuable information for adapting back-end ETL processes to the evolution 13
Chapter 1. Introduction changes. Moreover, being highly correlated artifacts in a DW system, having semi-automatic methods for incremental design of MD schema and ETL processes (i.e., ORE and CoAl), both methods can benet from the information inferred by one another. For instance, the aggregation and normalization levels of the produced MD schema could be considered, since this would aect the way the appropriate ETL process is tailored (i.e., trade-os between materialized views and OLAP querying). Similarly, checkpointing or bottlenecks detected at the ETL level may cause some changes at the MD schema for the sake of performance. 4.4 Chapter 5: Engine Independence for Logical Analytic Flows (Data Flow Deployer) As we previously discussed, the design of DIFs may be done either from high level information requirements, in which case the design is rst typically done at the conceptual or logical (engine independent) level, or in the case of smaller, ad-hoc projects, the design is typically done directly at the physical (engine specic) level. In both cases, given modern enterprise environments, answering business needs in the most ecient manner, may require complex DIFs that integrate data sources from diverse sets of storage repositories, as well as computing from dierent execution engines, typically deployed by today's enterprises, such as Map-Reduce systems, stream processing systems, statistical analysis engines. On the one side, creating and deploying such complex DIFs for dierent execution engines is labor-intensive, time-consuming, and error prone. On the other side, having a DIF spanning dierent execution engines often conceals possibilities for more extensive optimization actions, as engines typically consider parts of these ows in isolation, hence the holistic picture of such (hybrid [163]) data ows is not available. Thus, data ow designers are in a need for a notion of engine independence for logical analytic ows. Just as logical data independence insulates a data modeler from physical details of the relational database, there are benets in designing ows at a logical level and using automation to implement the ows. In Chapter 5, we present a system (called BabbleFlow) that provides engine independence for DIFs. We rst describe a language for encoding ows at a logical level, namely xLM. Furthermore, we study how a previously designed logical ow (e.g., by means of our CoAl approach), can be automatically translated to a physical ow (and executable code) for a targeted processing engine(s). Lastly, we also show how existing, physical ows, written for specic processing engines, can be imported, composed in a single (hybrid) ow, and converted to a logical ow that is engine independent. Other tools, like ETL design GUIs, oer to some extent separation between logical design and implementation, but the design is still tool-specic. Our 14
4. Thesis Overview work here goes beyond that. We envision hybrid data ow processors, like Hybrid Flow Management System (HFMS) proposed in [164], where logical ows may span multiple engines, which can be seen as peers enabling data and function shipping between all. Such functionalities largely support inter-engine optimization of these hybrid ows. Besides optimization, one might decompose a single, large, complex DIF into smaller subows to reduce contention in a workload or to improve maintainability of the ow. Another, not unusual scenario for hybrid data-intensive ecosystems is to have an algorithm encoded for one engine (e.g., written in Map-Reduce) that one wishes to apply to data in a dierent engine (e.g., database). So, rather than shipping the data to the algorithm, our data ow translation techniques enable shipping the algorithm to the data. In Chapter 5, our focus is not on specic ow processors or use cases. Rather, our goal is to support, on the one side, creating complex (hybrid) data ows in an engine independent manner, as well as to support deployment of previously built DIFs over a variety of execution engines. 4.5 Chapter 6: Supporting Job Scheduling with Workload-driven Data Redistribution (Data Flow Scheduler) Once the designed DIFs are deployed to the selected execution engines, one may assume that their execution can be handed to the engine specic planner and executor (e.g., Apache Hadoop YARN [191]). While this is true in most of the cases, still a ow designer may choose not to simply rely on the provided functionality of these data processing engines. Consider for instance distributed data processing systems, like Hadoop, which have emerged as a necessity for processing, in a scalable manner, large-scale data volumes in clusters of commodity resources. While they typically provide fault-tolerant, reliable, and scalable platforms for distributed data processing, the network trac is identied as a bottleneck for the performance in most of these systems [85]. Current scheduling techniques in Hadoop typically follow a query shipping approach where the tasks are brought to their input data, hence data locality is exploited for reducing network trac. However, such scheduling techniques make these systems sensitive to the specic distribution of data in the cluster, and when skewed, it can drastically aect the performance of data processing applications. At the same time, underlying distributed data storage systems, which are typically independent of the application layer, do not consider the imposed workload when deciding data placements in the cluster. For instance, Hadoop Distributed File System (HDFS) places data block replicas randomly in the cluster following only the data availability policies, hence without a guarantee that data will be uniformly distributed among DataNodes [156]. Some of them provide certain rebalancing techniques, which are however still blindly done, without considering the real workload imposed by executing DIFs. 15
Chapter 1. Introduction In Chapter 6, we address these challenges and present a workload-driven approach for data redistribution, called H-WorD, to support scheduling of DIFs. H-WorD leverages on having a complete overview of the cluster workload and automatically decides on a better redistribution of workload and data. We exemplify our approach using a well-known MapReduce model [43], implemented inside the Apache Hadoop system [191]. In particular, H-WorD comprises an algorithm for supporting scheduling of DIFs with workload-driven data redistribution. H-WorD starts from a set of previously proled DIFs (e.g., MapReduce jobs) that are planned for execution in the cluster; e.g., a set of jobs currently queued for execution in a batch-queuing grid manager system. The cluster workload is initialized following commonly used scheduling techniques (i.e., exploiting data locality, hence performing query shipping). Then, H-WorD iteratively reconsiders the current workload distribution by proposing dierent execution scenarios (e.g., executing map tasks on nodes without local data, hence performing also data shipping). In each step, it estimates the eect of a proposed change to the overall cluster workload, and only accepts those that potentially improve certain quality characteristics. We focus here on improving the overall makespan of the jobs that are planned for execution. As a result, after selecting execution scenarios, H- WorD identies the tasks of DIFs that would require data shipping (i.e., transferring their input data from a remote node). On the one hand, our techniques can be used oine, complementary to existing MapReduce scheduling techniques, to automatically instruct redistribution of data beforehand. On the other hand, our nal goal here envisions more sophisticated scheduling techniques where H-WorD can be used on the y, to take advantage of a priori knowing potentially needed data transfers, and leveraging on idle network cycles to schedule such data transfers in advance, without deferring other tasks' executions. 5 Contributions The rst contribution of this PhD thesis is the study of the current eld of DIFs. In particular, we survey the existing approaches focusing on the characteristics that best describe the challenges of moving towards next-generation BI systems. We analyze both the foundational work of the database theory, and recent approaches for DIFs. As a result, we envision an architecture for managing the complexity of the DIF lifecycle in the next generation BI setting. The results of this study further help us to identify the remaining challenges for the DIF lifecycle that require further attention. Furthermore, we map the main contributions of this PhD thesis to the corresponding phases of the DIF lifecycle that they facilitate. 16
5. Contributions • Design. In the context of the design of DIFs, we provide support for re-engineering DIFs coming from a variety of engine-specic formats, in order to enable further engine-independent composition, analysis, and optimization of DIFs. In particular, we rst dene a logical (engineindependent) format, called xLM, as well as an extensible translation method for converting ows coming from dierent engines into a logical format. Moreover, we also provide support for the composition of hybrid data ows, by means of building a unied logical DIF, that in reality can span multiple storage and execution engines. • Optimization. We provide support for multi-ow optimization of DIFs. In particular, we provide a novel algorithm, called CoAl for consolidating DIFs. We dene generic methods for reordering and comparing data ow operations, which are applied while searching for a consolidation solution to increase data and operation reuse. • Implementation. We propose an extensible method, called BabbleFlow, for supporting the implementation and deployment of DIFs on a variety of execution engines. Such method can be used complementary with engine selection or multi-engine optimization approaches to assist the optimal deployment of DIFs over the selected engines. • Execution. We provide support for scheduling the execution of DIFs. In particular, we introduce a novel algorithm, named H-WorD, that led by the real workload of DIFs, decides on data redistribution that would improve the performance of executing these DIFs in a distributed data processing system. • Maintenance. Lastly, we also largely support the maintenance of DIFs in front of the evolving business needs. In particular, we present a semiautomatic approach to the incremental design of data-intensive ows (i.e., CoAl). We dene a framework for accommodating new, changed, or removed information requirements into an existing DIF design. Moreover, in the case of new information requirements, the CoAl algorithm tackles the problem of integrating new data ows from the context of data and code reuse. In addition, in the DW context, we also tackle the problem of supporting the evolution of a target MD schema design in front changed business needs. We propose a novel method, called ORE for accommodating changed business needs to the existing MD schema design, by means of eciently integrating target MD schemata coming from dierent information requirements. Lastly, we introduce the traceability metadata structure to systematically record valuable information about the MD schema integration, thus providing valuable information for supporting the redesign of back-end ETL processes. 17
Chapter 1. Introduction 18
Chapter 2 A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey The paper has been accepted for publication in the in Transactions on Large-Scale Data- and Knowledge-Centered Systems, 2016. The layout of the paper has been revised. DOI: TBD Springer copyright/ credit notice: © 2016 Springer. Reprinted, with permission, from Petar Jovanovic, Oscar Romero, and Alberto Abello, A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey, Transactions on Large-Scale Data- and Knowledge-Centered Systems, 2016 Abstract Data-intensive ows are central processes in today's business intelligence (BI) systems, deploying dierent technologies to deliver data, from a multitude of data sources, in user-preferred and analysis-ready formats. To meet complex requirements of next generation BI systems, we often need an eective combination of the traditionally batched extract-transform-load (ETL) processes that populate a data warehouse (DW) from integrated data sources, and more realtime and operational data ows that integrate source data at runtime. Both academia and industry thus must have a clear understanding of the foundations of data-intensive ows and the challenges of moving towards next generation BI environments. In this chapter we present a survey of today's research on 19
Chapter 2. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey data-intensive ows and the related fundamental elds of database theory. The study is based on a proposed set of dimensions describing the important challenges of data-intensive ows in the next generation BI setting. As a result of this survey, we envision an architecture of a system for managing the lifecycle of data-intensive ows. The results further provide a comprehensive understanding of data-intensive ows, recognizing challenges that still are to be addressed, and how the current solutions can be applied for addressing these challenges. 1 Introduction Data-intensive ows are critical processes in today's business intelligence (BI) applications with the common goal of delivering the data in user-preferred and analysis-ready formats, from a multitude of data sources. In general, a dataintensive ow starts by extracting data from individual data sources, cleans and conforms extracted data to satisfy certain quality standards and business requirements, and nally brings the data to end users. In practice, the most prominent solution for the integration and storage of heterogeneous data, thoroughly studied in the past twenty years, is data warehousing (DW). A DW system assumes a unied database, modeled to support analytical needs of business users. Traditionally, the back stage of a DW system comprises a data-intensive ow known as the extract-transform-load (ETL) process responsible of orchestrating the ow of data from data sources towards a DW. ETL is typically a batch process, scheduled to periodically (e.g., monthly, daily, or hourly) load the target data stores with fresh source data. In such a scenario, limited number of business users (i.e., executives and managers) are expected to query and analyze the data loaded in the latest run of an ETL process, for making strategic and often long-term decisions. However, highly dynamic enterprise environments have introduced some important challenges into the traditional DW scenario. • Up-to-date information is needed in near real-time (i.e., right-time [70]) to make prompt and accurate decisions. • Systems must provide the platform for eciently combining in-house data with various external data sources to enable context-aware analysis. • Systems must be able to eciently support new, unanticipated needs of broader set of business users at runtime (i.e., on-the-y). These challenges have induced an important shift from traditional business intelligence (BI) systems and opened a new direction of research and practices. The next generation BI setting goes by various names: operational BI (e.g., [40,50]), live BI (e.g., [42]), collaborative BI (e.g., [19]), self-service BI (e.g., [7]), situational BI (e.g., [110]). While these works look at the problem from 20
3. Methodology • extract-transform-load (ETL). In the traditional BI setting, data are extracted from the sources, transformed and loaded to a target data store (i.e., a DW). For posing analytical queries (e.g., OLAP), the business users in such a scenario solely rely on the data transferred in periodically scheduled time intervals, when the source systems are idle (e.g., at night time). • extract-transform-operate (ETO). Next generation BI has emerged as a necessity of companies for combining more instantaneous decision making with traditional, batched processes. In such a scenario, a user query, at runtime, gives rise to a data ow that accesses the data sources and alternatively crosses them with already loaded data to deliver an answer. Kimball and Caserta [96] introduced the following denition of an ETL process "A properly designed ETL system extracts data from the source systems, enforces data quality and consistency standards, conforms data so that separate sources can be used together, and nally delivers data in a presentation-ready format so that application developers can build applications and end users can make decisions." Being general enough to cover the setting of data-intensive ows studied in this chapter (i.e., both previous scenarios), we follow this denition and rst divide our study setting into three main stages, namely: i Data extraction. A data-intensive ow starts by individually accessing various (often heterogeneous) data sources, collecting and preparing data (by means of structuring) for further processing. ii Data transformation. Next, the main stage of a data-intensive ow transforms the extracted data by means of cleaning it for achieving dierent consistency and quality standards, conforming and combining data that come from dierent sources. iii Data delivery. This stage is responsible for ensuring that the data, extracted from the sources, transformed and integrated are being delivered to the end user in a format that meets her analytical needs. Related elds. To complete the data-intensive ows lifecycle, in addition to the main three stages, we revisit two elds closely related to data-intensive ows, i.e., data ow optimization and querying. iv Data ow optimization considers data-intensive ow holistically and studies the problem of modifying the given data ow, with the goal of satisfying certain non-functional requirements (e.g., performance, recoverability, reliability). Obviously, the optimization problem is critical for data ows in today's BI systems, where the data delivery is often required in the near real-time manner. 27
Chapter 2. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey In addition, for the completeness of the overall picture, we briey analyze what challenges the two main scenarios in data-intensive ows (i.e., ETL and ETO) bring to querying. v The requirements elicitation and analysis (i.e., querying) stage mainly serves for posing analytical needs of end users over the available data. This stage is not actually part of a data-intensive ow execution, but depending on the scenario (i.e., either ETO or ETL), can respectively come as a preceding or subsequent stage for a data-intensive ow execution. At the lower level of abstraction, end users' analytical needs are typically expressed in terms of queries (e.g., SQL), programs (e.g., ETL/MapReduce jobs), or scripts (e.g., Pig Scripts), which are then automatically translated to data-intensive ows that retrieve the needed data. The typical challenges of querying the data in the next generation BI setting concern the ability of the system to adapt and complement users' analytical needs by means of discovering related, external data, and the usability of a BI system for posing analytical needs by end-users. The former challenge may span from the traditional DW systems that typically answer user's OLAP queries solely by exploiting the data previously loaded into a DW (by means of an ETL process), to situation-(context-)aware approaches that considering end user queries, explore, discover, acquire, and integrate external data [7,9]. Regarding the latter challenge, we can also observe two extreme cases: traditional querying by means of standard, typically declarative query languages (e.g., SQL, MDX), and approaches that enable users to express their (often incomplete) analytical needs in a more natural and human-preferred manner (e.g., keyword search, natural language). Recently, some researchers have proposed more exible (semi-structured) query language (SQL++) for querying a variety of both relational and new NoSQL databases that may store data in a variety of formats, like JSON or XML [125]. Other approaches also tackled the problem of providing a higher level of abstraction for posing information requirements, more suitable for business users. As analyzing information requirements and systematically incorporating them into a design of data-intensive ows has been typically overlooked in practice, initial eorts were mostly toward systematic requirements analysis in BI and DW projects (e.g., [65,196]). However, such approaches still require long processes of collecting the requirements at different levels of abstraction and their analysis, before manually incorporating them into a data-intensive ow design. Thus, they obviously cannot be applied in ETO scenarios, where the generation of data-intensive ows to fulll end user analytical needs is expected in near real-time. Other works identied such problem and proposed certain automation to such time-lasting process (e.g., [146]). However, the automation required lowering the level 28
3. Methodology of abstraction for dening information requirements, tightening them to the multidimensional model notation (i.e., facts and dimensions of analysis). As an extension to this approach the authors further tried to raise the level and provide an abstraction of the data sources' semantics in terms of a domain ontology, with its graph representation. This has partially hidden the model specic details from business users, and allowed them to pose information requirements using a domain vocabulary. Recent work in [60] conducted an extensive study of decision support system approaches, identifying how they t the traditional requirements engineering framework (i.e., [132]). As a result, the authors identied a need for systematic and structured requirements analysis process for further raising the level of automation for the design of decision support systems (including the design of data-intensive ows), while at the same time keeping the requirements analysis aware of all stakeholder needs. We have discussed here the main challenges that requirements elicitation and analysis introduces to the eld of data-intensive ows in the next generation BI setting, but we omit further analysis as it falls out of the scope of this work. As a result, we dene a blueprint for studying data-intensive ows, depicted in Figure 2.4. Going from top down, we depict separately the two main scenarios of data-intensive ows studied in this chapter (i.e., ETL and ETO). Going from left to right, the rst part of Figure 2.4 (i.e., A, E) depicts the characteristics of the data extraction stage in terms of the complexity that dierent input data types bring to a data-intensive ow; then the following part (i.e., B, F) covers the characteristics of the data transformation stage; the penultimate part (i.e., C, G) covers the data delivery stage, while the last (most right) part (i.e., D, H) covers querying. Being rather a holistic eld (i.e., taking into account the complete data-intensive ow), the optimization spans all stages of data-intensive ows and it is depicted at the bottom of Figure 2.4. 3.3 Phase II (Analyzing the characteristics of data-intensive ows). This phase included the review of the works that scrutinize the characteristics of data-intensive ows in both previously dened scenarios, i.e., ETL and ETO. This phase aimed at characterizing data-intensive ows in terms of the features that best indicate the movement toward the next generation BI setting. To this end, we performed an incremental analysis of the included works to discover the features of data-intensive ows they have tackled. We started from the papers that individually covered the traditional and the next generation BI settings. The identied features are then translated into the dimensions for studying data-intensive ows (see Figure 2.5). As new dimensions are discovered, the related papers are reconsidered to analyze their assumptions regarding the new dimensions. Each discovered dimension determines the levels, supported or envisioned by analyzed approaches, in which these approaches 29
Chapter 2. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey Fig. 2.4: Study setting for data-intensive ows attain the corresponding feature of data-intensive ows. Eventually, we converged to a stable set of dimensions, which can be further used for studying and classifying the approaches of data-intensive ows. In Section 4, we discuss in more detail the process of discovering dimensions for studying data-intensive ows, and further provide their denitions. 3.4 Phase III (Classication of the reviewed literature). In this phase, we further extend the study to the works that more specically cover the previously discussed areas of data-intensive ows (i.e., data extraction, data transformation, data delivery, and data ow optimization). We classify the reviewed approaches using the previously dened dimensions, which build our study setting (see Figure 2.5), and present the results of this phase in Sections 5-8. We summarize the classied approaches of the three main stages (i.e., data extraction, data transformation, and data delivery) respectively in Tables 2.1 (page 39) - 2.3 (page 49), and the optimization approaches in Table 2.4 (page 53). We mark the level of the particular dimension (i.e., challenge) 30
4. Dening dimensions for studying data-intensive ows that each approach achieves or envisions (i.e., Low , Medium , or High ) 6 . In addition, we also classify the approaches in Tables 2.1 -2.4 based on the fact if they are potentially applicable in ETL, ETO, or both ETL and ETO scenarios. Finally, for each reviewed approach we dene the technology readiness level, focusing on the rst four levels of the European Commission scale [51]. • TRL1 (basic principles observed), refers to work that either based on practical use cases or reviewed literature observes the basic principles that should be followed in practice (e.g., guidelines, white or visionary papers) • TRL2 (technology concept formulated), refers to work that provide theoretical underpinnings of the studied area, which are not always directly applicable in practice, but represent an important foundation for principles that should be followed in practice (e.g., the database theory works on data exchange and data integration). • TRL3/TRL4 (experimental proof of concept/technology validated in lab), refers to the system-oriented work that provide the proof of concept solution for an observed principle from the previous two levels, validated either over synthetic ( TRL3 ) or real-world use cases ( TRL4 ). 4 Dening dimensions for studying data-intensive ows For each area in the outlined study setting for data-intensive ows (Figure 2.4), we discuss in more detail, and further provide the denitions of the dimensions through which the reviewed works on data-intensive ows are analyzed (see Figure 2.4). Then, in the following sections 5-8, we discuss in more detail the works specically covering each of the studied areas. 4.1 Data Extraction The most commonly discussed challenge when extracting data (e.g., [7,96]) is related to the format in which the data are provided, i.e., structuredness. Structuredness determines the level, in which data in data sources under analysis follow a certain model, constraints or format. It spans from highly structured data that follow strictly dened models and ensures certain constraints over data ( High ), like relational (see top left of Figure 2.4); then semistructured data that are represented in a repetitive [83], standard and easily 6 The exception to this are the approaches from the data ow optimization area, for which we introduced levels that more precisely describe the consequences of their placement inside the corresponding dimensions. Moreover, in the cases when the approach is completely independent of the level for a particular dimension, we mark it as non-applicable ( N/A ). 31
Chapter 2. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey Fig. 2.5: Dimensions for studying data-intensive ows parsable format, but that do not enforce strong constraints over data ( Medium ), like XML, CSV, RDF (see middle left in Figure 2.4); and unstructured data in a free-form (textual or non-textual) that require smarter techniques for extracting real value from it ( Low ), like free text, photos, x-rays, etc. (see bottom left of Figure 2.4). l Other characteristics of this stage are related to the degree in which BI applications need to be coupled with source systems when extracting the data, i.e., coupledness, and the reliability of accessing these systems, i.e., accessibility. Coupledness determines the level, in which data-intensive ows depend on a specic knowledge or components obtained from data sources under analysis. It spans from typical ETL processes that consolidate organization's (in-house) operational sources with predictable access policies (e.g., DBMS, ERP systems; see top left of Figure 2.4), using extraction algorithms (e.g., incremental DB snapshots) that strongly depend on information from source systems ( High ), e.g., materialized views DW solutions, triggers, source components modications; then the systems that use logs, timestamps or other metadata attached to data sources ( Medium ); and the scenarios where we cannot expect any inadvance knowledge about the data sources, but the system needs to discover and integrate them on-the-y [9] ( Low ), e.g., Web data, Link Open Data. l Accessability determines the level, in which one can guarantee a "non-stop" access to certain data sources. It spans from "in-house", highly available data ( High ), like ERP, ODS systems; then the external data usually provided by data providers that under SLAs can guarantee certain accessibility to data ( Medium ); 32
4. Dening dimensions for studying data-intensive ows and external data sources that are completely out of the organization's control ( Low ), like open, situational, or Web data. l 4.2 Data Transformation In this stage, the most common issue is related to the complexity of data transformations inside a ow (e.g., [186]), and more specically to the degree in which we can automate the design of a data-intensive ow, i.e., automation. While the design of an ETL process is known to be a demanding task (e.g., [170]; see the example ETL process in the top middle of Figure 2.4) and its automation (even partial) is desirable and has been studied in the past (e.g., [120,146]), ETO depends on fully automated solutions for answering user queries at runtime (e.g., by means of reasoning; see Figure 2.4). Automation determines the level, in which one can automate the design of data-intensive ows. It spans from the works that propose modeling approaches to standardize the design of data ows, especially in the context of ETL processes ( Low ), e.g., [190,180,12]; then approaches that provide guidelines and/or frequently used patterns to facilitate the design of a data-intensive ow ( Medium ), e.g., [96,189]; and approaches that attempt to fully automate the generation of data-intensive ows as well as their optimization ( High ), e.g., [146,52,44]. l Other important characteristics that distinguish ETO from a traditional ETL process are the degree of data constraintness that a ow must ensure, and the exibility (i.e., malleability) of a data-intensive ow in dealing with the changes in the business context. Constraintness determines the level, in which data-intensive ows must guarantee certain restrictions, constraints, or certain level of data quality over the output data. It spans from fully constrained data, usually enforcing the MD model (MD integrity constraints [114]), and high level of data cleanness and completeness required to perform further data analysis, like OLAP ( High ); then, data-intensive ows that may provide ad-hoc structures for answering user queries (e.g., reports), without a need to enforce the full completeness and cleanness of data ( Medium ); and as an extreme case we consider the concept of data lakes where no specic schema is specied at load time, but rather exible to support dierent analysis over stored and shared data at read-time ( Low ). l Malleability determines the level in which a system is exible in dealing with the changes in the business context (e.g., new/changed data sources under analysis, new/changed/removed information requirements). It spans from the traditional DW settings where data sources as well as information requirements are static, typically gathered in advance. and are added manually to the analysis only at design time, while any change would require the redesign of a complete data-intensive ow ( Low ) [96]; then systems that tackle the incremental evolution of data-intensive ows in front of new requirements and data 33
Chapter 2. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey sources ( Medium ) [89]; and dynamic approaches that consider discovering new, usually external data at runtime ( High ) [9]. l 4.3 Data Delivery For delivering the transformed data at the target, we have identied two main characteristics that distinguish ETL from ETO, namely the interactivity of data delivery as perceived by the end-user; and the openness of the delivered data, which refers to the degree in which the approaches assume the delivered information to be complete (i.e., closed vs. open world assumption). Interactivity determines the level in which a system interacts with the enduser when executing a data-intensive ow and delivering the data at the output. It spans from traditional ETL processes that typically deliver the data (i.e., materialize the complete data to load a DW) in a batched, asynchronous process, without having an interaction with an end-user ( Low ), then approaches that based on the overall cost, select data to be partially materialized (e.g., loaded in a batch to materialized views), and those that are queried on-the-y ( Medium ); and nally completely interactive approaches that assume on-the-y data ows which deliver the data to answer user queries for immediate use only, e.g., for visualization ( High ). l Openness determines the level, in which the delivered data are considered open to dierent interpretations. It spans from closed-world assumption approaches typical for traditional databases, where the data are considered complete and any answer to a user query is determined ( Low ), to open-world assumption approaches, where due to the assumption that data may be incomplete, an answer to a user query can be either determined if there exist data that can prove such an answer, or unknown in the case where there is no data to determine its truthfulness ( High ). l 4.4 Optimization of data-intensive ows Finally, we also discuss the low data latency as an important requirement for today's data-intensive ows. Optimizing data ows has been one of the main topics in database research [84]. In this context, we discuss the following two aspects. Optimization input. This dimension refers to the level at which the optimization is provided. It spans from optimizing the way that input data is stored and processed (e.g., data fragmentation) in order to achieve optimal execution (e.g., parallelizing data ow execution); then optimizing the execution of single data flows by means of modifying the execution of the data ow (e.g., operation reordering, dierent implementations) to achieve the optimal execution of a data ow; and nally the overall optimization of a multi-flow , 34
5. Data Extraction where the goal is to achieve the optimal execution for a set of data ows, rather than optimizing the execution of a single ow. l Dynamicity. Another dimension for studying the optimization of data-inte- nsive ows relates to the overhead introduced by the optimization and thus determines the level of dynamicity of the data ow optimization process. In the traditional DW systems, the design and optimization of ETL processes is done at the design time , once while the process is then executed periodically, many times. This obviously allows for a higher overhead of the optimization process and taking into account dierent metadata (e.g., statistics from the previous executions of the same ow). On the other hand, an ETO ow must be optimized at runtime , when the analytical query is issued, which introduces additional challenges into the optimization techniques, especially regarding the way the statistics are gathered and exploited for optimization. l 5 Data Extraction In the initial stage of data-intensive ows, the source systems are identied and accessed for extracting the relevant data. In the data extraction stage, we focused on analyzing the three following challenges that characterize the shift towards the next generation BI settings, namely coupledness, accessibility, and structuredness, which are subsequently discussed in the following subsections. 5.1 Structuredness The seminal work on DW systems (e.g., [82]), although mentioned external unstructured data as an important opportunity for building DW system, have not in particular tackled the challenges that they bring to the design of the ETL pipelines. Furthermore, some of the rst (purely relational) approaches for the DW system design in the literature (i.e., using materialized views in [174]), as well as the later extraction techniques (e.g., [104,109]) assumed purely relational data sources, thus only supported High structuredness of input data. [96] considers Medium stucturedness of input data, by providing the practical guidelines for accessing external data in Web logs or at les, and semi-structured data (i.e., XML; see Figure 2.4(A)). Example. In our running example, the ETL ow depicted in Figure 2.4 reads data from the transactional systems supporting daily sales operations. Notice that besides the challenges that heterogeneity in data sources (both structural and semantic [166]) brings to the design of an ETL pipeline, wellstructured data sources do not require any special technique for obtaining the data before the transformation and cleaning starts. However, today, using a diversity of external and often unstructured data sources is becoming inevitable and thus the techniques for extracting such data have attracted the attention 35
Chapter 2. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey of both academy and industry. In our example scenario, we can see that introducing unstructured data (e.g., free text reviews from the Web) into the analytical processes of the company (see Figures 2.2 and 2.3) required additional data processing for extracting relevant information from these sources. Specically, Sentiment Analysis based on natural language processing (NLP) is performed over textual data from the Web to extract customer opinions about the items and the campaign. l In research, dierent techniques (e.g., text mining [56], NLP [105,57], sentiment analysis) are proposed to discover data patterns and extraction rules for extracting relevant data from natural language documents and transform unstructured data into more explicitly structured formats [30] (e.g., graphs, trees, relational model). There, approaches are hence able to deal with the Low structuredness of input data. However, at the same time, they may assume a considerable latency overhead to the execution of the complete data pipeline and thus introduce an additional challenge to data-intensive ows. Interestingly, the linked data movement [20], on the other side, proposes that large amounts of external data are already provided in more structured (semistructured) formats and semantically interlinked (e.g., using RDF), in order to facilitate the situation-aware analysis [110] and data exploratory actions [9]. These approaches assume Medium structuredness of input data, ready for the analytical processes carried out by data-intensive ows. 5.2 Coupledness First relational approaches for designing a DW by means of a set of materialized views (e.g., [174]) in general allowed very ecient refreshments processes, by applying the well-known view maintenance techniques, to either compute incremental changes in the sources or a complete "rematerialization" of a view. Both approaches issue queries (maintenance queries) over the data sources, extract the answer, and load the corresponding views. Such approaches, however, required a High coupledness to source systems and soon became unrealistic to support the demands of enterprises to include a variety of external data sources into their analytical processes. Example. As we can see from our example scenario, the retail company initially relied mainly on the internal data sources (e.g., the information about the sold items ), which are periodically transferred to a central DW (see Example 1.1). To lower the data transferred in every execution of the ETL ow, the designers have built the ow to only extract the sales and item data that are inserted to the sources after the last ETL execution (i.e., snapshot dierence). For eciently nding the dierences in two snapshots of the source data, the tight ( High ) coupledness to the considered data sources is needed. On the other side, in the scenario illustrated in Examples 2.1 and 2.2 (i.e., Figures 2.2 and 2.3, respectively), some data sources (i.e., item reviews from the Web) are 36
6. Data Transformation 2.2 and 2.3), due to their time constraints typically cannot aord to ensure full data quality standards, but is often sucient to deliver partially cleaned (i.e., right) data, at the right time to an end-user [50]. l The work on generalizing schema mappings (GLAV) in [59] also discusses the importance of adding support for dening the constraints on global schema, but no concrete solution has been provided. In the data integration setting, although some works did study query answering in the presence of integrity constraints on global schema [32], (i.e., Medium constraintness), most of the prominent data integration systems (e.g., [61,98]) typically do not assume any constraints in the target schema (i.e., Low constraintness). Furthermore, as we discussed in the DW context, the design of an ETL process is aected by the integrity constraints typical in a dimensionally modeled DW schema (see Figure 2.4(C)). When working with data from unstructured data sources, one may face two dierent problems: (1) how to extract useful information from data in unstructured formats and create more structured representation; and (2) how to deal with incomplete and erroneous data occurred due to lack of strict constraints in source data models. The latter problem becomes even more challenging when the target data stores entail strict constraints as we discussed above. While the former problem is usually handled by means of data extraction techniques discussed in the Section 5, the latter is solved at the data transformation stage, where data are cleaned to fulll dierent quality standards and target constraints. As expected, such a problem has brought the attention of researchers in the data exchange (e.g., [53]) and data integration (e.g., [47]) elds. In the modern DW systems, target data quality and High constraintness is usually guaranteed as the result of the process called data cleaning. Data cleaning deals with dierent data quality problems detected in sources, e.g., lack of integrity constraints at sources, naming and structural conicts, duplicates [137]. 6.3 Automation It is not hard to see from the previously discussed problem of data cleaning and the ows in the example scenario, that today's data-intensive ows require more sophisticated data transformations than the ones (mainly based on logics) assumed by fundamental approaches of data exchange and data integration. At the same time, higher automation of the data ow design is also required to provide interactive, on-the-y, analysis. Example. Loading a DW may require complex data cleaning operations to ensure the entailed constraints. Obviously, complete automation of the design of such data-intensive ows is not realistic and thus the designers in Scenario 1 usually rely on a set of frequent data transformations when building ETL ows (e.g., Join , UDF , and Remove Duplicates in Figure 2.1). But, in Scenario 2, such an assisted design process is not sucient, as the ows for 43
Chapter 2. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey answering users' on-the-y queries (e.g., see Examples 2.1 and 2.2) must be created instantaneously. This, together with the requirement for lower data latency, restricted such ows to more lightweight operations (e.g., Filter or Match in Figure 2.2). l Dierent design tools are available in the market and provide often overlapping functionalities for the design and execution of data-intensive ows (mostly ETL; see for example Figure 2.4(B)). The complexity and variability of data transformations has introduced an additional challenge to the eorts for providing a commonly accepted modeling notation for these data ows. Several works have proposed dierent ETL modeling approaches, either ad-hoc [190], or based on well-known modeling languages, e.g., UML in [180] or BPMN in [12,195]. However, these modeling approaches do not provide any automatable means for the design of an ETL process (i.e., Low automation). Some approaches (e.g., from UML [120], or from BPMN [13]) are further extended to support certain (i.e., Medium ) automation of generating an executable code from the conceptual ow design, by means of model transformations (i.e., Model-driven design). The design of an ETL process is on the other side described as the most demanding part of a DW project. As reported in [170] ETL design can take up to 80% of time of the entire DW project. In [96] the authors give some practical guidelines for a successful design and deployment of an ETL process, but without any automatable means (i.e., Low automation), still, a considerable manual eort is expected from a DW designer. In [189], the framework that uses the ad-hoc modeling notation from [190] is proposed to assist the ETL design, along with the palette of frequently used ETL patterns (i.e., Medium ). Several approaches went further with automating the conceptual design of ETL processes. On the one hand, in [167], the authors introduced the design approach based on Semantic Web technologies to represent the DW domain (i.e., source and target data stores), showing that this would further enable automation of the design process by beneting from the automatic reasoning capabilities of an ontology. [146], on the other hand, assumes that only data sources are captured by means of a domain ontology with associated source mappings. Both DW and ETL conceptual designs are then generated to satisfy information requirements posed in the domain vocabulary (i.e., ontology). Finally, [18] entirely rely on an ontology, both for describing source and target data stores, and corresponding mappings among them. Integration processes (ETL) are then also derived at the ontological level based on the type of mappings between source and target concepts (e.g., equality, containment). However, even though these approaches enable High automation of the data ow design, they work on a limited set of frequent ETL operations. In parallel, in the eld of data exchange, [52] proposes a tool (a.k.a. Clio) that automatically generates correspondences (i.e., schema mappings) among schemas without making any initial assumptions about the relationships between them, nor how these schemas were created. Such a generic approach 44
6. Data Transformation thus supports High automation in creating dierent schema mappings for both data integration and data exchange settings. [44] went further to provide the interoperability between tools for creating declarative schema mappings (e.g., Clio) and procedural data-intensive tools (e.g., ETL). Still, such schema mappings either cannot tackle grouping and aggregation or overlook complex transformations typical in today's ETL processes. The next generation BI settings, however, cannot always rely on the manual or partially automated data ow design. Moreover, unlike ETL, ETO cannot completely anticipate end user needs in advance and thus besides the High level of automation, the design process must also be agile to eciently react in front of new or changed business needs (e.g., [143]). Table 2.2: Classication of data transformation approaches Data transformation ETL vs. Approaches TRL Dimensions ETO AUTHORS, YEAR, [NAME,] REF. autom. malleab. constr. ETL Fagin et al., 2003, [55]2N/A N/A HighKolaitis, 2005, [99] Rahm & Hai Do, 2000, [137] 1 Kimball & Caserta, 2004, [96] 1 Low Low High Vassiliadis et al., 2002, [190] 2 Low Low High Trujillo & L.-Mora, 2003, [180] Wilkinson et al., 2010, xLM, [195] El Akk. et al., 2012, BPMN-ETL [12] Munoz et al., 2009, [120]3 Medium Medium HighEl Akkaoui et al., 2013, [13] Vass. et al., 2003, ARKTOS II, [189] Papastefanatos et al., 2009, [129] Morzy & Wrembel, 2004, [118] Golfarelli et al., 2006, [66] Skoutas & Simitsis, 2007, [167]3High Low HighBellatreche et al., 2013, [18] Fagin et al., 2009, Clio, [52] 4 McDon. et al., 2002, SAP BW, [117] 4 Medium Medium High ETL & Romero et al., 2011, GEM, [146]3 High Medium HighETO Dessloch et al., 2008, Orchid, [44] Jovanovic et al., 2012, CoAl, [89] ETO G.-Molina et al., 1997, TSIMMIS, [61] 4 High Medium Low Kirk et al., 1995, Inf. Manifold, [98] 3 High High Low Romero & Abello, 2014, [143]1 Abello et al., 2014, [9] McBrien & Pou., 2003, BAV, [116]2 N/A High MediumFriedman et al., 1999, GLAV, [59] Cal i et al., 2004, [31] 6.4 Discussion As we have seen, in the next generation BI setting (i.e., ETO), where data sources are often external to the organization control and moreover discovered 45
Chapter 2. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey dynamically based on current user needs; a more exible environment is needed for eciently supporting adding new data sources to analytical processes. The local-as-view (LAV) schema mapping approaches are more suitable in order to support the required level of malleability [116,59]. In the LAV approach, plugging new data sources requires dening a mapping of the new source schemata to the global schema, without aecting the existing mappings. However, as we can see in Table 2.2, currently, most of these techniques are still purely theoretical (i.e., TRL 2 ), while the high complexity and intractability of LAV approaches have been widely discussed, and hence represent a serious drawback for using LAV mappings in near real-time BI environments. On the other side, some approaches (e.g., [52]) have worked on automating the creation of such schema mappings, which can be widely applicable for supporting answering information requirements on-the-y. Even though we notice the lower requirement for the cleanness and constraintness of output data in the next generation BI setting (see Table 2.2), which would typically result with lower complexity of a data ow, today's BI applications do require rather complex data analytics, which are typically not supported in the schema mapping approaches. Some approaches try to extend this by automating the ow design (e.g., [146,18]), but still with very limited and predened operation sets (i.e., ETL & ETO). Therefore, automating the creation of more complex data-intensive ows (e.g., machine learning algorithms), by means of exploiting dierent input data characteristics or using metadata mechanisms is still lacking. 7 Data Delivery After data from multiple sources are cleaned, conformed, and combined together, a data-intensive ow delivers the data in the format suitable to the user needs either for visualization, or further analysis and querying. In the data delivery stage, we focus on analyzing the two following dimensions, namely, interactivity and openness, subsequently discussed in the following sections. 7.1 Interactivity One of the important decisions that should be made while building dataintensive ows is the interactivity of the system when delivering data at the output. Example. Notice that the ETL ow in Figure 2.1 is designed to periodically transfer the complete data about the item sales in a batched back-end process, so that users may later analyze the subset of these data depending on their needs (e.g., slicing it only to the sales in the third quarter of the last). ETO ows in Figures 2.2 and 2.3, however, instantly deliver the data from 46
7. Data Delivery the sources that are currently asked by the user (e.g., trends of the past weekend, and trending product items from the rst week of March, respectively). Moreover, such ETO ows are typical examples of answering ad-hoc and onetime analytical queries, thus storing their results is usually not considered as benecial. l Going back again to the fundamental work on data exchange, the data delivery in this setting is based on computing a solution, i.e., a complete instance of the target schema that satises both, schema mappings and constraints of the target schema. The queries are then evaluated over this solution to deliver the answer to the user. However, due to incompleteness of data and/or schema mappings, there may be more than one, and theoretically an innite number of valid solutions to the data exchange problem [55]. Answering user queries in such a case would result in evaluating a query over all possible solutions (i.e., nding the certain answer). To overcome the obvious intractability of query answering in data exchange, a special class of solutions (universal solutions), having a homomorphism into any other possible solution, is proposed. Like in the data exchange setting, materializing the complete data at the target for the purpose of later answering user queries without accessing the original data sources, is also considered in the later approaches for designing a data warehouse (see Figure 2.4(G)), i.e., Low interactivity. As we discussed in Section 5, a DW has been initially viewed as a set of materialized views (e.g., [174]). Similarly, in this case the database specic techniques (e.g., incremental view maintenance) are studied to minimize the size of the data materialized in each run of refreshment ows (maintenance queries). However, as DW environments have become more demanding both considering the heterogeneity and volume of data, it became unrealistic to consider a DW solely as a set of materialized views. In addition, many approaches have further studied the modeling and the design of a target DW schema, which should be able to support analytical needs of end users. This has resulted in the eld of multidimensional (MD) modeling that is based on fact/dimension dichotomy. These works belong to a broader eld of MD modeling and design that is orthogonal to the scope of this chapter, and thus we refer readers to the survey of MD modeling in [140] and the overview of the current design approaches covered by Chapter 6 in [69]. Conversely, the data integration setting, as discussed in Section 6, does not assume materializing a complete instance of data at the target, but rather interactively answering individual user queries (e.g., through a data cube or a report; see Figure 2.4(G)) posed in terms of a global (virtual) schema (i.e., High interactivity). A query is reformulated at runtime into queries over source schemata, using schema mappings (e.g., [61,98,106,75,182]). Another examples of High interactivity are Complex Event Processing and Data Stream Processing systems. Besides the dierences these systems have (see their comparison in [37]), the common property of these systems is that they provide on-the-y delivery of data, with typically low latency, and for the one-time use 47
Chapter 2. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey only (e.g., monitoring stocks, fraud detection), without a need to materialize such data. In [63], in the context of peer data management, a hybrid solution is proposed based on both data exchange and data integration. The Medium interactivity, by partially materializing data and using a virtual view over the sources (peers), has been proposed. To this end, the solution presents schema dependencies that can be used both for computing the core and query answering. The right ( Medium ) level of interactivity is also discussed to be crucial in the next generation BI setting (e.g., [40]) where a partial materialization is envisioned for a subset of data with low latency and low freshness requirements (i.e., for which we can rely on the last batched ETL run). Following the similar idea, [134] proposes a framework for combining data-intensive ows with user query pipelines and hence choosing the optimal materialziation point (i.e., Medium interactivity) in the data ow, based on dierent cost metrics (e.g., source update rates and view maintenance costs). Another eld of research also follows the Medium level of interactivity, and proposes an alternative to traditional ETL processes, where row data are rst loaded to the target storage, and later, typically on-demand, transformed and delivered to end-users, i.e., extract-load-transform (ELT). For instance, an example ELT approach in [193] proposes an ELT architecture that deploys traditional database mechanisms (i.e., hierarchical materialized views) for enabling on-demand processing of fresher row data previously bulk loaded into a DW. 7.2 Openness As we have seen, incompleteness in source data (especially in the today's Web oriented environments, see Scenario 2 in Section 3), brings several challenges to data-intensive ows. In addition, when integrating and delivering the data at the target, due to possibly incomplete (or non-nite) data, the choice between two main assumptions should be made, i.e., closed world assumption (CWA) or open world assumption (OWA). This choice depends on dierent characteristics of both, the considered data sources and the expected target. For the systems, like in-house databases or traditional data warehouse systems, where the completeness of data can be assumed, CWA is preferable since in general we do not anticipate discovering additional data (i.e., Low openness). On the other side, when we assume incomplete data at the sources of analysis, we can either follow CWA and create a single nite answer from incomplete data (e.g., by means of data cleaning process), or OWA which would in general allow multiple and possibly an innite number of interpretations of the answer at the target, by considering also dynamically added data to the analysis [9] (i.e., High openness). Example. In our example scenarios, in the traditional BI setting (Scenario 1), the analysis of the revenue share depends solely on the data about the item 48
7. Data Delivery sales , currently transferred to DW by means of the ETL process depicted in Figure 2.1. On the other hand, the next generation BI setting in Scenario 2, should assume a more open environment, where at each moment depending on the end user needs (e.g., following trends and opinions about items as in Examples 2.1 and 2.2) the system must be able to dynamically discover the sources from which such an information can be extracted (e.g., reviews in forums). l Similarly, [130] revisits two main paradigms for the Semantic Web: (1) Datalog, that follows the CWA, and (2) Classical (standard logics) paradigm that follows OWA. An important conclusion of this work is that the Datalog paradigm as well as CWA is more suitable for highly structured environments in which we can ensure completeness of the data, while the Classical paradigm and OWA provide more advantages in loosely coupled environments, where the analysis should not only be limited to the existing (i.e., in-house) data. Moreover, coinciding arguments are found in the elds of data integration and data exchange. Intuitively, CWA (i.e., Low openness) is more suitable assumption in data exchange, where query answering must rely solely on data transferred from source to target using dened schema mappings and not on the data that can be added later [108]. Conversely, more open scenario is typically expected in data integration systems [46], where additional data can be explored on-the-y and added to the analysis [9] (i.e., High openness). However, the high complexity of query answering under the OWA [130], raises an additional challenge to the latency of data-intensive ows, which is critical in next generation BI systems. Table 2.3: Classication of data delivery appraoches Data delivery ETL vs. Approaches TRL Dimensions ETO AUTHORS, YEAR, [NAME,] REFERENCE interac. open. ETL Golfarelli & Rizzi, 2009, [69] 2 Low Low Fagin et al., 2005, Data Exchange, [55] Libkin, 2006, [108] Theodoratos & Sellis, 1999, [174] ETL & ETO Dayal et al., 2009, [41] 1 Medium Low Qu & Dessloch, 2014, [134]3 Waas et al., 2013, ELT, [193] Giacomo et al., 2007, [63] 2 Medium Medium ETO Cugola & Margara, CEP, 2012, [37] 1 High Medium Abello et al., 2013, Fusion Cubes, [7]1 High High Abello et al., 2015, [9] Lenzerini, 2002, Data Integration, [106] 2 Halevy, 2001, [75] Ullman, 1997, [182] Doan et al., 2012, Data Integration [46] Garcia-Molina et al., 1997, TSIMMIS, [61]3 Kirk et al., 1995, Information Manifold, [98] 49
Chapter 2. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey 7.3 Discussion The outcome of studying the data delivery stage of data-intensive ows can be seen in Table 2.3. We observed that the same principles for data delivery (i.e., levels of the studied dimensions in Table 2.3) are followed in approaches of traditional data exchange [55] and DW settings [69] (i.e., ETL). At the same time, we also noticed that the similar principles of the data integration setting [106,46] are envisioned for next generation BI systems in some of the studied approachs [7,9] (i.e., ETO), while others propose a mixed approach [41] (i.e., ETL & ETO). Such observations strongly indicated that the underpinnings for building a system for managing data-intensive ows in the next generation BI setting should be searched in the theoretical eld of data integration. Such a trend has been indeed followed in some of the recent approaches. For example, the idea of creating a unied view over relevant data sources (i.e., the main principle of the data integration setting), is revisited by some approaches by creating a common domain vocabulary and integrating it with existing data sources (e.g., [167,146]). There, the use of a domain ontology to reconcile the languages of business and IT worlds when building a BI system has been proposed. In [146], an ontology is used in combination with schema mappings to automatically generate ETL pipelines to satisfy information requirements previously expressed in terms of an ontology by an end user. The approach works with a predened set of data sources which is, as suggested, suitable for building a DW system, but as data in today's BI settings are coming from disparate and external data sources, the challenge of capturing their semantics under a common vocabulary brings additional challenges. To this end, Semantic Web technologies are discussed (e.g., [9]) as a solution both for capturing the semantics and further interactive exploration of data, facilitated by the automatic reasoning mechanisms. 8 Optimization of data-intensive ows Optimizing the execution of data-intensive ows, is a necessity, especially taking into account the next generation BI setting that often requires the right-time delivery of information. 8.1 Optimization input The problem of data ow optimization has been considered from early years of databases from dierent perspectives, where each of these perspectives may aect dierent parts of a data ow. • Data. The optimization of a data ow execution can be achieved by 50
8. Optimization of data-intensive ows transforming the structure of the original dataset (e.g., by means of data partitioning [95]). However, notice that simply transforming a dataset would not achieve a better performance, unless the execution model of a data ow is able to exploit such a transformation (e.g., distributed or parallel data processing [43]). • Data flow. The most typical case considers the optimization of data ow execution by changing the way data are processed, while ensuring the equivalent semantics of the resulting dataset. Such techniques stem from the early years of databases, where minimizing data delivery time by changing the order and selecting the most optimal algorithm for operations applied over input data has been studied under the name of query optimization [84]. Moving to the DW environment, which assumes more complex data transformations than the ones in relational algebra, has opened a new eld of study dealing with optimizing ETL processes (e.g., [158]). In fact, similar principles to those introduced in query optimization (i.e., generating semantically equivalent execution plans for a query by reordering operations, and then nding a plan with a minimal cost) have been applied in [158] and extended to the context of ETL ows. Another work [78,138] has based operation reordering (i.e., plan rewrites) on automatically discovering a set of extensible operation properties rather than relying solely on algebraic specications, in order to enable reordering of complex ("black-box") operators. While low data latency is desirable for ETL processes, due to limited time windows dedicated to the DW refreshment processes, in the next generation BI setting, having data-intensive ows with close to zero latency is a must. Other techniques include: choosing the optimal implementation for the ow operations [181], selecting the optimal execution engine for executing a data ow [162,102], data ow fragmentation and pipelining [95,164]. • Multi-flow. In other scenarios, especially in the case of shared execution resources, the optimization goal may suggest optimizing the overall execution of a set of data ows, rather than only the execution of an individual ow. Approaches that deal with this problem fall in two categories. On the one hand, some approaches assume having a detailed knowledge of included data ows and thus try to exploit it and optimize the overall execution, by means of nding shared parts of data workloads and reusing common execution and data [150,64,89]. Other approaches however assume only a high level knowledge of included data ows (e.g., input data size, execution time, high-level ow complexity, time constraints for the ow execution; [133]). In such cases, the optimization of data ows proceeds by selecting the best scheduling for the execution of data-intensive ows, while the further optimization of individual data ows is left to an 51
Chapter 2. A Unied View of Data-Intensive Flows in Business Intelligence Systems: A Survey engine-specic optimizer [164]. 8.2 Dynamicity While the challenges due to the higher complexity of data transformation has been largely addressed [158,78], proposed cost-based techniques often require certain statistics metadata available for a given data ow in order to nd the optimal conguration. However, this is typically not the case and gathering and managing such statistics is not an easy task [74]. [74] proposes a statistics collection framework, by dening a set of necessary statistics, as well as gathering methods. However, this approach although powerful assumes a case of ETL process ow, where data ows are typically designed and optimized in advance (i.e., at design time ), while the statistics gathering depends on the previous execution of the same ETL process. Notice that the majority of the optimization approaches discussed in the previous subsection also assume a static case (see Table 2.4), where data ows are optimized once, at design time , and then executed many times. The exception to this are approaches that besides statically optimizing a data ow, also provide dynamic optimization of data ow executions in terms of runtime scheduling (i.e., [164,133,95]). Some optimization approaches however propose on-the-y gathering of statistics, more suitable for the next generation data ow setting, and applying data ow optimization steps at runtime . The approach in [42] proposes performing micro-benchmarks for building models to estimate the costs of operations using dierent implementations or executing them on dierent engines. They show how to deal both with the conventional (relational algebra) operators as well as with complex data transformations typical for the next generation data ows (e.g., sentiment or text analysis). The importance of using more accurate statistics for optimizing data ows in dynamic, cloud-scale environments has been also discussed in [29]. To deal with uncertainty when optimizing running data ows they propose an approach that continuously monitors the execution of data ows at runtime , gathers statistics, and re-optimizes data ows on-the-y to achieve better performance. The focus here is however on the distributed computational model, where execution times are often higher than in the centralized systems due to necessary synchronization costs, thus the re-optimization overheads are typically considered as negligible. 8.3 Discussion In Table 2.4, we summarize the outcome of studying data ow optimization approaches in this section. It is easy to see that a static (design time) optimization of data ows has been largely studied in academia. While most approaches worked on the problem of extending traditional query optimization 52
Chapter 3 Incremental Consolidation of Data-Intensive Multi-ows The paper has been published in the IEEE Transactions on Knowledge and Data Engineering, 28(5): pp. 1203-1216 (2016). The layout of the paper has been revised. DOI: http://dx.doi.org/10.1109/TKDE.2016.2515609 IEEE copyright/ credit notice: © 2016 IEEE. Reprinted, with permission, from Petar Jovanovic, Oscar Romero, Alkis Simitsis, and Alberto Abello, Incremental Consolidation of Data-Intensive Multi-ows, IEEE Transactions on Knowledge and Data Engineering, Volume:28(5) January (2016) Abstract Business intelligence (BI) systems depend on ecient integration of disparate and often heterogeneous data. The integration of data is governed by dataintensive ows and is driven by a set of information requirements. Designing such ows is in general a complex process, which due to the complexity of business environments is hard to be done manually. In this chapter, we deal with the challenge of ecient design and maintenance of data-intensive ows and propose an incremental approach, namely CoAl, for semi-automatically consolidating data-intensive ows satisfying a given set of information requirements. CoAl works at the logical level and consolidates data ows from either high-level information requirements or platform-specic programs. As CoAl integrates a new data ow, it opts for maximal reuse of existing ows and applies a customizable cost model tuned for minimizing the overall cost of a unied so- 59
Chapter 3. Incremental Consolidation of Data-Intensive Multi-ows lution. We demonstrate the eciency and eectiveness of our approach through an experimental evaluation using our implemented prototype. 1 Introduction The complexity of business environments constantly grows, both with regard to the amount of data relevant for making strategic decisions and the complexity of included business processes. Today's dynamic and competitive markets often imply rapid (e.g., near real-time) and accurate decision making. Relevant data are stored across a variety of data repositories, possibly using dierent data models and formats, and potentially crossed with numerous external sources for various context-aware analysis. A data integration process combines data residing on dierent sources and provides a unied view of this data for a user [106]. For example, in a data warehousing (DW) context, data integration is implemented through extract-transform-load (ETL) processes. Generally, an ETL process represents a data-intensive ow (or simply, data ow) that extracts, cleans, and transforms data from multiple, often heterogeneous data sources and nally, delivers data for further analysis. There are various challenges related to data ow design. Here we consider two: design evolution and design complexity. A major challenge that BI decision-makers face relates to the evolution of business requirements. These changes are more frequent at the early stages of a DW design project [34] and in part, this is due to a growing use of agile methodologies in data ow design and BI systems in general [79]. But changes may happen during the entire DW lifecycle. Having an up-and-running DW system satisfying an initial set of requirements is still a subject to various changes as the business evolves. The data ows populating a DW, as other software artifacts, do not lend themselves nicely to evolution events and in general, due to their complexity, maintaining them manually is hard. The situation is even more critical in today's BI settings, where on-the-y decision making requires faster and more ecient adapting to changes. Changes in business needs may result in new, changed, or removed information requirements. Thus having an incremental and agile solution that can automatically absorb occurred changes and produce a ow satisfying the complete set of requirements would largely facilitate the design and maintenance of data-intensive ows. In an enterprise environment data is usually shared among users with varying technical skills and needs, involved in dierent parts of a business process. Typical real-world data-intensive workloads have high temporal locality, having 80% of data reused in a range from minutes to hours [36]. However, the cost of accessing these data, especially in distributed scenarios, is often high [24]. At the same time, intertwined business processes may also imply overlapping of data processing. For instance, a sales department may analyze the revenue 60
1. Introduction of the sales for the past year, while nance may be interested in the overall net prot. Computing the net prot can largely benet from the total revenue already computed for the sales department and thus, it could benet from the sales data ow too. The concept of reusing partial results is not new. Software and data reuse scenarios in data integration have been proposed in the past, showing that such reuse would result in substantial cost savings, especially for large, complex business environments [148]. Data ow reuse could result in a signicant reduce in design complexity, but also in intermediate ow executions and thus, in total execution time too [24]. In this chapter, we address these challenges and present an approach to ecient, incremental consolidation of data-intensive ows. Following common practice, our method iterates over information requirements to create the nal design. In doing that, we show how to eciently accommodate a new information requirement to an existing design and also, how to update a design in lieu of an evolving information requirement. To this end, we describe a Consolidation Algorithm (CoAl) for data-intensive ows. Without loss of generality, we assume that starting with a set of information requirements, we create a data ow per requirement. The nal design satisfying all requirements comprises a multi-ow. As `coal' is formed after the process and extreme compaction of layers of partially decomposed materials 1 , CoAl processes individual data ows and incrementally consolidates them into a unied multi-ow. CoAl deals with design evolution by providing designers with an agile solution for the design of data ows. CoAl assists the early stages of the design process when for only a few requirements we need to build a running data ow from scratch. But, it also helps during the entire ow lifecycle when the existing multi-ow must be eciently accommodated to satisfy new, removed, or changed information requirements. CoAl reduces design complexity with aggressive information and software reuse. Per requirement, it searches for the largest data and operation overlap in the existing data ow design. To boost the reuse of existing design elements when trying to satisfy a new information requirement (i.e., when integrating a new data ow), CoAl aligns the order of data ow operations by applying generic equivalence rules. Note that in the context of data integration, the reuse of both data and code (e.g., having a single computation shared by multiple ows as depicted in Figure 3.4) besides reducing ow complexity, might also lead to faster execution, better resource usage, and higher data quality and consistency [148,94]. In addition, since data-intensive ows comprise critical processes in today's BI systems, CoAl accounts for the cost of produced data ows when searching for opportunities to integrate new data ows. CoAl uses a tunable cost model to perform multi-ow, logical optimization to create a unied ow design that 1 src. Wikipedia 61
Chapter 3. Incremental Consolidation of Data-Intensive Multi-ows satises all information requirements. Here, we focus on maximizing the reuse of data and operations, but the algorithm can be congured to work with dierent cost models, taking into account dierent quality factors of data ows (e.g., [161]). As a nal remark, CoAl works at the logical level and is therefore applicable to a variety of approaches that generate logical data ows from information requirements expressed either as high level business objects (e.g., [18,13,146]) or in engine specic languages (e.g., [92]). In particular, our main contributions are as follows. • We present a semi-automatic approach to the incremental design of dataintensive ows. • We introduce a novel consolidation algorithm, called CoAl, that tackles the data ow integration problem from the context of data and code reuse, while at the same time taking into account the cost of the produced data ow design. • We present generic methods for reordering and comparing data ow operations that are applied while searching for the consolidation solutions that will increase data and operation reuse. • We experimentally evaluate our approach by using an implemented prototype. A set of empirical tests have been performed to assess the CoAl's eciency and improvements in overall execution time. A short version of this chapter was published in Jovanovic et al. [88]. Outline. Section 2describes a running example and formalizes the problem at hand. Section 3discusses the main challenges: operations reordering and comparison. Section 4presents the CoAl algorithm. Section 5reports on our experimental ndings. Sections 6and 7discuss related work and conclude the chapter, respectively. 2 Overview 2.1 Running Example Figure 4.1 shows an abstraction of the TPC-H schema [5]. Figure 3.2 illustrates four example information requirements extracted from TPC-H queries. In a sense, our example here is adapted by reverse engineering the use case described by the TPC-H schema and queries. We create a data ow per each requirement in Figure 3.2 (see Figures 3.3 and 3.6). In the literature, there are many methods dealing with such task, either manually (e.g., [18,13]) or automatically (e.g., [146]). Independent of a method 62
2. Overview Fig. 3.1: TPC-H Schema for creating data ows from single requirements, CoAl focuses on the problem of integrating these ows into a unied ow that satises all requirements. Consider the DIF-1 and DIF-2 data ows depicted in Figure 3.3 that satisfy the requirements IR1 and IR2 , respectively. We dene the referent data ow as the integrated multi-ow satisfying a number of requirements already modeled (we start from IR1 ) and the new data ow as the ow satisfying the new requirement ( IR2 ). In terms of graphical notation, the squares represent source or target data stores, whereas the circles represent data ow operations. Operations of each data ow are uniquely named using the following notation: OPNAME = OPTYPE + OPID +";"+{ FLOWID s}. Note that the ow IDs at the end dene the set of data ows that share the given operation. They are optional and can be omitted for single (non integrated) data ows. Observe that the DIF-1 and DIF-2 data ows have a number of common operations. CoAl exploits this and creates an alternative, equivalent data ow IR1 : Revenue of the sales for the parts ordered in the past year, per quarter. IR2 : Net prot of the sales for the parts ordered in the last year, per quarter. IR3 : Top 10 automobile industry customers based on the quantity of shipped parts, ordered in the last year. IR4 : Sorted list of quantities of parts shipped to Spanish customers, ordered in the last year. Fig. 3.2: Information Requirements 63
Chapter 3. Incremental Consolidation of Data-Intensive Multi-ows satisfying both requirements IR1 and IR2 , such that the reuse of the data stores and operations of DIF-1 is maximal (see Figure 3.4). We then continue and integrate the remaining requirements to create a unied multi-ow that satises all four requirements (i.e., IR1 - IR4 ), see Figure 3.7. 2.2 Preliminaries and Notation We build upon past work on ETL workow formalization [158] and model generic data ows as follows. A data-intensive ow ( DIF ) is formally dened as a directed acyclic graph consisting of a set of nodes (V), which are either data stores (DS) or operations (O), while the graph edges (E) represent a directed data ow among the nodes of the graph p v1 v2 q . We write: DIF p V , E q , such that: V DS Y O, @ e P E : Dp v1,v2 q ,v1 P V ^ v2 P V ^ v1 v2 In the rest of this chapter we use the terms 'ow' and 'graph' interchangeably, while the above formalization of a data ow holds for an individual data ow, as well as for an integrated multi-ow. Data store nodes (DS) can represent either a source data store (DS S , e.g., input DB table, le, etc.) or a result data store which in general is not necessarily materialized (DS R , e.g., output DB table, le, report, virtual cube, etc.), i.e., DS DS S Y DS R . Data store nodes are dened by a schema (i.e., nite list of attributes) and a connection to a source or a target storage for respectively extracting or loading the data. Furthermore, we formally dene a data ow operation as a quintuple: o p I,O,S, Pre , Post q •I represents a set of input schemata, where each schema (I i ) characterizes an input from a single predecessor operation and is dened with a nite set of attributes coming from that operation (i.e., I t a1, .., anI u ). This denition is generic in that it allows the arbitrary input arity of ow operations. Example. Notice in Figure 3.3 that some operations like UDF3 are unary and thus have only one input schema, while operations like Join2 are binary and expect two input schemata. l •O represents a set of output schemata, where each schema (O i ) characterizes an output to a single succeeding operation and is dened with a nite set of attributes (i.e., O t a1, .., anO u ). Example. The operations in DIF-12 of Figure 3.4 can have either a single output schema (e.g., UDF3 , Filter1 , and Aggr4 ), or as it is the case of Join2 two equivalent output schemata sending the same data to two dierent subows. l 64
2. Overview Fig. 3.3: Example data-intensive ows for IR1 and IR2 •S represents the formalization of operator's semantics, i.e., a nite set of expressions that interprets the processing semantics of an operator. Due to their inherent complexity and diversity, in order to automate the processing of data ow operations (e.g., comparison, discovery of dierent operation properties), we express the semantics of a generic data ow operation as a nite set of normalized expression trees. That is, a binary search tree, alphanumerically ordered on the expression elements (i.e., operators, function calls, variables, and constants), whilst respecting the valid order of operators when evaluating the expression. CoAl assumes that the semantics' formalization is generic, and similar formalization techniques (e.g., [189]) can be used seamlessly in our approach. Example. To express the semantics of data ow operations in DIF-1 (Figure 3.3) we build the normalized expression trees showed in Figure 3.5. l To further determine how the operations' semantics aect their interdependence in a data ow, we use a set of data ow operation properties. Relying solely on a set of algebraic properties of data ow operations (e.g., [124,158]) is not enough to take full advantage of the potential for the data ow analysis. Dierent `physio-logical' properties that can be extracted from a data ow, additionally boost the automation of the ow analysis and equivalent operation reordering. For example, such idea has been introduced for the context of optimizing generalized MapReduce data ows by extracting properties like 65
Chapter 3. Incremental Consolidation of Data-Intensive Multi-ows Fig. 3.4: Integrated data-intensive multi-ow ( IR1 - IR2 ) Fig. 3.5: Normalized expression trees (DIF-1 operations) attribute values [78]. Additionally motivated by this work, we extend and generalize the idea of having a customizable set of properties characterizing data ow operations. In this chapter, we considered the following set of operation properties: • Schema ( S ). Attributes being used, emitted, or removed by an operation. • Values ( V ). Attributes whose values are used or produced by an operation. • Order ( O ). Indicator if the order of the tuples (i.e., rows or records) in the processed dataset aects the results or is being produced by an operation. We have analyzed the applicability of these properties over the types of operations in the example ETL tools; both a commercial, i.e., Oracle Warehouse Builder (OWB 11.2), and an open source data integration (ETL) tool, i.e., Pentaho Data Integration (PDI 5.0). This analysis has showed us that these three properties cover frequently used operations, while our approach is generic and allows the extension to other categories of data processing operations as needed. Furthermore, in terms of these three properties, for each instance of a data ow operation, we dene pre- (Pre) and post-conditions (Post) of a data ow 66
2. Overview Fig. 3.6: Example data-intensive ows for IR3 and IR4 operation. Depending on the properties that an operation consumes (i.e., the results of an operation are aected by the specic value of that input property), we dene the pre-conditions of an operation as follows: Pre p Spre,Vpre,Opre q , such that: •Spre (consumed schema) is a subset of attributes of input schemata ( I ) that are used by the operation. •Vpre (consumed values) is a subset of attributes of the consumed schema ( Vpre Spre ) whose values are used by the operation. •Opre (consumed order) is a boolean indicator that species whether the results of the operation processing are aected by an order of its input dataset. Example. The UDF3 operation of DIF-1 in Figure 3.3 uses the attributes l_exprice , l_disc , and l_tax from the input (i.e., Spre t l _ exprice,l _ disc, l _ tax u ), and moreover it uses their values for computing the value of the output attribute revenue (i.e., Vpre t l _ exprice,l _ disc,l _ tax u ). On the other hand, notice that the Rename operations in DIF-2, require the attribute qrt at the input (i.e., Spre t qrt u ), while the value of that attribute is not used by these operations (i.e., Vpre H ). Likewise, the value of the revenue attribute 67
Chapter 3. Incremental Consolidation of Data-Intensive Multi-ows resulting from the UDF operation, is not aected by the order of the input dataset (i.e., Opre f alse ). l In a similar way, but now depending on the properties an operation produces (i.e., generates the specic value of that property at the output), we dene the post-conditions of a data ow operation as: Post p Spost _ gen,Spost _ rem,Vpost,Opost q , such that: •Spost _ gen (generated schema) is a nite set of new attributes that the operation generates at the output. •Spost _ rem (removed schema) is a subset of input attributes that the operation removes from the output. •Vpost (produced values) is a nite set of attributes whose values are either produced or modied by the operation. •Opost (produced order) is a boolean indicator that species whether the operation processing generates a specic order of the output dataset. Note that we need to distinguish two sets (i.e., Spost _ gen and Spost _ rem ) to specify the schema property of a post-condition in order to determine the dependency of operations in a data ow. We clarify this when discussing the generic equivalence rules in Section 3.1. Example. The operation Aggr4 of DIF-1 in Figure 3.3 modies the schema provided at the input and produces the new schema at the output, removing all the input attributes (i.e., Spost _ rem t #all u ) and generating the grouping attribute qrt and the aggregated attribute total_revenue (i.e., Spost _ gen t qrt,total _ revenue u ). Aggr4 also produces the new value for the aggregated revenue attribute and the value of the grouping attribute qrt (i.e., Vpost t qrt,total _ revenue u ), and aects the order of the output dataset (i.e., Opost true ). l For extending the set of considered physio-logical properties, an instantiation of each property must be dened both at the input (Pre) and the output (Post) of each data ow operation. If an operation type does not consume/produce a property, the corresponding instantiation is empty (or false , see the order property). Finally, notice that the Pre and Post conditions of a data ow operation provide the needed knowledge to determine the dependencies among operations when performing equivalence transformations for reordering operations in a generic data ow. We discuss this in more detail in Section 3.1. 2.3 Problem Statement We formalize the problem of the incremental data ow consolidation, by introducing the three main design operations to integrate, remove, and change a data ow. 68
4. Consolidation Algorithm Fig. 3.8: Integration of data ow operations • o A p IA,OA, S A, Pre A, Post A q o B p IB,OB, S B, Pre B, Post B q i f f IA IB ^ OA OB ^ S A S B ; • o A p IA,OA, S A, Pre A, Post A q o B p IB,OB, S B, Pre B, Post B q i f f D o B 1 p IB 1 ,OB 1 , S B 1 , Pre B 1 , Post B 1 q :IA IB ^ OA IB 1 ^ OB 1 OB ^ S B S A S B 1 ; Intuitively, we nd the equivalence (i.e., full match) of two data ow operations, if their input and output schemata coincide, while at the same time the operations dene the equivalent semantics (i.e., S A S B ). To nd the partial match between two operation oA and oB (i.e., cases (2) and (3) in Figure 3.8), we need to check if the result of one operation ( oB ) can be partially obtained from the results of another operation ( oA ), i.e., if the results of oB are subsumed by the results of oA . To this end, we look for a new operation ( o 1 B ) so that the semantics of operations oA and o 1 B can be functionally composed to imply the equivalent semantics as the operation oB and hence provide the same result dataset. Note that in general, nding the subsumption among the expressions is known to be a challenging problem. Thus for arbitrary operation expressions, we rely on the current state of the art for reasoning over the expressions and assume that they are in conjunctive normal form. 4 Consolidation Algorithm We now present the CoAl algorithm for data ow consolidation. Intuitively, the incremental advancement property dened in the previous section, requires that for solving the problem of integrating any two data ow graphs, by maximizing the reuse of their data and operations, we rst need to recursively solve the subproblems of integrating their subgraphs, starting from the data sources, and following a topological order of nodes in the graphs. Given the clear ordering and dependencies between these subproblems, we formulate the problem of integrating data-intensive ows as a dynamic pro- 75
Chapter 3. Incremental Consolidation of Data-Intensive Multi-ows gramming problem. We devise a bottom-up, iterative variant of the algorithm that eciently solves the problem in our case. In particular, CoAl starts with two data ow graphs, the referent ( DIFre f ) and the new ( DIFnew ), and proceeds following a topological order of the data ow operations in a graph, starting from the matched leaf (source) nodes. CoAl iteratively searches larger matching opportunities between their operations by applying the generic equivalence rules (Section 3.1), hence considering reordering without modifying the semantics of the involved data ows. At each iteration, CoAl compares two operations (one from each data ow), and continues only if a full match is found (Section 3.2). This guarantees the following two invariants: (I 1 ): At each step, only one pair of operations of referent and new data ows can be partially or fully matched. (I 2 ): A new match is added to the set of matched operations if and only if the operations themselves match and their input ows have been previously fully matched. In addition, when searching for next operations to match, the following invariant must also hold: (I 3 ): An operation can be reordered to be matched next, if and only if such reordering does not change the semantics (i.e., output) of a data ow. The consequence of these invariants is that a pair of matched operations is eventually consolidated in the output, integrated multi-ow, if the ows they belong to can be reordered so that their children are fully matched. Thus, the correctness of the CoAl algorithm, in the sense that it integrates input data ows without aecting their outputs, is guaranteed by the three characteristics of the algorithm i.e., operation comparison, incremental advancement, and equivalent operation reordering discussed in Section 3, and demonstrated respectively with the invariants I 1 , I 2 , and I 3 . Example. We illustrate dierent steps of CoAl, using the scenario of integrating data ow DIF-3 (Figure 3.6), into the referent DIF-12 multi-ow (Figure 3.4). l In general, CoAl comprises four phases (see Algorithm 1): i) search for the next operations to match; ii) compare the next operations; iii) reorder input data ows if a match has been found; and iv) integrate the solution with the lowest estimated cost. The rst three phases are executed in each iteration of CoAl, while the last one is executed once, when no matching possibility is left. Before detailing the four phases, we present the main structures maintained by CoAl while looking for the nal consolidation solution. 1. matchQ: A priority queue that contains pairs of referent and new data ows with currently overlapping areas which can be potentially extended with new matching operations. matchQ :: matchDIFPair,matchQ | matchDIFPair; 76
4. Consolidation Algorithm Algorithm 1 CoAl inputs: DIF ref , DIF new ; output: DIF int 1: altList := { r [DIF ref ,DIF new , H , H ],cost noInt s }; no int. alternative 2: matchQ := matchLeafs(DIF ref ,DIF new ); 3: while matchQ H do 4: matchDIFPair[DIF 1 ref ,DIF 1 new ,allMatches,lastMatches] := dequeue(matchQ); 5: [matchOpsPair[o re f ,o new ],edge ref ] := dequeue(lastMatches); 6: nextOps ref := ndNextForMatch(DIF 1 ref ,o ref ,edge ref ); Algorithm 2 7: nextOps new := ndNextForMatch(DIF 1 new ,o new ,edge o 1 new ); Algorithm 2 8: for all pair(o 1 ref P nextOps ref , o 1 new P nextOps new ) do 9: if o 1 ref o 1 new _ o 1 ref o 1 new _ o 1 new o 1 ref then 10: DIF 2 ref := reorder(DIF 1 ref ,o 1 ref ,o ref ); 11: DIF 2 new := reorder(DIF 1 new ,o 1 new ,o new ); 12: insert(allMatches, [[o 1 ref ,o 1 new ],intInfo]); 13: if o 1 ref o 1 new then full match 14: for i:=1 to deg(o 1 ref ) enqueue(lastMatches, [[o 1 ref ,o 1 new ],edge ref i ]); 15: enqueue(matchQ, [DIF 2 ref ,DIF 2 new ,allMatches,lastMatches]); 16: else if o 1 ref o 1 new _ o 1 new o 1 ref then partial match 17: if lastMatches H then no further matchings avail. 18: insert(altList, [[DIF 2 ref ,DIF 2 new ,allMatches,lastMatches],cost 2 ]); 19: else 20: enqueue(matchQ, [DIF 2 ref ,DIF 2 new ,allMatches,lastMatches]); 21: end if 22: end if 23: end if 24: end for 25: if no matching found then 26: if lastMatches H then no further matchings avail. 27: insert(altList,[[DIF 1 ref ,DIF 1 new ,allMatches,lastMatches],cost 1 ]); 28: else 29: enqueue(matchQ, [DIF 1 ref ,DIF 1 new ,allMatches,lastMatches]); 30: end if 31: end if 32: end while 33: bestAlt := ndMin(altList); 34: DIF int := integrate(bestAlt); 77
Chapter 3. Incremental Consolidation of Data-Intensive Multi-ows 2. altList: A list of all alternative solutions ending up in a partial or full overlapping of two data ows (referent and new), together with the estimated costs of such consolidation solution. altList :: [matchDIFPair,cost], altList | r matchDIFPair, cost s ; Each element of matchQ and altList contains information of integrated data ows, i.e., matchDIFPair :: r DIFre f ,DIFnew,allMatches,lastMatches s ; • A pair of data ows ( DIFre f and DIFnew ), potentially reordered for such integration. • Pairs of pointers to all matched operations (allMatches), with information about the matching type and integration (intInfo). allMatches :: r matchOpsPair, intInfo s ,allMatches | r matchOpsPair, intInfo s ; • A queue with pairs of pointers to the last matched operations (lastMatches), and an out-edge in a referent graph ( edgere f ). lastMatches :: r matchOpsPair,edgere f s ,lastMatches | r matchOpsPair,edgere f s ; matchOpsPair :: r ore f ,onew s ; CoAl rst initializes the list of alternative solutions by adding the alternative with no integration of DIFnew and DIFre f , together with the cost of having these two data ows separately, i.e., costnoInt (Step 1). CoAl then starts by searching for the matching leaf (source) nodes of new and referent data ows (i.e., matchLeafs, Step 2). The source data stores are compared based on their main characteristics, i.e., source type, source name or location, and extracted attributes. CoAl initializes matchQ with the pair of the referent and new data ows, together with the found matching pairs of source data stores (i.e., initially both allMatches and lastMatches). Example. When integrating DIF-3 (Figure 3.6), into the referent ow, i.e., DIF-12 (Figure 3.4), we rst identify common source nodes of the two data ow graphs (i.e., orders and lineitem ). l The four phases of CoAl are as follows: i) Search for the next operations to match. At each iteration, we consider extending a single pair of currently overlapping data ows from the priority queue (matchQ) with a new pair of matching operations. For a dequeued pair of data ows (i.e., dequeue, Step 4), we identify the operations in these ows to be compared next, starting from a pair of previously identied full matches (i.e., ore f and onew dequeued from lastMatches; dequeue, Step 5). Finding operations to be compared next in both data ows is performed by means of two calls to the function FindNextForMatch (i.e., Algorithm 2) 78
4. Consolidation Algorithm Algorithm 2 FindNextForMatch inputs: DIF, o cur , out-edge; output: nextOps 1: nextOps := H ; 2: for all path P ndPathsToForks(DIF, o cur , out-edge) do 3: for i:=1 to length(path) do 4: if canReorder p path,i q^ fulllsI2 p path r i sq then 5: insert( nextOps ,path[i]); 6: end if 7: end for 8: end for 9: return nextOps ; in steps 6and 7). In FindNextForMatch we apply the generic equivalence rules explained in Section 3.1, and nd the operations that can be pushed down towards the last fully matched operations, thus fullling I2 (i.e., can- Reorder and fulllI2, Step 4in Algorithm 2). Notice that we search until we reach the operation that has multiple outputs (i.e., ndPathsToForks, Step 2), since swapping operations down a fork would aect the semantics of other branches in a data ow. Example. For the fully matching nodes orders , of DIF-12 and DIF-3, we nd the following sets of operations to be compared next: ordersDIF 12 = { Filter1 , Join2 }; ordersDIF 3 = { Filter1 , Join3 , Join4 }. l ii) Compare the next operations. CoAl then compares each pair of operations from the previously produced sets (i.e., nextOpsre f and nextOpsnew ), using the comparison rules discussed in Section 3.2. Depending on the result, it identies: (a) a full match, o 1 re f o 1 new (Step 2a); (b) a partial match, o 1 new o 1 re f _ o 1 re f o 1 new (Step 16) or (c) no match, o 1 re f o 1 new . Example. From the two sets of operations that can be compared next, we nd two full matches between Filter1 (DIF-12) and Filter1 (DIF-3), and Join2 (DIF-12) and Join4 (DIF-3). l It may also happen that no matching is found for any pair of operations (Step 25). iii) Reorder the input data ows. If CoAl nds a (full or partial) match, it proceeds (if needed) with operation reordering to align the input data ows and enable integration of the previously matched operations, i.e., to satisfy I2 , (i.e., reorder, steps 10 and 11). Example. Following the above example, for the full match of the Filter operations in DIF-12 and DIF-3, no additional operation reordering is necessary and CoAl directly adds Filter1 to the current maximum overlapping area (i.e., I2 is satised). But, for the full match between Join2 (DIF-12) and Join4 (DIF-3), CoAl must perform operation reordering (i.e., (re-)associate Join4 down Join3 in DIF-3), so that the Join4 operation could be matched next ( I2 ). l 79
Chapter 3. Incremental Consolidation of Data-Intensive Multi-ows CoAl then extends the overlapping of input data ows with matching pair of operations to allMatches, together with their integration information (i.e., insert, Step 12). Next, based on the type of the previously found match, CoAl proceeds as follows: • For a full match, it enqueues back to priority queue the two data ows (possibly reordered) to further extend the matching in the next iterations (i.e., enqueue, Step 15), starting from the last matched pair of operations added (i.e., lastMatches). Notice that CoAl needs to enable the search in all possible output branches of the referent data ow, thus we enqueue back the currently matched operations once for each of the next out-edges to be followed from the previously matched operations (see Step 14). • For a partial match, if there are no other previously matched operations from which it can extend matching (Step 17), CoAl estimates the cost of the current solution and inserts it, along with its cost, to the list of alternatives (Step 18). Otherwise, it enqueues back to matchQ the two data ows to further extend the matching in other branches. (i.e., enqueue, Step 20). Similarly, if no match is found (Step 25), this solution along with its estimated cost is also added to the list of potential alternatives only if it is not possible to further extend the matching. Example. In the given example (i.e., DIF-3 and DIF-12), this occurs after we match the join operations (i.e., Join2 from DIF-12 and Join4 from DIF-3). Going further in data ows DIF-12 and DIF-3, we cannot nd any matching operation that can enlarge the common areas of these two data ows. Thus, we add the currently matched data ows as an alternative solution, resulting in an integrated multi-ow branching after the matched join operation (i.e., Join3;{1-4} in Figure 3.7) l Otherwise, CoAl continues matching in other branches (i.e., Step 29). The algorithm nishes the matching process when all operations of input data ows are explored and compared (i.e., no more elements in the matchQ). iv) Integrate an alternative solution. After all iterations nish, CoAl analyzes the list of the found alternatives, looks for the one with the lowest estimated cost (i.e., ndMin, Step 33), and integrates it using the integration information (i.e., integrate, Step 34). Finally, CoAl returns the integrated multi-ow (i.e., DIFint ). 80
4. Consolidation Algorithm 4.1 Computational complexity To integrate a referent ( DIFre f p Vre f ,Ere f q ) and a new ( DIFnew p Vnew,Enew q ) data ow, the CoAl algorithm at rst glance indicates at worst quadratic complexity (in terms of | Vre f | | Vnew | ), due to the Cartesian product of operations that can be compared next (see Step 8). However, there are several characteristics that either directly from the invariants of the CoAl algorithm or from empirical experiences show that this is not a realistic upper bound of the algorithm. • Under the assumption that input data ows are compact in terms that they do not have redundant operations (i.e., operations of a single ow that can be fully matched; see Section 3.2), it is impossible that multiple alternative paths branching from a single operation in a multi-ow completely match with a path of another data ow. • The search is led by the size of paths in the new data ow (i.e., | pnew | avg ), which is typically shorter than the paths in the referent data ow. • When searching next operations to compare (i.e., Algorithm 2), due to conicting dependencies among operations (see Section 3.1), it is also unrealistic that all the operations in the paths of encompassing requirement subgraphs can be reordered to be compared next, which drastically reduces the actual number of comparisons inside the loop. We further analyze the complexity of the CoAl algorithm based on the search space of the algorithm while looking for the next operations to match. That is, we take into account the number of the main loop iterations (see Step 3in Algorithm 1), and for each loop, the number of operations searched to be compared next in each loop (see Algorithm 2). While the cost of Algorithm 2 for a new data ow in bounded by the maximal size of new data ow graphs, the cost for a referent one grows iteratively as the size of the data ow graph grows, hence we take the latter one into account when estimating the complexity of the CoAl algorithm. Additionally, notice that the number of the main loop iterations (Step 3) depends on the number of elements previously enqueued to the matchQ and lastMatched, which occurs only when we nd a full match between two data stores or two operations (see steps 2and 2a in Algorithm 1). In the worst case for the complexity, we can nd a full match for all operations in a path of a new data ow, i.e., the path is completely subsumed by the referent ow. We start by estimating the number of iterations of the main loop. The complexity for a single path of new data ow (i.e., pnew ) can be obtained as follows: c p pre f int pnew q ° | pnew | i 1deg p ore fi q l 81
Chapter 3. Incremental Consolidation of Data-Intensive Multi-ows If we consider an average outdegree of a referent data ow graph (i.e., degavg p DIFre f q ): c p pre f int pnew q ° | pnew | i 1deg p ore fi q| pnew | avg degavg p DIFre f q l Furthermore, CoAl performs such search for all paths starting from the previously matched source data stores, i.e., maximally for | DS newS | | DS re fS | paths. c1 p DIFre f int DIFnew q c1 = | DS newS | | DS re fS | | DS newS | | pnew | avg degavg p DIFre f q l Using graph theory, we can further represent the average outdegree of a directed graph (i.e., DIFre f p Vre f ,Ere f q ) as | Ere f | | Vre f | . At the same time, the average length of a source-to-target path | pnew | avg can be obtained as the average depth of a new graph. Assuming that a graph resulting from a single information requirement is a tree, and the tree is balanced, we can obtain its depth as log | Enew | | Vnew || DS newS | | DSnewS | . That is: c1 | DS newS | | DS re fS | | DS newS | p log | Enew | | Vnew || DS newS | | DS newS |q | Ere f | | Vre f | l Next, for each loop, we estimate the complexity of searching for the next operations to compare in the referent data ow graph. Starting from a pair of last matched operations, we search in all paths, and identify the next operations that are candidates to be reordered and compared next (see Algorithm 2). Such search in general resembles the tree traversal with the last matched operation as a root and target data stores as leaf nodes. We estimate the size of such tree and thus the complexity of its traversal with the average depth of a tree (i.e., the average length of a source-to-target path), multiplied by the average outdegree of the graph. Again, based on the graph theory, we can express such estimations in terms of the size of a referent data ow graph. That is: c2 depthavg p DIFre f q degavg p DIFre f qp log | Ere f | | Vre f || DS re fR | | DS re fS |q | Ere f | | Vre f | l Thus, we estimate the complexity of the algorithm as: cint c1 c2 = p| DS newS | | DS re fS | | DS newS | p log | Enew | | Vnew || DS newS | | DS newS |q | Ere f | | Vre f | q pp log | Ere f | | Vre f || DS re fR | | DS re fS |q | Ere f | | Vre f | q l Assuming that the average size (i.e., | Enew | , | Vnew | ) and the number of source data stores (i.e., | DS newS | ) in a new data ow is constant, the theoretical complexity for the problem of integrating data ows can be given as a function of the size of the referent data ow (i.e., | Ere f | ), the number of its data sources (i.e., | DS re fS | ), and its average outdegree (i.e., | Ere f | | Vre f | ). 82
5. Evaluation 5 Evaluation 5.1 Prototype CoAl works at the logical level and integrates data ows coming from either high level business requirements (e.g., [146]) or platform-specic programs (e.g., queries, scripts, ETL tool metadata; [93]). We built a prototype that implements the CoAl algorithm. The prototype is integrated into a larger ecosystem for the design and deployment of data ows from information requirements [90]. Communication with dierent external modules of the ecosystem for import/export of data ows is enabled using a platform-independent representation of a data ow, namely xLM (i.e., XML encoding of data ow metadata [160]). Data ows in other languages could be translated to/from xLM using external tools (e.g., [92]). 5.2 Experimental setup We selected a set of 15 data ows, translated from the referent TPC-H benchmark queries 3 . Notice that even though the TPC-H benchmark provides a relatively small set of input queries, such set covers dierent sizes and complexities of input data ows and suces to demonstrate the functionality of the CoAl algorithm. Thus the obtained results are generalizable to other inputs. CoAl's exibility to deal with dierent complexities of data ow operations is previously showed in sections 2and 3. Considered data ows (similar to those presented in Section 2), span from only 4 to the maximum of 20 operations, performing various data transformations, i.e., lters, joins, projections, aggregations, user dened functions. More information about the selected queries can be found in the TPC-H specication [5]. We translated the selected SQL queries, into the platform-independent representation that CoAl understands (i.e., xLM). To cover a variety of input scenarios (i.e., dierent orders in which input data ows are provided), we have considered dierent permutations of incoming data ows. Since the total number of dierent permutations for the chosen 15 queries is not tractable (i.e., 15!, ¡ 1307 billions), we have randomly sampled, a uniformly distributed set of 1000 permutations and obtained the average values of the observed numbers. For each permutation, we have simulated the incremental arrival of input data ows, starting by integrating the rst 2 data ows, and then incrementally adding the other 13. 3 Selected TPC-H queries: q1, q2, q3, q4, q5, q6, q9, q10, q11, q13, q16, q17, q18, q19, q21. Other queries are discarded due to limitations of the available external SQL translation module. 83
Chapter 3. Incremental Consolidation of Data-Intensive Multi-ows Fig. 3.9: Search space exploration Fig. 3.10: CoAl's execution time 5.3 Scrutinizing CoAl We rst analyzed the distribution of the values obtained in the considered sample of permutations. For all of them we conrmed a positive (right) skew, which indicated the stability of our data ow integration algorithm. Thus, in the reminder of this section, we report the mean values obtained from the considered permutations. Search Space. As shown in Figure 3.9 ( Real complexity ), the search space (i.e., # states refers to the complexity in Section 4.1) grows linearly with the number of input data ows. For input ows of an average size of 15 operations, the number of states considered starts from only several when integrating 2 data ows and go up to the maximum of 170 states when integrating the 15th data ow (Figure 3.9 reports the average values). We additionally estimated the theoretical computational complexity of CoAl for given inputs, following the formula in Section 4.1 and compared it to the obtained real values (see Theoretical complexity (formula estimated) in Figure 3.9). We observed that the overestimation and a slight deviation of the tendency of the formula estimated complexity comes from the generalizations adopted for estimating the average depth and the degree of a data ow graph. Fitting the formula with the average values directly computed in the execution (see Theoretical complexity (formula computed) in Figure 3.9), showed the co- Fig. 3.11: Space/time correlation 84
Chapter 4 A Requirement-Driven Approach to the Design and Evolution of Data Warehouses The paper has been published in the Journal of Information Systems, Volume 44: pp. 94-119 (2014). The layout of the paper has been revised. DOI: http://dx.doi.org/10.1016/j.is.2014.01.004 Elsevier copyright/ credit notice: © 2014 Elsevier. Reprinted, with permission, from Petar Jovanovic, Oscar R- omero, Alkis Simitsis, Alberto Abello, Daria Mayorova, A requirement-driven approach to the design and evolution of data warehouses, Information Systems Volume:44, August/2014 Abstract Designing data warehouse (DW) systems in highly dynamic enterprise environments is not an easy task. At each moment, the multidimensional (MD) schema needs to satisfy the set of information requirements posed by the business users. At the same time, the diversity and heterogeneity of the data sources need to be considered in order to properly retrieve needed data. Frequent arrival of new business needs requires that the system is adaptable to changes. To cope with such an inevitable complexity (both at the beginning of the design process and when potential evolution events occur), in this chapter we present a semi-automatic method called ORE, for creating DW designs in an iterative fashion based on a given set of information requirements. Requirements are 91
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses rst considered separately. For each requirement, ORE expects the set of possible MD interpretations of the source data needed for that requirement (in a form similar to an MD schema). Incrementally, we build the unied MD schema that satises the entire set of requirements and meet some predened quality objectives. We have implemented ORE and performed a number of experiments to study our approach. We have also conducted a limited-scale case study to investigate its usefulness to designers. 1 Introduction Data warehousing ecosystems have been widely recognized to successfully support strategic decision making in complex business environments. One of their most important goals is to capture the relevant organization's data provided through dierent sources and in various formats with the purpose of enabling analytical processing of such data. The most common design approach suggests building a centralized decision support repository (like a DW) that gathers the organization's data and which, due to its analytical nature, follows a multidimensional (MD) design. The MD design is distinguished by the fact/dimension dichotomy, where facts represent the subjects of analysis and dimensions show dierent perspectives from which the subjects can be analyzed (e.g., we can analyze shopping orders for customers and/or suppliers). Furthermore, the design of the extract-transform-load (ETL) processes responsible for managing the data ow from the sources towards the DW constructs, must also be considered. Complex business plans and dynamic, evolving enterprise environments often result in a continuous ow of new information requirements that may further require new analytical perspectives or new data to be analyzed. Due to the dynamic nature of the DW ecosystem, building the complete DW design at once is not practical. Also, assuming that all information and business requirements are available from the beginning and remain intact is not realistic either. At the same time, for constructing a DW design (i.e., its MD schema) the heterogeneity and relations among existing data sources need to be considered as well. The complexity of the monolithic approach for building a DW satisfying all information requirements has also been largely characterized in the literature as a stumbling stone in DW projects (e.g., see [97]). As a solution to this problem, a step-by-step approach for building a DW has been proposed in [97] (a.k.a. Data Warehouse Bus Architecture). This approach starts from data marts (DM) dened for individual business processes and continues exploring the common dimensional structures, which these DMs may possibly share. To facilitate this process, a matrix as the one shown in Table 4.1 is used, which relates DMs (i.e., their subsumed business requirements) to facts and dimen- 92
1. Introduction Table 4.1: The DW Bus Architecture for IR1-IR5 Customer Supplier Nation Region Orders Part Partsupp Lineitem_dim ship. qty.(IR1) ` ` ` ` ` prot(IR2) ` ` ` revenue(IR3) ` ` ` ` ` avil. stock val.(IR4) ` ` ` ship. prior.(IR5) ` ` ` sions implied by each DM. Such matrix is used for detecting how dimensions (in columns) are shared among facts of dierent DMs (in rows), i.e., if a fact of a DM in the row x is analyzed from a dimension of the column y , there is a tick in the intersection of x and y . The content of the matrix in Table 4.1 follows our running example based on the TPC-H benchmark [5], which is introduced in more detail in Section 2. We consider ve information requirements (i.e., IR1-IR5) and for each of them a single DM. Each requirement analyzes some factual data (e.g., IR3 analyzes the revenue ), from dierent perspectives (e.g., revenue is analyzed in terms of parts i.e., partsupplier-part hierarchy , and supplier's region i.e., supplier-nation-region hierarchy). Finally, based on this matrix, dierent DMs are combined into an MD schema of a DW. However, such design guidelines still assume a tremendous manual eort from the DW architect and hence, DW experts still encounter the burdensome and time-lasting problem of translating the end-user's information requirements into the appropriate MD schema design. Automating such process has several benets. On the one hand, it supports the complex and time-consuming task of designing the DW schema. On the other hand, results automatically produced guarantee that the MD integrity constraints [114] are met as well as some DW quality objectives used to guide the process [147]. Accordingly, several works tried to automate the process of generating MD schemas (e.g., [168,131,142]). However, for the sake of automation, these approaches tend to overlook the importance of information requirements and focus mostly on the underlying data sources. Such practices require an additional manual work in conforming the automatically produced MD designs with the actual user requirements, which often does not scale well for complex scenarios. For example, it has been shown that even for smaller data source sizes the number of potential stars produced by means of a blind search of MD patterns over the sources is huge [142]. Consequently, it is not 93
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses feasible to assume that the DW architect will be able to prune and lter such results manually. To the best of our knowledge only three works went further and considered integrating the information requirements in their semi-automatic approaches for generating MD models [69,115,146]. At dierent levels of detail, these approaches support transforming every single requirement into an MD model to answer such requirement. However, how to integrate such individual MD models into a single, compact MD view is left to be done manually (although [69,115] introduce strict manual guidelines in their approaches to assist the designer). Our experiments, described in Section 5, have shown that integrating MD requirements, is not an easy task and this process must also be supported by semi-automatic tools. In this chapter, we present a semi-automatic method for Ontology-based data warehouse REquirement-driven evolution and integration (ORE). ORE complements the existing methods (e.g., [168,131,142]) and assists on semiautomatically integrating partial MD schemas (each representing a requirement or a set of requirements) into a unied MD schema design. Moreover, ORE could also be used to integrate existing MD schemas of any kind (e.g., as in [68]). ORE starts from a set of MD interpretations (MDIs) of individual requirements (which resemble the rows of Table 4.1). Intuitively, an MDI is an MD characterization of the sources that satises the requirement at hand (see Section 2.2 for further details). Iteratively, ORE integrates MDIs into a single MD schema which satises all requirements so far. Importantly, ORE generates MD-compliant results (i.e., fullling the MD integrity constraints) and determines the best integration options according to a set of quality objectives, to be dened by the DW designer. To guarantee so, ORE systematically traces valuable metadata from each integration iteration. In all this process, the role of the data sources is crucial and ORErequires a characterization of the data sources in terms of a domain ontology, from where to automatically explore relationships between concepts (e.g., synonyms, functional dependencies, taxonomies, etc.) by means of reasoning. Our method, ORE, is useful for the early stages of a DW project, where we need to create an MD schema design from scratch, but it can also serve during the entire DW lifecycle to accommodate potential evolution events. As we discuss later on, in the presence of a new requirement, our method does not create an MD design from scratch, rather it can automatically absorb the new requirement and integrate it with the existing MD schema so far. Contributions. The main contributions of our work are as follows. • We present a semi-automatic approach, ORE, which, in an iterative fashion, deals with the problem of designing a unied MD schema from a set of information requirements. • We introduce novel algorithms for integrating MD schemata, each sat- 94
2. Overview of our Approach isfying one or more requirements. Results produced are guaranteed to subsume all requirements so far, preserve the MD integrity constraints, and meet the user dened quality objectives. • We introduce the traceability metadata structure to systematically record information about the current integration opportunities both for nding the best integration solution w.r.t. the chosen quality objectives and linking the nal MD schema to the data sources by means of ETL processes. • We experimentally evaluate our approach by using a prototype. A set of empirical tests have been performed to assess the output correctness, a characterization of ORE's internal algorithms and the manual eort for providing an integrated MD design from several requirements and in turn, demonstrate the need for automated design approaches like ORE. Outline. The rest of this chapter is structured as follows. Section 2presents an abstract overview of our approach through an example case based on the TPC-H schema [5]. Sections 3and 4formally present the main structures and stages our method goes through for integrating new information requirements into a unied MD schema. In Section 5we provide the theoretical validation of our approach, while Section 5presents the experimental evaluation of ORE (both of its internals and from the end-users perspective). Section 6dis- cusses the related work, while Section 8concludes the chapter and discusses our future directions. 2 Overview of our Approach In this section, we rst introduce an example case based on the TPC-H schema and formalize the notation used throughout the chapter. Then, we present the overview of our solution to semi-automatically create an MD schema from a set of information requirements. 2.1 Running example Our example scenario is based on the schema provided by the TPC-H benchmark [5]. The abstraction of the schema is illustrated in Figure 4.1. The TPC-H is a decision support benchmark which, besides the schema, also provides a set of business oriented queries (from here on, information requirements - IR). For the sake of our example, let us assume a subset of ve information requirements, which are the following: • IR1: The total quantity of the parts shipped from Spanish suppliers to French customers. 95
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses Fig. 4.1: TPC-H Schema • IR2: For each nation, the prot for all supplied parts, shipped after 01/ 01/2011. • IR3: The total revenue of the parts supplied from East Europe. • IR4: For German suppliers, the total available stock value of supplied parts. • IR5: Shipping priority and total potential revenue of the parts ordered before certain date and shipped after certain date to a customer of a given segment. 2.2 Formalizing Information Requirements In this section, we describe how information requirements are formalized in order to be automatically processed. Requirements posed during the DW project lifecycle dier from usual user requirements in other software projects in that they typically have analytical avor. For this reason, it has been previously discussed that information requirements can be elegantly represented in terms of the MD model as data cubes (e.g., see [69,145]), and they are usually elicited with natural language template similar to the following one: I want to analyze fact (e.g., revenue or prot) from dimensions (e.g., time, customer) where descriptors (e.g., previous year). This is a straightforward enunciation of the cube-query metaphor [97] in natural language, which distinguishes two basic kinds of concepts, namely dimensional and factual concepts. Thus, from an information requirement we can extract two kinds of information: (1) which data the user wants to analyze (i.e., factual data) and (2) from which perspectives (i.e., the multidimensional space conformed by the dimensions of analysis), which may contain descriptors (i.e., dimension attributes). We further formalize the data cube in terms of a grammar, which 96
2. Overview of our Approach can be conveniently used to serialize the content such as textual requirements or MD interpretations in a machine readable form (e.g., XML, JSON, etc.). In the domain that is being analyzed, we can identify the concepts that retrieve the data asked by the requirement, i.e., domain_concept . Fact ( F ) is the core MD concept in the domain and represents the focus of the analysis. It usually contains a set of numerical measures ( M ), e.g., revenue, quantity, extended price, which can be analyzed and aggregated from dierent perspectives (dimensions), using the appropriate aggregation functions ( AggFunc ), e.g., SUM , AVERAGE , MAX . Additionally, numerical measures can be derived by applying arithmetic operations ( ArithmOp ) or built-in functions ( DFunc ) over basic measures. Formally: DFunc := 'sqrt'|'abs'|...; AggFunc := 'SUM'|'AVG'|'COUNT'|'MEDIAN'|...; ArithmOp := '+'|'-'|'/'|'x'|...; Expr := Expr,ArithmOp,M|M; M := DFunc(M)|Expr| domain _ concept ¡ ; F := AggFunc(F)|M; The multidimensional space ( S ) is determined by the analysis dimensions (i.e., S = D1 ... Dn ). Each dimension ( D ) represents a perspective from which we analyze facts. In general, a single dimension consists of a hierarchy of partially ordered set ( ) of levels ( L ). In a data cube, dimensions appear at a given level of detail (a.k.a. dimension level). Note that a meaningful cube can only refer to a single level per dimension. A function ( EFunc ) can be applied on levels to extract additional or normalized information -e.g., month('2001-09-28 01:00:00') would return '09'. Additionally, descriptors ( Dsc ) may be dened over the dimension levels and used inside of logic predicates, -e.g., 'year = 2012'-. Note that the literal in the following grammar rules stands for any numerical or textual constant value. Formally: Oper := '>'|'<'|'>='|'<='|'='|'!='|'IN'|'MATCHES'|...; EFunc := 'day'|'month'|...; Dsc := Operand, Oper, Operand; Operand := L| literal ¡ ; L:= domain _ concept ¡ |EFunc(L)|Dsc; D := D L|L S := S D|D Given the above formalizations, we represent an information requirement or data cube ( IR ) as a fact ( F ) and (at least) one dimension (usually a list of dimensions), conforming its multidimensional space. Formally: 97
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses IR := F,S; Various approaches have tackled the issue of modeling the MD data cube for each requirement at hand. Basically, they identify the needed data sources' subset that retrieves the data to answer each IR (intuitively a query) and map it into an MD interpretation (i.e., assign MD roles to each concept in the subset) to guarantee its compliance with the MD model. Eventually, they conform MD schemas answering all the requirements. Each of these methods makes dierent assumptions and achieves dierent degrees of automation but, to our knowledge, only three of them largely automate the process of identifying, for each requirement, the MD cube that answers such requirement [69,115, 146]. However, none of these provides automatic means to integrate several requirements into a single MD schema. ORE starts from the MD knowledge extracted from each requirement (e.g., by means of any of the previously mentioned MD schema design approaches) and aims to incrementally derive a unied MD schema satisfying the entire set of requirements. For the purpose of formalizing our approach, we dene here the notion of MD interpretation, regardless of the approach used to obtain these MD interpretations. An MD interpretation (MDI) represents a subset of the data sources' concepts placed in a valid MD space that answers the IR at hand. Thus, an MDI can be formally dened as a tagged graph, meeting IR and satisfying MD integrity constraints, such as MDI p V,E,role :V Ñ IR t L,F uq such that MDI ( MDic where V is the set of nodes, corresponding to source concepts, and E , the set of edges representing the associations between these concepts at the sources. Note that for a single MDI, Ñ IR is a complete function and thus each node ( V ) plays an MD role according to IR (i.e., it is either a level or a fact, see the grammar introduced above). Additionally, the arrangement of nodes ( V ) and edges ( E ) in an MDI must satisfy the MD integrity constraints ( MDic ). Consequently, ORE relies on the previous approaches and assumes MDIs that are sound (i.e., that satisfy the MD integrity constraints) and complete (i.e., that satisfy the requirement at hand). Following the work in [141], we dene here the MD integrity constraints that need to hold in order to satisfy both the soundness and completeness of the input MDIs. • Information requirements. Information requirements ( IR ) are expected to have an analytical layout, i.e., having the subject of the analysis (fact) and the perspectives from which the subject is analyzed (dimensions). Such requirements resemble the natural language template provided earlier in this section. 98
2. Overview of our Approach • The multidimensional space arrangement. The dimensions of a requirement must arrange the MD space in which the factual data of a requirement is depicted, i.e., each instance of factual data is identied by a point in each of its analysis dimensions. • The base concept. A minimal set of levels which functionally determine a fact must guarantee that given a point in each of the dimensions, such set of points determines one and only one instance of factual data. • Data summarization. Data summarization must be correct which is ensured by applying necessary conditions for summarization, discussed in [114]: (1) Disjointness (the sets of objects to be aggregated must be disjoint); (2) completeness (the union of subsets must constitute the entire set); and (3) compatibility of the dimension, the type of measure being aggregated and the aggregation function. Furthermore, an MDI contains two kinds of concepts. Those explicitly demanded in the input requirement and those implicitly needed to properly relate the explicitly demanded concepts in order to produce a single cube. Thus, the latter depend on the data sources implementation and do not appear in IR . From here on, we refer to them as intermediate concepts. It is worth noting that initially, intermediate concepts may not have a strict MD role associated with them. Therefore, considering the potential ambiguity of business requirements and the diversity of the underlying associations in the data sources, several MDIs may result from a single requirement (each of them, capturing dierent semantics) [141]. We write MDI IR to refer to the set of all MDIs satisfying IR.In [146], we describe our approach to generate and validate such set of MDIs per requirement (as the ones shown in Figure 4.2). However, ORE aims to be robust enough to process any valid MD cube-like form (i.e., respecting the fact/dimension dichtonomy) generated manually or automatically from information requirements through any of the current approaches available in the literature. In fact, the only modication needed to couple another approach to ORE would be to serialize its output into the propriety format that ORE can automatically process. Example. Each requirement, dened at the beginning of Section 2(i.e., IR1-IR5), gives rise to a set of one or more MDIs (see Figure 4.2). Levels are depicted with white, and facts with gray boxes. The attributes of levels or facts are placed inside the corresponding boxes. The empty levels or facts (i.e., the boxes without any attributes) represent intermediate concepts and in the case their MD knowledge is ambivalent (i.e., either playing a factual or dimensional role, the MD integrity constraints are preserved) they are depicted as both level and fact. Consider now IR3, in plain text, and the MDIs produced for that requirement. There, we distinguish between concepts ex- 99
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses plicitly demanded (i.e., revenue, parts , and region name ) and intermediate concepts (i.e., partsupplier , and nation ).In this case, although nation is intermediate concept, its role is set to dimensional as to preserve the MD integrity constraints. However, partsupplier remains as an ambivalent concept since its MD interpretation has not been explicitly set in the requirement and cannot be unequivocally inferred without further information (either as factual or dimensional data the MDI satises the MD integrity constraints). Similarly, three out of the ve requirements in our example (IR1, IR2 and IR3) contain ambivalent concepts and thus, they produce several MDIs (e.g., IR3 would produce two, one where partsupplier plays a factual role and thus, it can be used to nd measures of potential interest, and another one where it plays a dimensional role and consequently, it is used as an analysis perspective). l 2.3 Formalizing the Problem MDIs, by themselves, cannot serve as a nal MD schema. Each of them answers a single requirement (i.e., cube-query) and may show unnecessary information (e.g., intermediate concepts may be of no interest at all and only be relevant for the ETL process). Intuitively, starting from a set of input requirements (each of them represented as an MDI IR ) and the data sources, the problem at hand looks for overlapping subsets of the input MDIs such that produce a single MD schema and meet some quality objectives. Thus, we start from t MDI IR i | i 1..m u and following an iterative approach, we derive the unied MD schema satisfying the complete set of requirements. In order to lead the integration process, ORE uses a cost model ( CM ) which is dened with a set of parametric cost formulae ( CF ) that evaluate some DW quality factors ( QF ) (e.g., structural complexity). A cost model together with its formulae is a parameter of ORE and can be alternatively customized by the designer to consider other quality factors (e.g., see [154]). Without loss of generality, and for the sake of presentation, we assume that the resulting unied MD schema is a set of star schemas ( SS ) where each star may answer one or more requirements. Similar to MDIs, we dene SS as follows: SS p V,E,role :V Ñ IR1...IRm t D1, . . . , Dn,F uq , such that SS ( MDic q Where m is the number of input requirements and n the number of dimensions in the output. This denition is similar to that of MDI, but guarantees that the MD role assigned to each node honors all the input requirements (i.e., Ñ IR1,...,IRm ). Moreover, an MD schema, unlike a data cube, contains dimension hierarchies, which correspond to sets of levels with a partial, strict order ( ) between them (e.g., nation region). Next, we search for a set of star schemas ( SS ) such that 100
3. Traceability Metadata Fig. 4.6: TM conceptual model Additionally, we keep the metadata about the cost model being used and w.r.t. the cost model, we produce and store a cost-based space of alternative solutions (i.e., 4). TM also assists ORE to respond to dierent changes that may occur during the DW lifecycle and to accordingly adapt the MD design of a DW to support such changes. TM stores the following information (1-4 in Figure 4.6): 1. Requirement-related metadata. As discussed in Section 2.2, IRs are represented as MDIs, which are modeled as tagged graphs. For this reason, it is mandatory that every MDINode is tagged with an MD role (either fact or level). Thus, in TM , for each IR , we store its MDIIR s as tagged nodes ( MDINode ) and edges ( Edge ). Furthermore, nodes ( GraphNode ) may contain attributes either dimensional ( Descriptor , if the node is a level) or factual ( Measure , if the node is a fact). 2. Resulting MD schema. An MD schema ( MDSchema ) may contain several star schemas ( SSchema ), which are essentially extended MDIs (see Section 2.2). Therefore, they are also implemented as tagged graphs (with nodes, SSNode , and edges Edges ). Importantly, TM stores many dierent MDSchema s, each one reecting dierent integration alternatives. These integration alternatives are described through mappings ( SSNodeMapping ) between MDINode s and SSNode s. 3. MD integration metadata. When an evolution event occurs (namely adding new information requirement), ORE eciently accommodates the existing MD schemas to these changes and records their occurrences for assisting the user in future design steps. In TM , we store these changes as a set of operations ( IntegrationOperation ), which are necessary to integrate individual MD concepts ( MDINodes ) coming from new requirements 107
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses (i.e., new MDI s) into the existing MD design. There are several types of integration operations: (1) operations for inserting new MD concepts into the existing design (i.e., InsertFact , InsertLevel and InsertRollUp ) (2) operations for enriching the existing concepts with new MD attributes (i.e., InsertFactMeasure and InsertDimDescriptor ) and (3) operations for combining new MD concepts with the existing ones (i.e., MergeFacts , MergeLevels , RollupFacts and RenameOperation ). According to Figure 4.6, in order to integrate two MDI s ( MDIIntegration ) we may need several integration operations ( IntegrationOperation ). Note that all operations are applied to one MDINode , except MatchingOperation s and InsertRollUp that refer to an additional MDI . Furthermore, when inserting or merging, levels or facts, an additional set of operations may be identied (see bottom part of Figure 4.6). These operations can either insert new attributes to these concepts (i.e., InsertFactMeasure and InsertDimDescriptor ), or when inserting a new level ( insertLevel ), to insert an additional roll-up relation (i.e., InsertRollUp ). 4. Cost-based space of alternative solutions. Finally, TM also stores a reference cost model ( CostModel ) and a space of alternative solutions ( AltSpace ). When integrating new requirements, it may occur that several alternative scenarios appear to be valid outcomes of the MD design process (this is mainly due to ambivalent concepts; see Section 2.2). However, considering the chosen DW quality factors (see Section 2.4.2), not all of these output schemas would have the same overall score. In our example case the cost depends on the size and the structural complexity of each nal solution. To assist the end user in eciently determining the most suitable solution, in TM we maintain an ordered space of alternative solutions ( AltSpace ), according to the overall score that is calculated as explained in Section 2.4.2 by using the referenced cost model ( CostModel ). Thus, we compute, for each integration alternative, its cost. More specically, each of the integration operations presented above adds a certain weight (see Table 4.2) to the overall cost of the solution. As discussed, to integrate two MDIs we may need several integration operations and consequently, ORE keeps track of the overall cost needed to integrate them, which is used to sort the space of alternatives. We dene this space as a partially ordered graph which is represented with a triplet p S,NB,St q . S represents a set of valid scenarios in terms of nal MD schemas and NB (Next Best) is a set of directed edges that order these alternative solutions inside the space. At any moment, the solution with the lowest overall cost can be identied as the top solution ( St ). In the case that the end user does not nd the proposed top solution suitable for her needs, the NB edges going from that solution will lead her to its nearest alternatives, i.e., the next best solutions. Relevantly, 108
4. The ORE Approach our search space only contains alternatives considering all requirements at hand (i.e., partial results are not kept). Moreover, considering the chosen cost model, the search space can be pruned to include only the top-N alternative solutions (see Section 5). TM is a building block of ORE and it is constantly maintained to reect and fulll the set of IRs at hand. For example: Adding an IR. Whenever a new requirement ( IR ) is posed, the TM is enriched with the missing metadata to answer such requirement. In particular, new MDIIR that are identied for a given requirement are added to the TM . The added MDIIR initiates a new iteration of ORE to identify how the requirement at hand can be integrated into the existing structures. To this end, we identify all parts of the existing schemas (i.e., SSNodes ), where the MDIs of a new requirement can be integrated. Going from the identied SSNodes , through the SSNodeMapping we further identify possible relationships of the new MDIs with the MDIs of previous requirements. In the following section, we describe how an iteration of ORE is performed for such addition. Example. Figure 4.3 shows the top solution St for integration of IR1 and IR2. If a new requirement comes (e.g., IR3), ORE will ask for MDI of IR3 and go through its four internal stages to match these MDIs with the current space of alternatives ( S ). At the end, it will produce new space ( Snew ) of MD schemas ( SSnew ), each of them showing dierent integration alternatives, such that: @ SSnew P Snew, @ i 1..3 : MDIIRi qSSnew These new schemas are properly ordered (according to our cost model) and stored in the space of alternative solutions (i.e., AltSpace ). l Removing and changing an IR. Besides accommodating the current MD design to satisfy new IRs, TM also needs to react in response to a changed or disregarded requirement. In the case of disregarding the existing requirement, the requirement ( IR ) is removed together with its MDIIR . ORE is then relaunched for the remaining set of information requirements. When the exiting requirement is changed, ORE rst removes the obsolete requirement and its MDIs and then adds a new (changed) requirement ( IR ) together with its MDIIR . The main process of ORE is then relaunched for the updated set of requirements. Note that relaunching ORE is not that costly at this point, considering the fact that the integration options for the existing MDIs are already stored in TM together with the user's feedbacks and preferences. 4 The ORE Approach As shown in the previous section, at each moment, ORE with the information stored inside its TM structure satises the current set of requirements. The 109
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses Algorithm: ORE inputs: MDIIR , S , output: Snew 1. options : H ; 2. For each SScur P S do (a) For each r MDIi P MDIIR,SSj P SScur s do i. matchedFactsOpers := FM (getFact( MDIi ),getFact( SSj )); ii. If matchedFactsOpers t insertFact p FMDIi qu do A. DMDIi := searchDimsOverFact( FMDIi ); B. DSSj := searchDimsOverFact( FSSj ); C. For each DMDIi P DMDIi,DSSj P DSSj do If related p bottom p DMDIi q ,bottom p DSSj qq then matchedDimsOpers Y DM pt bottom p DMDIi qu , t bottom p DSSj quq ; D. options Y r SScur z SSj,SSj, matchedFactsOpers , matchedDimsOpers s ; 3. For each o P f indBestN p options q do (a) Snew Y applyOperations p o q ; 4. Snew : INT p complementingMDSchema p applyOperations p f indTop p options qqqq ; 5. return Snew ; space of alternative solutions is also created at the end to support users in nding the most suitable MD schema. For each new requirement ORE tries to nd the valid correspondences among the MD concepts and to incorporate the new requirement into the existing MD design. At the same time, ORE attempts to meet previously set quality objectives and to produce the minimal cost of the output schema according to the proposed cost model (see Section 2.4.2). An exhaustive search inside the current space of alternatives is performed to achieve such goals. The main process of ORE is shown in the ORE algorithm. Note that in order to uniquely reference the steps of the algorithms throughout the chapter we use the notation (Step algorithm:step). Internally, whenever a new requirement arrives ( IRnew ), ORE tries to match each MD interpretation ( MDIi ) of that requirement with the schemas ( SSj ) of each solution in the current space of alternatives ( S ). The correspondences between an MDIi and an SSj are found through the matchings of their individual MD concepts, i.e., facts ( FM call in Step ORE:2(a)i) and dimensions ( DM call in Step ORE:2(a)iiC). For such matchings, ORE benets from the ontology reasoning mechanisms to nd relationships among the concepts from heterogeneous data sources, in an ecient and scalable manner (i.e., synonyms, taxonomies, direct and transitive associations). Notice that only the associations that preserve the MD integrity constraints are accepted. After all the operations to incorporate new concepts into the existing design have been found, ORE considers creating the new space of alternative solutions (Step ORE:3). The cost of each solution is calculated using the selected cost model as described in Section 2.4.2. Eventually, the set of solutions is pruned by taking into account their overall costs, such that only the best N solutions are kept for further consideration (the value of N can be parametrized by the user). 110
4. The ORE Approach Algorithm: FM inputs: FMDIi , FSSj , output: intOps 1. If FMDIi FSSj then intOps : t mergeFacts p FMDIi,FSSj qu ; 2. ElseIf FMDIi Ñ FSSj _ FSSj Ñ FMDIi then (a) If FMDIi Ñ FSSj ^ FSSj Ð FMDIi then intOps : t mergeFacts p FMDIi,FSSj q ,renameConcept p FMDIi,FSSj qu ; (b) ElseIf FMDIi Ñ FSSj then i. If acceptableGranularity p MDIi q then intOps : t rollupFacts p FMDIi,FSSj qu ; (c) Else // FSSj Ñ FMDIi i. If acceptableGranularity p SSj q then intOps : t rollupFacts p FSSj,FMDIi qu ; 3. Else (a) DMDIi := searchDimsOverFact( FMDIi ); (b) DSSj := searchDimsOverFact( FSSj ); (c) If FMDIi Ñ DSSj _ FSSj Ñ DMDIi then i. If FMDIi Ñ DSSj ^ FSSj Ñ DMDIi then intOps : t mergeFacts p FMDIi,FSSj q ,renameConcept p FMDIi,FSSj qu ; ii. ElseIf FMDIi Ñ DSSj then A. If acceptableGranularity p MDIi q then intOps : t rollupFacts p FSSj,FMDIi qu ; iii. Else // FSSj Ñ DMDIi A. If acceptableGranularity p SSj q then intOps : t rollupFacts p FMDIi,FSSj qu ; (d) Else intOps : t insertFact p FMDIi qu ; 4. return intOps ; Among these N solutions ORE considers the top one to produce the nal MD schema by complementing the current one with new knowledge and conforming its constructs respecting the minimal design properties ( INT in Step ORE:4). 4.1 Matching facts Respecting the MD integrity constraints described in Section 2.2, in order to match two facts, these should produce an equivalent set of points in the MD space. This is formally dened with the following condition p C q : p C q : The fact FMDIi P MDIi matches the fact FSSj P SSj if and only if there is a bijective function f such that for each point xMDIi in the MD space arranged by the dimensions { D1 D2 .. Dn } implied by FMDIi , there is one and only one point ySSj in the MD space arranged by the dimensions ( D 1 1 D 1 2 .. D 1 m } implied by FSSj , such that f p xMDIi q ySSj . The abstraction of the fact matching process that guarantees the fulllment of the above condition ( C ) is described by the FM algorithm. Thus, FM tests whether C is satised by checking whether FMDIi ( FSSj ) functionally determines all the dimensions of FSSj ( FMDIi ), i.e., whether FMDIi ( FSSj ) is related by means of 1 - 1 or * - 1 relationship to each dimension of FSSj ( FMDIi ) (Step FM:3c). If this happens, it is because either they share the same MD 111
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses space (Step FM:3(c)i) or one can be rolled up to the other (Steps FM:3(c)iiA and FM:3(c)iiiA). These relationships are searched by means of reasoning over the domain ontology (see Section 2.4.1). As a special case, such matching is achieved if both facts coincide or transitively if one fact functionally determines the other, which is cheaper to be checked. Therefore, as an optimization, we rstly check the latter (Steps FM:1and FM:2, respectively). It is worth noting that if we roll up a fact, we must check whether the new granularity is still acceptable for the associated requirements. If the full match between both facts is found, i.e., they are equal (Step FM:1) or they functionally determine each other (Steps FM:2a and FM:3(c)i), the mergeFacts operation is added, followed by renameConcept , if they are not equal. Alternatively, if one fact functionally determines the other (Steps FM:2(b)i and FM:2(c)i) or if it functionally determines all the dimensions of the other fact (Steps FM:3(c)iiA and FM:3(c)iiiA) the rollupFacts operation is identied to roll-up from the MD space of one fact to the MD space of the other (only when the coarser granularity is acceptable for all involved requirements). Otherwise, if FM cannot identify a valid matching for the fact FMDIi , it generates the insertFact operation (Step FM:3d). Example (Step FM:1) Figure 4.7 shows the case when the fact Lineitem of the requirement IR2 matches the same fact in the existing TM . l Example (Step FM:2) Figure 4.8 illustrates the case where the fact Partsupplier of IR4 matches the fact Lineitem that functionally determines it, which is identied in the ontology that captures the TPC-H data sources (see TPC-H schema in Figure 4.1). Therefore, the operation rollupFacts p Lineitem,Partsu - pplier q is identied. Notice that in this case, we still should check whether the new granularity allows to answer the requirements associated to SSj . l Fig. 4.7: Matching the MD Interpretation for IR2 Fig. 4.8: Matching facts with rollupFacts Fig. 4.9: Matching facts with mergeFacts Example (Step FM:3c). Figure 4.9 shows an example inspired by TPC- H. A new PartMarket fact is introduced, which assesses the convenience of releasing a specic Part in a specic market (i.e., Nation). Even though we 112
4. The ORE Approach may nd no direct matching (i.e., Steps FM:1and FM:2) between PartMarket and the Supplier-PartSupplier fact, their MD spaces do coincide as they both functionally determine the dimensions (i.e., Nation and Part) of each other. On the other side, in Figure 4.10, in the variation of the above example we have the case that the dimensions of the fact PartMarket are functionally determined by the Lineitem-PartSupplier fact but the opposite does not hold and thus, the rollupFacts p Lineitem PartSupplier , PartMarket q operation should be added. As in the previous example, we still have to guarantee that the new granularity allows to satisfy the requirements associated to SSj . l Finally, all integration possibilities represented through the identied operations (i.e., rollupFacts , mergeFact , renameConcept or insertFact ) are listed with the weights they add to the nal solutions (see Table 4.2). ORE then creates an alternative solution for each of the integration possibilities. To prioritize the resulting solutions, the overall cost of each solution is evaluated according to predened quality factors. 4.2 Matching dimensions In this stage, ORE conforms the dimensions which form the MD spaces of the facts ( FMDIi , FSSj ) for which it previously found a matching that is not discarded by the user (Step ORE:2(a)iiC). Since a single dimension Dx consists of a partially ordered set of individual levels (see Section 2.2), with single bottom (i.e., atomic) level and with toone relationships among the levels, each dimension may be seen as a directed acyclic graph (DAG), where the vertices of the graph are individual levels and the directed edges between them are to-one relationships (i.e., functional dependencies). Note that we assume the dimension graph is guaranteed to be acyclic (this should be checked in a preliminar step), since the loops would violate the MD integrity constraints [114]. Having this in mind, the problem of matching dimensions may be seen as a graph matching problem. However, taking into account the MD context, ORE must additionally preserve the MD integrity constraints (see Section 2.2). Thus, we present here the DM algorithm, which solves the problem in our case. DM is launched from the main ( ORE ) algorithm (Step ORE:2(a)iiC) for each pair of dimensions coming from MDIi ( DMDIi ) and SSj ( DSSj ) with the previously matched facts ( FMDIi , FSSj ) and bottom (atomic) levels connected with an MD compliant relationships (i.e., =, 1-1, 1-*, and *-1). Considering the topological order of levels in each of the dimensions, DM starts by matching the atomic ( bottom ) levels of these dimensions. In each call, DM searches for the matchings between all pairs of the candidate levels of MDIi (i.e., candidatesMDIi ) and each candidate from the dimensions of SSj (i.e., candidatesSSj ), starting from the bottom of each of them and 113
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses Algorithm: DM inputs: candidatesMDIi , candidatesSSj , output: intOps 1. If LMDIi LSSj then intOps Y t mergeLevels p LMDIi,LSSj quZ DM p getNext p LMDIi q ,getNext p LSSj qq ; 2. ElseIf LMDIi Ñ LSSj _ LSSj Ñ LMDIi then (a) If LMDIi Ñ LSSj ^ LSSj Ñ LMDIi then intOps Y t mergeLevels p LMDIi,LSSj q ,renameConcept p LMDIi,LSSj qu Z DM p getNext p LMDIi q ,getNext p LSSj qq ; (b) ElseIf LSSj Ñ LMDIi then intOps Y t insertLevel p LMDIi q ,insertRollUp p LSSj,LMDIi quZ DM pt LMDIi u ,getNext p LSSj qq ; (c) Else // LMDIi Ñ LSSj intOps Y t insertLevel p LMDIi q ,insertRollUp p LMDIi,LSSj qu Z DM p getNext p LMDIi q , t LSSj uq ; 3. Else // No matching for current levels (a) intOps Y DM pt LMDIi u ,getNext p LSSj qq ; (b) intOps Y t insertLevel p LMDIi qu Z DM p getNext p LMDIi q , t LSSj uq ; 4. return intOps ; Fig. 4.10: Matching facts with rollupFacts Fig. 4.11: Matching the MD Interpretation for IR5 hence, recursively moves forward through the corresponding hierarchy, depending on the multiplicity of the relationship found. For each pair of candidate levels, DM rst checks if they exactly coincide (Step DM:1). If not, it may be that one functionally determines the other (Step DM:2). This can be either the case when both levels functionally determine each other, i.e., 1-1 relationship (Step DM:2a), or the case when only one of them functionally determines the other one, i.e., either 1-* or *-1 relationship (Steps DM:2b and DM:2c, respectively). Again, these relationships are identied by means of reasoning over the input ontology. If the levels are equal or the 1-1 relationship is found (i.e., a full match), a recursive call moves forward in both hierarchies. However, when a 1-* or *-1 relationship is identied, DM can still explore the possibility that the level being in the to-one side matches the next one in the to-many side of the 114
4. The ORE Approach relationship. Thus, it only moves forward in one of the hierarchies. Finally, if there is no relationship between the levels (Step DM:3), DM considers both alternatives, i.e., moving forward in either one or the other hierarchy. Thus, DM exhaustively visits all meaningful matchings for dimensions of MDIi and of SSj , and builds the set of possible integration options ( intOps ). For each integration option, DM stores the information about the corresponding operations to be applied (see Table 4.2). When the full match between LMDIi and LSSj is found, either by equality or 1-1 relationship (Steps DM:1and DM:2a), we consider either only the mergeLevels or the mergeLevels with the renameConcept operation to be applied, respectively. Example. Figure 4.11 shows an integration possibility for the Orders dimension, in the case of integrating IR5 into the TM satisfying IR1-IR4. A full matching (i.e., equality) is then found for both Orders and Customer levels of the corresponding MDIi . Thus, the mergeLevels operations are proposed for both Orders and Customer levels and they respectively involve insertDimDescriptor operations for transferring o_shippriority and c_mktsegment. l On the other hand, if 1 - * or * - 1 relationships are identied (Step DM:2b and DM:2c), we consider inserting a roll-up relation (i.e., insertRollUp operation) in the star SSj to a new inserted level. Example. In Figure 4.7, for the * - 1 matching found between levels Lineitem_dim and Orders, inserting a roll-up relation is proposed (i.e., insertRollUp(Lineitem_dim, Orders)), with the involved insertion of the level (Lineitem_dim). l Similarly to the previous stage, we may identify dierent options to integrate levels in MDIi with dierent candidate levels of the hierarchies from SSj . Thus, we must consider the possibility of combining the current integration operations with all the alternatives of the successors (this is shown by the symbol Z in the algorithm). Once all the integration options are found with their corresponding weights, ORE creates an alternative solution for each of the integration possibilities. 4.3 Complementing the MD design After the previous two stages, ORE identies the space of possible solutions for incorporating the new information requirement into the existing schema. As we discussed before, this space can be partially ordered considering user preferences and the cost of the individual solutions. In such a space we can obtain the top element that corresponds to the solution currently most suitable for the end user according to predened quality objectives. Considering the top solution found, in this stage ORE continues by analyzing the ontology to complement the future MD design with new analytically interesting concepts. This stage is optional and may be disregarded by the user. By exploring the functional dependencies (to-one relationships) in the 115
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses Algorithm: INT input: SStop , output: SSnew 1. SSnew H ; 2. For each SSj P SStop do (a) SSnew := rH , H , Hs ; (b) seedF := ndFactualConcept( SSj ); (c) F := group( seedF ); (d) setFact( SSnew ,collapse( F )); (e) For each p f,L0 q P FSSj ^ f P F ^ L0 R F do i. D = group( L0 ); ii. setDimension( SSnew ,collapse( D )); (f) SSnew Y t SSnew u 3. return SSnew ; ontology, ORE identies new levels for the previously conformed dimensions. Furthermore, dierent datatype properties in the ontology may also be identied either as measures of the existing facts or descriptive attributes of the levels. We distinguish two cases: • If the property has a numerical data type (e.g., integer, double), we consider using it as a measure if and only if the domain concept of the property is identied as a fact. • Otherwise, in the case that the domain concept of a property is identied as a level, our method suggests using the property as a new descriptor. Dierent possibilities for enriching the current design are presented to the designer as dierent integration operations (i.e., insertLevel, insertFactMeasure, insertDimDescriptor). The designer may decide how to complement the MD design. As shown in [142], automation of such exploration process is highly achievable with polynomial complexity for the ontologies capturing the data source semantics. Example. For the Orders dimension in Figure 4.11, ORE explores the ontology and proposes concept Region as a new top level of the given dimension. Also, ORE proposes dierent descriptors for the levels Orders, Customer, Nation, and Region; e.g., o_orderstatus, c_phone, and so on. l 4.4 Integration Having the top solution for producing the MD schema identied in the rst two stages and optionally complemented in the third stage, here, ORE produces the nal MD schema. The integration process is described with the INT algorithm as follows. The algorithm starts from the set of star schemas of the top solution ( SStop ) produced in the previous stages of ORE, which now additionally answers the IR at hand. 116
5. Theoretical Validation all alternative solutions ( SS1, .., SSr ). Furthermore, due to the dierent integration options explained in sections 4.1 and 4.2, we produce dierent alternative solutions that are compliant with the soundness and completeness properties discussed in the previous subsection. Considering the fact that for each new requirement we need to compare all its MDIs with all the current alternative solutions and nd all the possible integration alternatives, it is not hard to see from the above that the general problem of the requirement-driven DW design is complex (clearly exponential). Formally, we can present it as follows: If we assume a scenario where n information requirements are arriving at the input. IRi,i 1..n For each requirement IRi , there can be mi MD interpretations. mi | MDIIRi | After the rst requirement ( IR1 ) arrives, its MDIs are inserted into the space of alternative solutions S . The size of S will correspond to the number of MDIs of IR1 , i.e., m1 . | S | m1 Next, when we integrate the second requirement ( IR2 ) into the existing space of alternative solutions S , the size of S will correspond to the product of m1 for IR1 and m2 for IR2 multiplied by the coecient of alternative solutions (i.e., γ1 ). Note that when comparing a single MDI with one star SS there is at least one solution (i.e., γi ¥ 1 ). However, there may be additional solutions which result from having dierent alternatives to integrate an MDI with SS . For example, in dimension matching algorithm in Step DM :3, if we do not nd the direct matching between current levels we explore both the hierarchy of the rst and the second dimension, which in turn can create more then one valid solution. | S | m1 m2 γ1 Moreover, the algorithm will perform m1 m2 comparisons of the MDIs of incoming requirement and the stars of the existing space of solutions. Considering the above, after integrating requirement IRn into the existing space of alternative solutions S , the size of S will be the following. | S | ppp m1 m2 γ1 q m3 γ2 q .. mn 1 γn 2 q mn γn 1 Let us consider that the average number of MDIs per requirement is m (i.e., @ mi P m1..mn,mi m ). | S | ppp m m γ1 q m γ2 q .. m γn 2 q m γn 1 Additionally, if we assume that each comparison produces in average γ alternative solutions (i.e., @ γj P γ1..γn 1,γj γ ). Then, we can approximate the size of S as follows. | S | mn γn 2 γ mn γn 1 Here, we can see that the total number of comparisons among the MDIs of incoming requirements and the stars of the existing space of solutions for n requirements will be mn γn 2 . 123
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses If we further assume a realistic scenario where the number of incoming requirements is big enough, we can then infer that n " m and n " γ . Taking the above analysis into account, we can conclude that theoretical computation complexity for the problem of requirement-driven DW schema design is exponential (i.e., O p 2n q ). l As discussed in the chapter, and more specically in sections 2.4 and 3, we introduce a cost model that evaluates some quality factors as a parameter of ORE. In our example scenario, we use the structural complexity of the output MD schema as a quality factor. We further use this cost model for introducing heuristics to tackle the inherent complexity of the problem at hand. To this end, the cost-based space of alternative solutions, explained in detail in Section 3, is created and pruned after each integration iteration to maintain only the top-N solutions. Assuming that N is the limiting size of the space of alternative solutions S , we revisit the analysis of the computational complexity of ORE. With each new requirement IRi , we need to perform the maximum of mi N comparisons between the MDIs of IRi and the stars of S . For n incoming requirements we perform the total of m1 N .. mn N comparisons. If we again consider that m is the average number of MDIs per requirement, it is not hard to see that the total number of comparisons for n requirements is m N n . As before, if we assume n being big enough, i.e., n " m , we can conclude that by introducing the cost-based heuristics, the computational complexity of ORE is guaranteed to be linear (i.e., O p n q ). l Such linear complexity, as we will experimentally show in the next section, can be further parametrized with the size of the space of alternative solutions (i.e., N ). Moreover, as it will be also empirically shown, for a manageable size of N , ORE, in most of the cases does not miss the optimal solution w.r.t. chosen quality objectives. 6 Evaluation In this section, we rst describe a prototype system which implements ORE's functionalities. Next, we validate the correctness of the output MD schemata, obtained for the TPC-H benchmark example used in this chapter, by comparing these to the ones manually derived in the Star Schema Benchmark (SSB) [126]. Finally, we report on our experimental ndings from both scrutinizing the ORE's prototype and performing an empirical case study with a group of participants. On the one hand, we scrutinize ORE to validate our theoretical conclusions w.r.t.: (1) the algorithm's complexity (in terms of the execution time), (2) quality of the results (in terms of the chosen quality factors), (3) the algorithm's characteristics (in terms of the number of performed integration operations), and (4) scalability (in terms of the growing amount of require- 124
6. Evaluation ments). On the other hand, we evaluate the manual eort of the real end-users needed for the MD schema design w.r.t.: (1) elapsed time, (2) quality and accuracy of the results, and (3) the emotional response (by means of the user's condence in the provided solutions), in order to show the inherent complexity of the design tasks when performed manually. 6.1 Prototype As a proof of concept, we have built a prototype implementation of ORE. ORE expects two kinds of inputs: information requirements expressed as MDIs and an OWL ontology representing the sources. In order to integrate the end- to-end solution of our research work (more details in Section 8) and to automate our testing exercises, we linked ORE to GEM. GEM is our previous solution to produce MDIs from requirements, [146] (see Figure 4.12). Moreover, the output generated by GEM is guaranteed to be sound and complete. These two modules (i.e., GEM and ORE) are communicating through the TM module (Section 3). We have chosen MongoDB for implementing a storage repository for TM. We justify our choice with the fact that handling semistructured, documentoriented data (e.g., information requirements, MDIs, Star schema (SS)) is more ecient with NOSQL databases, like MongoDB. Moreover, the consistency tradeos (i.e., eventual consistency) that boost the scalability, availability and latency of a MongoDB, t the TM's needs for data storage. Later in this section we show some experimental ndings that conrm such design choice. When a new requirement arrives, it is processed by GEM, which produces a set of MDIs describing the MD data cube representing such requirement and stores them into the TM repository. Next, the produced MDIs of a single requirement are read from TM, and serialized in a proprietary XML format understood by ORE. ORE then processes these MDIs as explained throughout this chapter and produces the alternative MD schemata, each one in terms of a set of stars (i.e., SSi ), and stores them inside the TM . Fig. 4.12: Prototype setup Figure 4.12 shows the architecture of our prototype. This architecture is 125
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses modular in that another module could be chosen to replace GEM if necessary, as far as the output MDIs are sound and complete (see Section 2.2) and they are expressed in ORE's proprietary XML format. For describing the sources as an OWL ontology we followed the method proposed in [167], which largely automates the process for well-formed sources. ORE communicates with the ontology describing the sources by means of Jena API [6]. Depending on the complexity of such ontology, the requests for nding the relationship between the ontology concepts may be costly (e.g., [144]). Since such requests are frequent, in our implementation we used a component called Transitive Closure Cache (TCC) to facilitate the probing of the ontology. TCC receives requests from ORE for discovering the relationship between two concepts, e.g., (A,B). If no entry is found, it means that no previous iteration asked for the relationships of A. At this point, TCC accesses the ontology and looks for the requested relationship, but it also further explores the ontology to nd the transitive closure for A through 1 - 1, 1 - * or * - 1 relationships and loads the corresponding entries to its structures. If a following request relating A, say (A,C), is posed, it will be answered from TCC . TCC works with a limited size of the internal memory and the overwriting is done following the least recently used cache algorithm. 6.2 Output validation Following our running example scenario (i.e., the TPC-H benchmark), we performed a set of experiments to validate the reliability of ORE by examining the correctness of its resulting MD schemata. TPC-H is an ad hoc decision support benchmark, hence it provides a convenient source for analyzing data from dierent perspectives. Some eorts have been invested in adapting the schema of the TPC-H benchmark for MD purposes. In [126], the authors present the Star Schema Benchmark (SSB). They manually design an MD schema based on the TPC-H benchmark by applying traditional optimization techniques (e.g., denormalization) to the classical TPC-H schema. Here, we list the manual modications of the TPC-H schema that are proposed in [126] and describe how each of these design choices is automatically supported in ORE. • Combine the TPC-H Lineitem and Orders tables. The fact matching stage of ORE rst merges the facts of dierent requirements that are placed in the same MD space. Furthermore, in the last stage (i.e., integration), ORE denormalizes the schema and combines the adjacent MD concepts into a single fact or dimension. • Drop the Partsupplier table. As explained in [126], the Partsupplier table is removed from the design as it has a dierent temporal granularity from the Lineitem and Orders . The authors further discuss that Partsupplier can only be treated as a separate fact table belonging to 126
6. Evaluation a dierent data mart. As a matter of fact, when in the fact matching stage, ORE does not nd any existing fact whose MD space matches a fact from the new requirement, it creates a new star inside the existing MD schema with the new coming fact. • Drop the comment attribute from Lineitem . We discuss in Section 2.2 that ORE only accepts MDIs that satisfy the MD integrity constraints. As explained in Section 2.2, one of the requirements to guarantee this is a correct data summarization which is further guaranteed among others, by the condition of Compatibility. This condition indeed ensures that the type of a measure being aggregated and the aggregation function are compatible, which guarantees that the textual attributes, like l_comment , will be left out from the fact table design. • Drop the tables Nation and Region outboard to the dimensions Customer and Supplier . In [126], the authors drop the tables Nation and Region and add this information as attributes to the Customer and Supplier tables (i.e., address ). Such design choice is widely supported in ORE's last stage (i.e., integration), where adjacent levels are combined and the dimension is denormalized and collapsed into one table. • Adding the Date dimension. To adapt the schema to the standard DW design principles, the authors in [126] propose to complement the schema with the new Date dimension which is very common when analyzing the factual data such as sales . In ORE, after the fact and dimension matching stages, the new MD schema can be additionally tuned with the analytically interesting concepts in the stage of complementing the MD design. In this stage, the domain ontology is searched and the new valid MD concepts are proposed to the user. Likewise, the new dimension (e.g., Date ) can be added to the MD design. As an empirical proof, we ran ORE for a set of information requirements adapted from the queries that are provided by the TPC-H benchmark and we automatically obtained the same MD schema as SBB. The only exception is the Partsupplier fact which ORE, due to dierent granularity from other facts (e.g., Lineitem ), separates in a dierent star. l 6.3 Experimental setup The experimental setup involves a system called LEARN-SQL [8], which has been used at UPC-BarcelonaTech since 2003 to assess assignments related to exercises on the SQL language. The system is implemented using the opensource, learning management system, i.e., Moodle. The data gathered so far involve 2550 students in ve dierent subjects and concerns more than 600 dierent SQL items (assignments). The students issued more than 150.000 submissions, which created a signicant data source to be analyzed for gain- 127
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses ing an insight into the students' performance regarding dierent aspects of the subjects. Three main data sources are considered for the analysis in the LEARN-SQL system: (1) the operational DB deployed in PostgreSQL, (2) the students' data in XML, and (3) the evaluation results (per semester) in spreadsheet format. As a goal, a target MD data store should be provided to conveniently support the demands from dierent analytical requirements posed by the system users (e.g., lecturers). For evaluating our approach, we conducted a set of experiments using the prototype being implemented (see Figure 4.12), with the aim to scrutinize ORE for measuring its performances (i.e., computational complexity, results quality, and dierent characteristics of the algorithm) and scalability (in terms of the number of requirements). As in the rest of this chapter, here we also use the structural complexity as the example quality factor for evaluating the cost of the output MD schemata. As an additional validation step for demonstrating the need for automating the MD schema design, we performed a set of empirical tests to measure the manual eorts of the real users when manually designing an MD schema from information requirements (in terms of the elapsed time, the quality and accuracy of provided solutions, and the emotional response of the users). 6.4 Scrutinizing ORE As previously discussed in this chapter (see Section 5.3), the MD schema design from information requirements is a computationally complex problem due to the exponential growth of the space of possible solutions. However, as it can be seen in Figure 4.13, not all these solutions have the same cost when it comes to structural complexity of an MD schema. Therefore, we introduced a cost-based approach based on our cost model to prune the space of alternative solutions. Taking this into account, we used the previously described ORE's prototype and performed a series of experiments. These experiments aimed at validating the linear complexity of our cost-based solution (see Section 5.3) and generally the practical feasibility of our approach. We collected dierent indicators about ORE's performance and scalability, and at the same time, for our example scenario we aimed to show that ORE meets the chosen quality objectives, i.e., the resulting MD schema is with minimal structural complexity. Inputs. As we explain shortly, we had a case study conducted with the help of a number of participants, real users of the LEARN-SQL system. During this process, one group of participants (i.e., DB lecturers) analyzed the domain ontology that captures the semantics of data sources in the LEARN-SQL system, and provided us with a set of thirteen requirements. Taking a look at them, the users most often wanted to analyze the success of students focusing on dierent indicators (e.g., nal marks, outcomes of single assignments, results of the experiments executions over students' solutions, etc.) and from dierent 128
6. Evaluation Fig. 4.13: Cost dierences perspectives (e.g., candidates, semesters, kind of assignment items, subjects, etc.). These requirements represent a real world case as they came from real users showing real demands on a real system. What these requirements also showed is that dierent users may be interested in performing the same or similar analysis which is a common case in real business environments. We use this set of thirteen requirements as input dataset for performing the experiments over ORE. Experimental Methodology. Linking ORE to GEM allowed us to provide the collected requirements as inputs in our prototype setting (see Figure 4.12). From each individual requirement, GEM produced the corresponding set of MDI s, which then fed ORE together with the domain OWL ontology we created for the experiments with the users. We then ran ORE for dierent permutations of the input set of requirements. In each permutation, we simulated iterative arrivals of new requirements to the system i.e., starting from a single requirement a new requirement was considered in each iteration to be incorporated into the current MD schema design. Through a series of experiments that we explain shorty, we collected dierent indicators for each permutation and iterations (e.g., overall time per iteration, time spent on fact matching, time spent on dimension matching, overall time per complete permutation, #matching facts, #matching dimensions). Experiments. Next, we discuss dierent experiments we performed over ORE in more detail and report our ndings. Time. Considering that in general the requirement-driven DW design problem is exponential, which we theoretically validated in Section 5.3, we performed a set of experiments following the above methodology and with varying input loads and constraints. The results are shown in Figure 4.14. As assumed, dealing with the complete space of solutions is expensive. After only ten require- 129
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses Fig. 4.14: Time comparison ments (considering all the MDI s of those requirements) the time to iteratively integrate each requirement starts rapidly to grow and it later bursts for additional requirements (see dotted part of the purple line, i.e., w/o threshold, in Figure 4.14). However, as previously discussed, our approach is cost-based (in this experiment, we used as a quality factor the structural complexity of an output schema) and we only keep the top-N best solutions after integrating a new requirement. In the experiments, we used dierent values for N (i.e., 25, 50, and 100) to analyze how N aects the execution time of ORE. The linear complexity of our cost-based approach discussed in Section 5.3, we empirically conrm here after introducing the cost-based heuristics (i.e., keeping the top-N solutions). The additional tests with dierent thresholds (i.e., N) showed us that after new requirements come, the time tends to stay in a certain range depending on the number of top solutions kept (i.e., the value of N). Additionally, Figure 4.14 (dashed line), shows that peaks may appear since the size of inputs (i.e., # MDI s per requirement) is not limited. However, our cost-based pruning keeps the problem manageable even in the worst case, regardless the number of requirements already dealt with. Another interesting observation is the higher latency that appears at the beginning, when integrating the rst few requirements (see Figure 4.14). This comes from the fact that at the beginning we make a direct access to the ontology for checking dierent relationships among concepts, which tends to be costly. As we discuss in Section 6.1, in our prototype we introduce a component called Transitive Closure Cache (TCC), where we cache relationships among ontology concepts, so over time we avoid accessing the ontology directly as the relationships are mostly found in TCC. Notice in Figure 4.14 that even with the expensive initial accesses to the ontology the time needed for integrating new requirement stays within a manageable rate (200-240ms). 130
6. Evaluation When measuring the times of dierent stages in ORE, we noticed that the average ratio of time spent on the fact matching stage ( FM ) appears to be signicantly higher as opposed to the other stages. As an example, the average ratio of time between fact and dimension matching stages ( FM and DM ) is shown in Figure 4.15. Such behavior showed us that the real problem of integrating MD designs is indeed nding the matches of MD spaces of their factual concepts which is done during the FM algorithm. Moreover, matching the MD spaces of facts through all their dimensions tends to be more complex than nding the relation between the dimensions of the already matched facts. Results Quality. Within the same set of experiments we also analyzed the cost of the output MD schemas that ORE produces w.r.t. the quality objectives we chose (i.e., minimal structural complexity). By testing dierent thresholds (i.e., values for N) we noticed that the optimal solution was always in the top-N (independent of the size of N) for the current setting. Clearly, as it usually happens with pruning techniques, at the moment there is no formal guarantee that pruning will always consider the optimal solution. At the same time, we also analyzed the alternative solutions with the highest cost. As one may notice in Figure 4.13, there is a signicant and increasing dierence of the costs between the optimal solution (i.e., min cost) that ORE nds and the worst solution (i.e., max cost) that may result from some other approach (e.g., manual design). Such observations additionally demonstrated the importance of automating the DW design process with the guarantee of meeting predened quality objectives. Algorithm's characteristics. We also studied the behavior of characteristics of ORE's algorithms. Figure 4.16 shows how the number of matchings of dierent concepts (factual and dimensional) is aected by the size of the problem. The number of matchings represents the average matchings found between MDI s of incoming requirement (1-13) and each of the alternative schemas at the output. Starting from scratch, ORE rst, as it nds the empty TM , inserts the facts and dimensions and creates rst designs at the output. Then, it exhaustively tries to match the facts and also their corresponding dimensions, as explained in Section 4. However, as the incrementally integrated design matures, there are lesser novel opportunities for matches, i.e., MD design becomes more complete. In Figure 4.16, one may notice that the number of the facts matched is proportionally lower then the number of levels, as we often have the situation of having a single fact and several of its dimensions. On the other hand, as we have already shown in Figure 4.15 time to perform the fact matching is still signicantly higher from the time for dimension matching. 131
Chapter 4. A Requirement-Driven Approach to the Design and Evolution of Data Warehouses Fig. 4.15: Time per stage Fig. 4.16: Matchings found Scalability. As we showed with the previous set of experiments, ORE is able to handle the growing amount of requirements, by using the introduced costbased heuristics (i.e., top-N solutions). We rst theoretically (in Section 5) and then practically (in this section) proved that the complexity of the approach by using these heuristics is linear and manageable regardless of the number of incoming requirements. Additionally, for the sake of analyzing the scalability and maintainability of the TM structure (see Section 3) for the growing amount of information requirements, we performed a set of tests where we measured the times for accessing the TM on MongoDB for reading and writing of dierent elements (e.g., MDI s). These tests showed us that the accessing times do not depend on the current size of the TM but mostly on the size of individual elements that are read or stored. As an example, reading MDIs from TM with the average size of ve concepts (facts or dimensions) has the average latency of 5.2ms and it goes to maximum of 9ms for MDIs larger than 10 concepts, independent of the current size of TM . Summary. This set of experiments demonstrated the feasibility of our semi-automatic approach for MD schema design. Furthermore, our cost-based heuristics (see Section 5.3) proved to maintain the linear complexity of the approach which makes it scalable regardless of the number of requirements and yet showed that ORE tends to generate the optimal solution. The main recommendation for the future users of the system would be to carefully choose the size of the space of alternative solutions which is used for the cost-based pruning (top-N). If N is too small (e.g., lower than 15), ORE does not always provide the optimal solution at the output. However, if N is too high (e.g., larger than 500), more solutions will be produced (including the optimal), but the performances will drastically drop. In fact, in our experimental scenario we showed that even with N in the rage [25,100] which is rather manageable, ORE always provides the optimal solutions at the output. 132