Docsity
Top Seller

Data Science and Database technology, Appunti di Database Relazionali

Toggle sidebar
bg1
1
Data Science and database technology
Index
INTRODUCTION ....................................................................................................................................................... 1
TRANSACTION PROCESSING .................................................................................................................................................... 1
ANALYTICAL PROCESSING ....................................................................................................................................................... 3
DATA SCIENCE AND BIG DATA .................................................................................................................................. 3
THE 5 V’ ............................................................................................................................................................................ 4
KNOWLEDGE DISCOVERY PROCESS .......................................................................................................................................... 4
Preprocessing .............................................................................................................................................................. 5
Techniques of analysis ................................................................................................................................................ 5
Different types of data scientists ................................................................................................................................ 6
DATA SCIENCE ISSUES ........................................................................................................................................................... 6
DATA WAREHOUSE INTRODUCTION ......................................................................................................................... 7
DATA ANALYSIS ................................................................................................................................................................... 8
DATA WAREHOUSE ARCHITECTURES ......................................................................................................................................... 8
REPRESENTATION OF DWS ................................................................................................................................................. 11
DESIGNING A DATA WAREHOUSE .......................................................................................................................... 12
BUSINESS DIMENSIONAL LIFECYCLE ....................................................................................................................................... 12
REQUIREMENT ANALYSIS ..................................................................................................................................................... 13
CONCEPTUAL DESIGN .......................................................................................................................................................... 14
Advanced constructs ................................................................................................................................................. 15
Aggregation .............................................................................................................................................................. 16
Other advanced constructs ....................................................................................................................................... 20
Representing time ..................................................................................................................................................... 22
Workload .................................................................................................................................................................. 24
Data volume .............................................................................................................................................................. 24
LOGICAL DESIGN ................................................................................................................................................................ 24
Star schema .............................................................................................................................................................. 24
Snowflake schema .................................................................................................................................................... 25
Multiple edges .......................................................................................................................................................... 26
Degenerate dimensions ............................................................................................................................................ 28
Junk dimension ......................................................................................................................................................... 29
DATA WAREHOUSE ANALYSIS ................................................................................................................................ 29
INTERFACE TOOLS .............................................................................................................................................................. 30
OLAP ANALYSIS ................................................................................................................................................................ 30
Roll up – zoom out .................................................................................................................................................... 30
Drill down – zoom in ................................................................................................................................................. 30
Slice and dice............................................................................................................................................................. 31
Pivot .......................................................................................................................................................................... 31
EXTENSIONS OF THE SQL LANGUAGE ..................................................................................................................................... 31
SQL OLAP Functions and Computation Windows ..................................................................................................... 31
Aggregation window ................................................................................................................................................ 34
Applications .............................................................................................................................................................. 36
Group by and window ............................................................................................................................................... 37
Ranking functions ..................................................................................................................................................... 38
Sorting the result ...................................................................................................................................................... 39
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Anteprima parziale del testo

Scarica Data Science and Database technology e più Appunti in PDF di Database Relazionali solo su Docsity!

Data Science and database technology

Introduction

Transaction processing

OLTP (Online Transaction Processing) referred to the traditional DBMS usage → operational database Database is the software component that provides the functionalities to manage the database content, means to read and write the database content, to support a concurrent access of different transactions to the database content, above the anomalies and provides additional functionality to guarantee the reliability property in a way that the database content is never lost, as well as changes by the committed transactions, so transactions ended without errors. An operational database is a type of database management system designed to handle a large number of short, real- time transactions. Key Characteristics of OLTP Systems:

  • Snapshot of Current Data: These databases provide a real-time view of the data, reflecting the most recent updates and changes (limited time window)
  • Detailed and Relational Data: They store detailed , structured data in a relational format, typically normalized to reduce redundancy and ensure data integrity. The reference data model is the relational representation, meaning that data are organise in the logical level in relational table, that stores a set of objects that are homogeneous (= all data objects are characterised by the same properties). The table has a fix schema, that contains the attributes that describe the object, and the object are the records of the table. The advantage is: o Data independence property: this model does not contain any information about the physical layout of the table, and they are not specifying on SQL query: where the table is store on the secondary memory? How are the records organised? → it improves the portability → The way the table is saved on the secondary memory affect the cost of the query, but it does not affect the information that are extracted
  • Structured, Repetitive Operations: OLTP systems perform a high volume of repetitive operations, such as inserting, updating, and deleting small amounts of data.
  • Read/Write Access to Few Records: Transactions often involve reading or writing to a limited number of records, ensuring quick response times (limited amount of data)
  • Short Transactions: Each transaction is designed to be completed quickly, minimizing the time the system is engaged and allowing for high throughput.
  • Database size: ≈ 100MB-GB TPS ( Transactions Per Second ): OLTP systems are optimized to handle a high number of transactions per second, ensuring efficient processing of numerous short transactions. The ACID properties are fundamental principles that guarantee the reliability and integrity of transactions in a database system, so the database content is correct. These properties ensure that database transactions are processed reliably, even in the event of errors, power failures, or other unforeseen issues. 1. Atomicity: refers to the fact that all actions are computed until the transaction ends with commit or all actions available in the transactions must be removed in case the transaction end with rollback; we cannot have an intermediate state o9f execution of a transaction. A transaction is an indivisible unit of work; it either completes entirely or does not execute at all. An application is the end point/outcome of the transaction, and it may end with two options: ▪ Commit : end without error → all changes done by the transaction must be written in the secondary memory in database to be visible by the other transactions ▪ Rollback : end with errors → If a transaction encounters an error, all changes are discarded, and the database is reverted to its state before the transaction began, ensuring consistency. To ensure data integrity and support recovery in case of failures, DBMSs employ a transaction log ( log files ). This log records every modification made by transactions. Before any changes are applied to the actual database, they are first written to the transaction log (secondary memory). This technique is known as Write- Ahead Logging (WAL).

WAL guarantees that in the event of a system crash, the database can be restored to a consistent state by replaying the log entries (the most recent backup). This ensures that all committed transactions are reflected in the database, and any uncommitted transactions are rolled back.

2. Consistency: A transaction brings the database from one valid state to another, maintaining all predefined rules, constraints, and data integrity. Any transaction that violates database rules (such as constraints or triggers) is not allowed to execute, ensuring that the database remains in a consistent state. If a transaction attempts to insert a record that violates a primary key constraint, the transaction is aborted, and the database remains unchanged.

  1. Isolation : the transactions can concurrently access to database content by reading and writing it. Transactions are executed in isolation from one another; the intermediate state of a transaction is not visible to other transactions. Even if transactions are executed concurrently, they do not interfere with each other, preventing anomalies such as dirty reads, non-repeatable reads, and phantom reads. If two transactions are updating the same data simultaneously, isolation ensures that each transaction's operations are completed without interference, preserving data integrity. When two transactions aim to modify the same data object, the DBMS employs locking mechanisms to manage access and maintain data consistency. By using Multiple Granularity Locking , the system can apply locks at various levels of granularity, balancing the need for concurrency with the necessity of consistency. In cases of conflicts, the DBMS may suspend one of the transactions, considering the granularity of the locks involved, to ensure smooth and efficient transaction processing. Reserves the access to portion of database to certain transactions and suspend the execution of other transactions, that can restart the execution when the objects of interest became available again. Different Granularity level to maximise the concurrent access of transactions to database: base on the amount of data the transaction want to access a transaction may lock reserved a table a set of records or certain fields in record, 8in a way that other transaction can access to the same table 4. Durability: guarantee that the database content is never lost even in case of failure. Failures can affect the database content in secondary memory or in the main memory. Once a transaction is committed, its changes are permanent, even in the event of a system crash. → In a Database Management System (DBMS), when transactions (like adding, updating, or deleting data) are initiated, they don't directly interact with the disk storage. Instead, they access data through a temporary area in the main memory. After the end of the transactions, if it modifies the portion and it ends with commit, these changes are propagated to the database in the secondary memory. The unit that manages all this activity is the DBMS: it receives the query from the transaction, access the portion of the database of interest in the secondary memory, loads into the main memory and there is a portion of the main memory that is reserved for the DBMS called buffer. All the databases access the database content to the buffer. The buffer pool acts as a high-speed intermediary between the slower disk storage and the faster main memory (RAM). When a transaction requires data, the DBMS first checks if it's already in the buffer pool:
  • If the data is present (a "buffer hit"), it's quickly retrieved from memory.
  • If the data is absent (a "buffer miss"), it's read from the disk and loaded into the buffer pool for future access. This approach significantly enhances performance by reducing the need for frequent disk accesses, which are comparatively slower. The buffer pool is managed by the buffer manager, which decides which data to keep in memory and when to write modified data (known as "dirty pages") back to the disk. The DBMS also implement some functionality to recover from failures. It relies on a log file, that is a file used to record every single operation made by transactions that modified the database content. The log file is continuously written in the secondary memory by the DBMS and the content of the log file is never lost. In case a failure occurs, the DBMS goes to the log file and from it he can extract the information about all the changes that were made by transactions on the database, so he is able to restore the database content. For failure that occurs in a portion of the secondary memory the DBMS provides recovery mechanism that are based on creating periodically some backup copies of the database content; so together, the most recent backup copy and log file, if a portion of the database is corrupted, restore the backup copy and then using the log file it allows the evolution of that backup copy by taking to account all the operations made by transactions.

Who generates big data? Used generated content (web & mobile), health and scientific computing, log files, Internet Of Things (sensor networks, RFID, smart meters) Big data is data whose size (large volumes of data that scale over time), diversity (heterogeneous and diverse), and complexity (both temporal and spatial) require new architectures, techniques, algorithms, and analytics that manage it and can extract value and knowledge from it (through views tailored to the target audience). In this case, data of different nature (sensors, images, videos, social stream analysis, ...) heterogeneous both spatially and temporally are integrated. Aggregation is complicated and is carried out using data fusion techniques. Data stored and historicized within a data center must be processed before being shown to users with different viewing needs.

The 5 V’

The Vs of big data are:

  • Volume : The size of stored data grows exponentially over time
  • Velocity : It is necessary for data processing to be fast to ensure timeliness, stream of data that is continuously produce and it has an impact on how we can analyse this data collection o Data continuously produces, collected somewhere and offline analysed periodically → data warehouse o Data are analysed at the time that are produces in a way that we can immediately extract the information that was hidden in the acquire data collection → Real time processing or near real time processing
  • Variety : Data can be of different format, type and structure → a single application may generate many different formats
  • Veracity : The data collected must be secure and reliable (data quality)
  • Value : Data collected must be used to create value and a business advantage

Knowledge Discovery process

The Data Science process = KDD (Knowledge Discovery in Databases) process consist of four stages:

  1. Generation → data can be generated in several ways: a. Passive recording: structured data such as transactions, sales... b. Active generation: unstructured or semi-structured data such as text, images, video... c. Automated production: context-dependent data such as that generated by IoT sensors
  2. Acquisition a. Collection: pull-based (web crawler), push-based (video surveillance and click stream) b. Transmission: transfer to a data center via fast links c. Preprocessing: integration, cleaning, elimination of redundancies
  3. Storage a. Storage infrastructure: local storage (HDD, SSD) or network storage (DAS, NAS,SAN) b. Data management: file systems, key-value data structure, column-oriented DB, document-oriented DB (MongoDB) c. Programming models: Map Reduce, stream processing and graph processing
  4. Analysis : techniques that we can perform to analyse the collect data and extract useful knowledge. a. Objectives: i. Analytical description: characterization of the dataset ii. Predictive analysis: prediction based on a generated predictive model iii. Prescriptive analysis: optimization based on the predictive model b. Methods: statistical analysis, machine learning and data mining, text mining, pattern mining, associative analysis, classification and regression, clustering (modelling done based on the data itself, division into subgroups) It is conducted by using ad hoc techniques, called Machine learning and datamining algorithms; they refer to ability to extract information from available data that was hidden in the data collection: they were implicit, previously unknown ma but are potentially useful. Extraction is automatic (not human by hand exploration because data collection is too large), performed by appropriate algorithm. Extraction information is represented by means of abstract models denoted as pattern.
  1. Selection → The initial data collection, based on the objective of analysis you want to perform a portion of the collection is selected.
  2. Preprocessing → Selected data are preprocess to address some possible issues available in the collection.
  3. Transformation → At this point data are ready, they are transformed into a data representation that is suitable for the algorithm apply.
  4. Machine learning/data mining → The data analysis is applied, so algorithms are run.
  5. Interpretation → The information is extracted in form of patterns and must be analysed typically with the support of a domain expert to understand the possible impact and how they can be used

Preprocessing

The aim is to generate preprocessed data that have a good quality; without good quality data, no good quality pattern. The preprocessing phase is divided into two micro-phases: a. Data cleaning i. Reduced the effect of noise, so errors like wrong values acquire from sensors because it was not working properly in a limited time window ii. Identifies or removes outliers; even if in other context the outliers are object of analysis iii. Solves inconsistencies b. Data integration i. Reconciles data extracted from different sources ii. Integrates metadata iii. Identifies and solves data value conflicts iv. Manages redundancy At least 80-90% of their work involves not machine learning, but: working with experts to understand the domain, assumptions, questions, trying to catalog and make sense of the data sources, wrangling, extracting, and integrating the data, cleaning the wrangled data.

Techniques of analysis

Association rules → is a technique that can be used on data of any nature and involves extracting frequent correlations or patterns from a transactional database. It provides a readable pattern An association rule consists of two parts:

  • Support: percentage of record that contains both objects
  • Confidence: Indicates how strong the implication is. Of the records that contain the information on the left of the association, the percentage of those that also contain the information on the right. Classification → is a supervised learning approach. It begins with a training set of data objects, where each object is described by a set of attributes and one special attribute called the class label.

To compensate for these shortcomings, AI algorithms are being developed within the Of explainable AI. These algorithms are based on decision trees, which are inherently "clearer" and have several aspects that make them "clearer" than traditional algorithms:

  • Use of decision trees: inherently more readable
  • Model explanation: comprehensive understanding of how the model works
  • Explanation of individual predictions: explanation of why a specific prediction was made
  • Selection of interpretable features: introduction of criteria based on interpretability in the pattern design There are two types of bias-related attributes in a machine learning algorithm:
  • Attribute Bias: a directly discriminatory attribute (gender, nationality)
  • Proxy attribute: is an indirectly discriminatory attribute (ZIP code, from which the nationality of residence is traced) Interpretability in machine learning : One way to improve reliability is to run multiple models in parallel, comparing their results against a reference solution, which provides a benchmark for the accuracy of other approaches. Machine learning algorithms are designed to learn patterns from a training dataset. However, if the dataset is not representative of real-world scenarios, the resulting model may fail to perform as expected when applied to new data. Privacy is another important concern. Even when data are anonymized, privacy risks can arise. While analysing individual records in isolation may preserve anonymity, patterns extracted from a full dataset can sometimes reveal sensitive information. For instance, aggregated data on pollution in different districts could unintentionally expose critical details about specific areas. Finally, it is important to note that while the initial datasets may be openly available, the analyses derived from them are often not publicly shared, which can limit transparency and reproducibility

Data warehouse introduction

A Data Warehouse (DW) is a centralized repository of historical, integrated, and consistent data, designed to support decision-making processes. It stores data in a way that allows managers and knowledge workers to easily extract reliable information for analysis and forecasting. Data warehousing refers to the entire process of collecting relevant data from a company’s operational systems, transforming and integrating it, cleaning it from errors and inconsistencies, and loading it into the data warehouse. Once stored, this data can be used to answer complex queries and perform multidimensional analyses. The rise of data warehousing emerged from the massive accumulation of data over recent years and the difficulty of extracting the truly valuable information from it. The key idea is to separate analytical processing (OLAP) from transaction-oriented processing (OLTP) by creating a repository that integrates raw data from multiple sources, organizes it in an appropriate form, and makes it available for planning, evaluation, and decision support. A Decision Support System (DSS) consists of the techniques and IT tools that allow companies to extract insights from stored data. DSSs enable in-depth analysis, supporting faster, more accurate, and more effective decision-making. Developing a DSS presents several challenges, including managing large volumes of data, accessing diverse sources across heterogeneous platforms, enabling multi-user access for queries, real-time analysis, and simulations, and maintaining historical, non-volatile data. A data warehouse is subject-oriented, focusing on the key concepts relevant to the organization. It can be considered a read-only database, as the sophisticated transaction management required for operational databases is not necessary. Unlike relational databases, which handle transactional queries that read and write small numbers of records across simple relationships ( OLTP ), data warehouses support analytical processing ( OLAP ). OLAP involves dynamic, multidimensional analyses that scan large volumes of data to produce summary metrics reflecting the company’s performance. In short, a data warehouse is a specialized database maintained separately from operational systems; this is done to support different activities, different granularity level, for higher performance (complex queries reduce performance of operational transaction management, different access methods at the physical level) e for better data management (missing information, data consolidation, data quality).

Data analysis

It is possible to analyze the data according to different techniques:

  • OLAP analysis: calculation of complex aggregate functions
  • Data analysis using data mining techniques
  • Presentation: structured representation of research results using different types of representation tools
  • Motivation research: exploration of data through insights (drill down: increasing accuracy years>months>weeks>days)

Data warehouse architectures

It is a two layer architecture:

  • External data sources
  • Data warehouse domain Principal structures:
  • Data sources : heterogeneous sources outside the warehouse (corporate SIs, tweets, excel)
  • Enterprise Warehouse : contains both data modelling and OLAP structures that are used to interact with the data
  • Data mart : departmental subset focused on a predetermined area, can be fed from the DW (physical copy of a part of the DW) or fed directly from the sources (it is itself a part of DW). Requires careful design so as to avoid future integration problems
  • OLAP server : can be of different types: o Relational OLAP servers (ROLAP) based on relational database that are extended for support the analysis made on the data warehouse (compact representation for sparse data, empty cubes are stored); supports SQL extensions for aggregate computation and specialized access methods which implement efficient OLAP data access; does not have the constraint on normalization and can have redundancies → preferred o Multidimensional OLAP servers (MOLAP); the data representation is typically proprietary (it is not standard) matrix format and sparse data require compression (sparse data require compression, it is useful for very dense data). With this approach the hyper cube is already there; with the previous approach we had to rebuild the cube by joining the fact table with the dimension tables o Hybrid OLAP (HOLAP): relational/multidimensional storage and multidimensional/relational reading
  • ETL tools ( Extraction, Transformation and Loading ): ETL is the process of preparing data to be introduced into the DW and is performed both at first populating and periodic updating. The ETL process consists of 4 steps: o Extraction : data acquisition from sources. Static extraction occurs when the data warehouse (DW) needs to be populated for the first time and conceptually consists of a snapshot of the operational data. Incremental extraction is used for periodic updates of the DW and captures only the changes that have occurred in the sources since the last extraction. Incremental extraction typically relies on the logs maintained by the operational DBMS. If operational data are associated with a timestamp identifying the moment of insertion or modification, this can be used to simplify the extraction process. Extraction can also be source-driven, when it is possible to modify operational applications to asynchronously notify changes as they occur, or when triggers can be implemented in the operational database to track relevant data modifications. The choice of which data to extract is mainly based on data quality. o Cleaning : operations aimed at improving data quality (consistency and correctness). The main data- cleaning functionalities found in ELT tools include correction and standardization, which use specialized dictionaries to fix spelling errors and recognize synonyms, and rule-based cleaning, which applies application-domain rules to establish the correct correspondences between values. The main data-cleaning functionalities found in ELT tools include correction and standardization , which use specialized dictionaries to fix spelling errors and recognize synonyms, and rule-based cleaning , which applies application-domain rules to establish the correct correspondences between values. o Transformation : conversion of data from operational to DW format (integration); conversion and normalization, which operate both at the storage format level and at the unit-of-measure level in order to standardize the data. Matching establishes correspondences between equivalent fields in

Finally, the analysis level enables efficient and flexible consultation of the integrated data for reporting, analysis, and simulation purposes. This requires the ability to navigate aggregates, optimize complex queries, use advanced indexing techniques, and provide user-friendly visual interfaces. It has several advantages:

  • Decoupling from sources: ability to handle data external to the OLTP system
  • Ease of handling different temporal granularities of operational and analytical data
  • Separation of transactional and analytical load
  • Needs to carry out data preparation "on the fly," if the operation fails you have to start over from the beginning, so the time needs to be quite short Three levels (sources, feeds, DW) → The third level introduced in this architecture a staguing area, the so-called reconciled data level, also known as the operational data store ( ODS ). It acts as a transit area and allows the separation of ET processing from L-loading by allowing complex data transformation and cleaning operations. This level materializes the operational data obtained after the integration and cleaning process of the source data, producing data that are integrated, consistent, accurate, current, volatile, and detailed. The data warehouse (DW) is then fed not directly from the sources, but rather from the reconciled data. On the other hand, however, this architecture introduces further redundancy. There is also a hybrid approach, which sits between the single-level and two- or three-level solutions. In this model, it is assumed that users may want to access source data starting from aggregated data, a process known as drill- through. To enable this, some queries must obviously be rewritten to operate on the sources—or on the reconciled data, if available. The term data mart refers to a subset or aggregation of the data contained in the primary data warehouse (DW), including all information relevant to a specific application area. Data marts fed by the primary DW are called dependent and represent a very useful resource as building blocks during the incremental development of the DW. They help define the scope of the information needed by a particular type of user for their queries and, being smaller than the primary DW, allow for better performance. In some contexts, it is preferable to adopt an architecture where data marts are fed directly from the sources, in which case they are called independent. While the absence of a primary DW simplifies the design phase, it creates a complex access pattern and increases the risk of inconsistencies between data marts. Sometimes, even while

maintaining the independence of the data marts, it is preferable to create a central DW: in this case, the DW is fed by the data marts and can be queried directly, simplifying the overall access pattern.

Representation of DWs

Multidimensional representation → In conceptual level data are represented as an hyper cube with three or more dimensions in which the directional axes are the entities involved and each intersection contains one or more measures (quantity, amount, ...) related to those given coordinates.. Measures on which analysis is performed: cells at dimension intersection. The basic idea is to view the data as points in a space whose dimensions correspond to the various possible aspects of analysis. Each point, representing an event that occurred within the company, is described through a set of measurements relevant to the decision-making process. The multidimensional model starts from the observation that the objects influencing the decision-making process are real-world business facts. Clearly, there are far too many events to analyze individually. To facilitate their selection and grouping, these events are imagined as points in an n-dimensional space, whose axes—called dimensions of analysis—define different perspectives for their identification. For example, sales in a retail chain can be represented in a three-dimensional space, with the dimensions being products, stores, and dates. For shipments, the dimensions might include product, shipping date, order, destination, and method. Events correspond to the cells of a cube, with the edges representing the dimensions of analysis. If there are more than three dimensions, this is referred to as a hypercube. Each cell of the cube contains a value for each measure. For example, if the dimensions of analysis are store, product, and date, an event corresponds to the sale of a particular product in a specific store on a specific day and is described by two measures: the quantity sold and the revenue. The cube is sparse, meaning that many possible events do not actually occur; clearly, not all products are sold every day in every store. Ex. The number 3 can be the total income in product at the shop in that date. A multidimensional cube is centered on a fact of interest for the decision-making process. It represents a set of events described quantitatively through numerical measures. Each axis of the cube corresponds to a possible dimension of analysis, and each dimension can be viewed at multiple levels of detail, defined by attributes structured in hierarchies. We must aggregate the original data collection some other properties that represent the abstract level. For ex. The shop is located in a particular city, district, country. This path represents the outcome in an increasing abstraction level. the shop on the same district can be collapsed together for compute the total income for same product type in a semester; this generates a mega cell. This generation corresponds to an aggregation operation where the aggregation pattern climbing the dimensions used to describe the basic events; the fact that we aggregate some basics event can facilitate the vision of the analysis. The techniques for reducing the amount of data to obtain useful information are essentially two: restriction and aggregation. Restricting data means selecting a portion of the cube, narrowing the scope of analysis. In relational algebra terms, this corresponds to performing selections and/or projections. The simplest form of restriction is slicing, in which the dimensionality of the cube is reduced by fixing a value for one or more dimensions. For example, consider a sales cube. If a value is fixed for one dimension, such as store = 'DiTutto', the result is the set of events associated with sales at the DiTutto store. Metaphorically, this is like a plane—a “slice” of data that can be easily visualized in a spreadsheet. If two dimensions are fixed, for instance store = 'DiTutto' and date = '5/4/2001', the result is all sales of distinct products at DiTutto on April 5th (around 100 events); graphically, this is the intersection of two perpendicular planes, or a line. Finally, if all dimensions are fixed, a single event is identified, corresponding to a point in the three-dimensional sales space.

o Technology: it is necessary to design the system architecture (hw), and they have to select which software products to use (sw) o Data:

  • Conceptual design: dimensional modelling by which analysis dimensions, metrics, and hierarchies of analysis dimensions are to be defined
  • Physical design: description of how tables should be developed
  • Design and development of ETL processes (initial and periodic loading) o Applications : specification and development of report generation applications, Interactive data exploration and processing using data science techniques
  • Implementation : the system is deployed, during use, new requirements that have not been considered for which you go back to the design stage The design of a data mart follows the following steps:
  • Source characterization : sources can present themselves as a textual description, a logical model, or an ER model
  • Reconciliation : consists of a comprehensive view of sources
  • Conceptual design : creation of the DW model based on user requirements, the resulting multidimensional model contains the analysis dimensions, measures, and different hierarchies on the dimensions
  • Logical design : development of a denormalized logical schema (containing the tables and the relationships between them) that takes into account the volume of data related to the queries that will be executed on the DW to predict an optimized system
  • ETL process design : produces a feed pattern more composed of scripts
  • Physical design : definition of ancillary physical structures that can reduce operation execution time (indexes to reduce read time and materialized views to reduce group by and join processing time)

Requirement analysis

The requirements analysis consists of conducting targeted interviews with system users (business users) and those who hold source information (information system administrators and choosing one or more data marts that will be part of the pilot project. The data marts chosen must be strategic by predicting an economic return for the company and must be fed from a few reliable sources. We distinguish between two types of requirements:

  • Application requirements : (facts, dimensions, and temporal granularity) describe the events of interest, history interval, and workload that characterize the data related to the sector of the company in which we want to implement the data mart, analysing the dimensions of interest
  • Structural requirements: o Periodicity of feeding: how often data are transferred from the sources to the DW

o Available space: estimating the space required by the DW while also considering the sparsity of data and space provided to ensure greater efficiency offered by the physical design (ancillary structures such as indexes and materialized views) o Type of system architecture: the choice of the number of layers is related to the complexity of the ETL process and the volume of data to be transferred periodically o Deployment planning: project start-up phase followed by a training phase for system users

Conceptual design

Conceptual design is the high-level representation of how data are organized; the ER model is superseded because it is too rigid and strongly tied to normalization. We use the Dimesional Fact Model , which defines fact patterns that model facts, dimensions, measures, and hierarchies, and is a graphical model that provides useful documentation for reviewing requirements and for understanding in retrospect the reasons for choices made.

  • Fact: is an element that models a set of relevant events (sales, shippings, complaints) and it evolves with time → box
  • Dimension: describes the analysis coordinates of a fact (e.g., each sale is described by the sale date, the shop and the sold product) and it is characterized by many, typically categorical, attributes; represent an n:n relationship
  • Measure : describes a numerical property of a fact (e.g., each sale is characterized by a sold quantity) and it aggregates are frequently performed on measures
  • Hierarchy : represents a generalization relationship between a subset of attributes of one dimension and represents a 1:n relationship. Each white dot represents a dimensional attribute; the closer it is to the fact, the more specific it is considered to be. Each dimension can have a set of associated attributes. The attributes describe the dimension at different abstraction levels and can be structured as a hierarchy. The hierarchy represents a generalization relationship among a subset of attributes in a dimension (e.g., geografic hierarchy for the shop dimension). The hierarchy represents a functional dependency (1:n relationship). They represent the possible aggregation pattern: to the root (shop) from the leaf node (country). Along this pattern some properties are verified. The shop is totally included in a region, a region is totally included in a country, so the inclusion property is verified. The city can include more shop, the region can include more city and the country can include more region. The same city is not totally included in a sale district so a new pattern is generated → there can be more patterns By exploring the dimensions, you can identify possible aggregation (collapsing basic events).