scieee AI-readable full text Open interactive document viewer

Data Centralization For Netflix

Zaher, Abdallah Ali

Abstract

Presently, the amount of data produced every day is truly mind-boggling. There are 2.5 quintillion bytes of data created each day at this current pace and companies are actively generating and collecting it. This data has become of the utmost importance and companies are changing their behavior towards it. Many of these companies nowadays are giving more consideration and time investment into the data analytics area. They have started to figure out a way on how to use their customers’/clients’ data to generate insights and strategies for better futuristic marketing approaches. In order to have a better understanding of the data, these corporations took the initiative to centralize it in an arranged manner so that the analysis will be more organized through the whole procedure. The following internship report studies the transformation of data from its very early stages to the final PowerBi part. This report will discuss specifically the ETL process that the data undergoes from how the data is collected via SSIS packages, treated through T-SQL, and provided as a clean final table to build a PowerBi report from it so that other employees and people who do not have much knowledge about data will be able to see through graphs that explain what the data means and what insights it holds within.

Full text

1 Data Centralization For Netflix Abdallah Zaher Internship report presented as partial requirement for obtaining the Master’s degree in Advanced Analytics 2 NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Universidade Nova de Lisboa Data Centralization for Netflix by Abdallah Zaher Internship report presented as partial requirement for obtaining the master’s degree in Advanced Analytics Advisor / Co Advisor: Mauro Castelli Co Advisor: Victor Juaregui October 2021 3 ACKNOWLEDGEMENTS Special thanks to stack overflow for making the impossible possible. 4 ABSTRACT Presently, the amount of data produced every day is truly mind-boggling. There are 2.5 quintillion bytes of data created each day at this current pace and companies are actively generating and collecting it. This data has become of the utmost importance and companies are changing their behavior towards it. Many of these companies nowadays are giving more consideration and time investment into the data analytics area. They have started to figure out a way on how to use their customers’/clients’ data to generate insights and strategies for better futuristic marketing approaches. In order to have a better understanding of the data, these corporations took the initiative to centralize it in an arranged manner so that the analysis will be more organized through the whole procedure. The following internship report studies the transformation of data from its very early stages to the final PowerBi part. This report will discuss specifically the ETL process that the data undergoes from how the data is collected via SSIS packages, treated through T-SQL, and provided as a clean final table to build a PowerBi report from it so that other employees and people who do not have much knowledge about data will be able to see through graphs that explain what the data means and what insights it holds within. KEYWORDS Centralize, Data transformation, ETL process, SSIS packages, T-SQL, PowerBi report. 5 INDEX 1. Introduction .................................................................................................................. 1 1.1.1. Company Overview ........................................................................................ 3 2. Problem overview ......................................................................................................... 5 2.1.1. Case Study ...................................................................................................... 5 2.1.2. Governance Model ......................................................................................... 6 2.1.3. Raw Data......................................................................................................... 9 2.1.4. KPIs ................................................................................................................. 9 2.1.5. Expected Output ........................................................................................... 11 3. Practical solving .......................................................................................................... 12 3.1. First Solution ........................................................................................................ 12 3.1.1. SSIS Flow ....................................................................................................... 12 3.1.2. Mapping and Processing .............................................................................. 15 3.1.3. Problem Solution .......................................................................................... 18 3.2. Second solution ................................................................................................... 19 3.2.1. Problems and Prerequisites ......................................................................... 19 3.2.2. SSIS Flow ....................................................................................................... 22 3.2.3. Flat File Source ............................................................................................. 22 3.2.4. SQL Source .................................................................................................... 23 3.2.5. Job Creation .................................................................................................. 24 3.2.6. Advantages of The Second Solution ............................................................. 24 4. Features to add ........................................................................................................... 26 5. Reporting .................................................................................................................... 27 5.1. Summary .............................................................................................................. 27 5.2. Trend .................................................................................................................... 28 5.3. KPI ........................................................................................................................ 29 5.4. Glossary ............................................................................................................... 30 6. Conclusions ................................................................................................................. 31 7. Limitations and recommendations for future works ................................................. 32 8. Reference .................................................................................................................... 33 6 LIST OF FIGURES Figure 1 – Cycle of Customer Experience .................................................................................... 3 Figure 2 – Governance model structure. .................................................................................... 6 Figure 3 – Introducing the interconnectivity between all the AD layers. ................................... 7 Figure 4 – Showing different types of users regarding assignment employees to AD Groups. . 8 Figure 5 – Showing different accesses of users regarding their AD Groups. ............................. 8 Figure 6 – KPIs that were built for this specific project. ........................................................... 10 Figure 7 – A scheme of the SSIS loop components from control flow to data flow. ................ 13 Figure 8 – Example of a code for duplicate check procedure. .................................................. 14 Figure 9 – A scheme of the entire SSIS integration process. .................................................... 15 Figure 10 – SQL table showing an example of how the data is being calculated. ................... 15 Figure 11 – A scheme to show pivoting transformations. ........................................................ 16 Figure 12 – Table showing the distribution of components and their values per KPI. ............. 17 Figure 13 – Table showing each KPI with their Numerator and Denominator Values. ........... 17 Figure 14 – Table to provide the DEs for all necessary factors to create the process. ............. 20 Figure 15 – Portion of the table structure. ............................................................................... 20 Figure 16 – Creation query result. ............................................................................................ 21 Figure 17 – Showing the SSIS Data Flow. ................................................................................. 22 Figure 18 – Revealing a summary for the calculated KPIs. ...................................................... 27 Figure 19 – Drill down one of the KPIs. ..................................................................................... 28 Figure 20 – Bar chart showing the trend per LOB, KPI, Country, Site, and Language. ............. 28 Figure 21 – Graphs to compare multiple KPIs. ......................................................................... 29 Figure 22 – Glossary for all measurements used in the project. .............................................. 30 7 LIST OF ABBREVIATIONS AND ACRONYMS AD Group Active Directory Group KPI Key Performance Indicator TP Teleperformance DBA Database Administrator CSR Customer Service Representative CSV Comma-Separated Values SP Stored Procedure HR Human Resources SSIS SQL Server Integration Services LOB Line of Business PDR Planning, Development & Review DE Data engineering 1 1. INTRODUCTION “Big data is currently a hot research topic, with four million hits on Google scholar in October 2016. One reason for the popularity of big data research is the knowledge that can be extracted from analyzing these large data sets (B. Nelson 2016)”. With this progressive enhancement, scientists had to adjust to the way they treat big data. In the beginning, big data was just an analogy. There was no clear explanation to what makes data “BIG”. Because big data is everywhere, there is almost an urgent need to collect and preserve whatever data is generated. “In recent years, big data is flourishing, exceeding the traditional data processing methods with 5 'V' characteristics (M. Shabana & K. Sharma (2021)”. Throughout the years, there has been a developing comprehension of the job that huge information can play in conveying inestimable experiences to an association, uncovering qualities and shortcomings, and enabling organizations to improve their practices. Large information has no plan, is non-critical and non-hardliner – it essentially uncovers a depiction of action. However, while numerous associations comprehend the significance of information, not many are yet seeing its effect. “Another examination entitled Broken Connections: Why investigation still cannot seem to be taken care of makes the case that 70% of business leaders recognize the significance of deals and advertising investigation, yet just 2% say that their examinations have accomplished a wide, positive effect (LINDELL, JIM 2020)”. This discovery focuses on the requirement for Enormous Information to be taken care of by re-appropriated firms who spend significant time in examining the information created by organizations and who can offer genuine, noteworthy experiences. In the foreword to his report, Dan Weatherill composes that "Our study and follow-up interviews with almost 450 U.S-based senior chiefs from enterprises including drugs, clinical gadgets, IT, monetary administrations, telecoms and travel and accommodation affirmed one thing that we definitely knew: hardly any associations have had the option to hit the nail on the head and to produce the sort of business sway that they had expected." 2 As mentioned before, this thesis took the inspiration of how organized data flow can ease the construction of integration processes. To start with, a plan should be constructed to know the targeted audience, the data providers, and how the staging organization will take place. As a result, the governance model was essential to provide accesses and limitations based on which AD group the user belongs to. After creating these AD groups, the time comes to go through the requirements. For example, the kind of data provided should be defined, as well as the creator, and enumerate to whom it will be appointed to. Based on that, one will have a clearer vision to acknowledge the grant access levels. An expected output will be drawn as a first draft for the final solution. After going through all the previous points, the light should be shed on the data now. The more one understands the data they are willing to transform, the more the integration process will go smoother. The dimensions and the fact tables will be created accordingly, and then the results will be stored in the fact table to be provided for the PowerBi report. With this thesis, one will be able to go through all the steps in detail for a better understanding of how the process was built to the delivery stage. 9 2.1.3. Raw Data Before diving through the process, a definition for raw data is required. Raw data alludes to any information question that has not experienced careful preparation, either physically or through automated computer programs. Raw data may be assembled from different forms and IT assets. As a result of this definition, understanding the data that is being issued is considered one of the primary keys before development. In this part, if a clear understanding of the type of data the clients or DAs supply, it will not only ease the development, but it will save an abundant amount of time and effort, so the same job will not be done twice and maybe more due to the redundancy of the data that is there. With a meeting or just viewing a portion of data can be considered as an option. A meeting was scheduled with the DA responsible for this project which allowed for the review of this data. It was acknowledged that the data was coming from three different sources, Excel files, CSV files, and SPs from the current server or even through a linked server. 2.1.4. KPIs “KPI stands for key performance indicator, a quantifiable measure of performance over time for a specific objective. KPIs provide targets for teams to shoot for, milestones to gauge progress, and insights that help people across the organization make better decisions. From finance and HR to marketing and sales, key performance indicators help every area of the business move forward at the strategic level (J. Morrow 2020).” These KPI measurements are usually submitted by the DAs. Based on these formulas, the KPIs are calculated on the backend side. Later in this report, more details will be covered on how these KPIs were being computed. 10 Figure 6 – KPIs that were built for this specific project. These KPIs are divided into 6 different group categories, each category takes insights from the data in a different perspective. Here is the list of the ones that were used: • Operational: a discrete estimation that a company employs to screen and assess the effectiveness of its day-to-day operations. • WFM: Workforce management reporting for modern businesses. • Forecast: Forecasting KPIs and performance measures is about finding leverage. And that is why building a forecasting model for a KPI, or performance measure is so valuable: it makes a difference when an impact is found. • Shrinkage: This KPI is utilized to measure the rate at which the esteem of stock has been diminished due to loss, burglary, or wrong record keeping. • Quality: A quantitative measure of data quality. A data quality measurement system measures the values for the quality of data at estimation and focuses on a certain recurrence of measurement. • Financial: A leading high-level measure of revenue, expenses, profits or other financial outcomes. 11 2.1.5. Expected Output After going through all the initial steps to decide on the expected output, now is the time to move forward discussing it. But before continuing, a deliberation needed about integrating the data files first from their initial files to SQL to check how to store the data and in which format. Because there was a close deadline for the project, going with the most trivial solution was mandatory to transform the files into a table. As a result, the significant and suitable proposition is to have a “Star Schema” to produce a final fact table with all the columns used to calculate the KPIs mentioned before. This solution will provide all the data needed without affecting the deadline. 12 3. PRACTICAL SOLVING In this part, two solutions will be provided. The first one is the one that was adapted primarily. Because some issues were faced, and a more generic solution was needed, another solution was established. A detailed explanation is supplied to reveal the hows and the whys. 3.1. FIRST SOLUTION 3.1.1. SSIS Flow First, what does ETL mean? ETL stands for Extract transform and load. “An ETL device extracts the information from unique RDBMS source structures, transforms the data by making use of commercial enterprise common sense, concatenate, and so on (Raghuraman 2021)”. In this part, it will be explained in detail the steps set up to transform the data from their initial state to the database. After creating the SSIS Solution, one can check the file, its location; if accessible or not, take a quick look at the file to have a rapid scan of what are the columns, if there exist multiple sheets, and importantly if it is corrupted or not. After that, a server connection is created, and of course tested to check if it is built between the SSIS and the corresponding database. But because there is potential for more than one file to be executed, one is able to create a foreach loop to go through all the files placed in their respective folder. In that loop, a data flow is placed. There are only two options in this case with these kinds of dataflows; one with a flat file source and this indicates that the file that is being processing are type csv or excel source file on which it has any of the excel extensions (xlsx, xls, xlsm …). Another source of data is existing data in other databases/servers (which will be discussed later in this thesis). As a result, after specifying the data source type, data should be loaded into its specific table. For governance and security reasons, a schema was created specifically for this project so the employees 13 who need admittance to these tables can be granted access to this schema and not the whole database. These tables will be created on spot after mapping the file in SSIS. The primary keys of these tables were created with the assistance of the DAs for their knowledge with these extractions. And after finalizing this step, the first part of the data flow is done. After that, a SQL task is introduced to the control flow to make sure that the data is clean and grant credibility of the stored data. The aim of using such procedures is to ensure that the specified key do not overlap and store duplicate values in the tables and therefore wrong measures. These procedures operate by selecting the data first and inserting them into a processing table. Then check the key with the FACT table, if a match happens then update the data otherwise upload it as is. After the procedure gets executed, the file is now removed to an archive file with the same format but with today's date added to its name to keep track over the files processed and to help re-track errors if it is the case and to prevent files from overlapping. Figure 7 – A scheme of the SSIS loop components from control flow to data flow. 14 And here is an example of how the SQL task is configured: Figure 8 – Example of a code for duplicate check procedure. This process is done for all the folders that provide raw data files. After the data gets stored in the processing tables, then a procedure is executed and measurements are calculated. 15 Figure 9 – A scheme of the entire SSIS integration process. 3.1.2. Mapping and Processing A mapping file is then provided by the DA responsible for this project. In this file, one can determine what are the KPIs that need to be calculated and the components needed for these measurements to be generated. These mappings are then stored in a table to be used in the cube metrics. In this definition table, the measurements are specified based on a type (addition, subtraction, division, and/or multiplication). So, the type is provided for the operation as well as the components to be calculated. Figure 10 – SQL table showing an example of how the data is being calculated. In Figure 10, one can see that the type of this operation (type 1) is summation for only one component. 16 After the files have been integrated into their respective tables, a stored procedure is created to join all the data in one FACT table. 3.1.3. Fact table This part will cover thoroughly how the process was built, how it functions, and what are the challenges that were faced with coding or data itself. Starting with how this process was built, and after knowing how the dimensions look, the ideal strategy was to see how to combine all the data found into a global table that contains all the columns required to measure the requisite KPIs. As a first step, all the data was saved in temp tables, and because one needs to separate the columns that are needed for calculations and the others that will be used for joins later, pivoting must be used to achieve that goal. Pivoting is a mechanism used to transform columns into rows. So, with this, now multiple datasets have almost the same key but with different field values. After this transformation is completed, one can unite all the tables based on the key and obtain fields that have the names of the columns and field values that possess the values stored in that column. As a result, one can obtained a table in which all the columns are separated with their respective values. Moving to the next step, the same is performed but with the definition table that was mentioned before (3.1.2. Mapping and Processing Figure 11). These two tables share the same structure, one for the data and the other for the component distribution. Figure 12 – A scheme to show pivoting transformations. After collecting the two tables, one is able to join based on the field column. Although it is known that this solution was not the optimal because the join is based on a “String” column, and indexing 17 cannot be performed over a varchar; but this was the most suitable one in this case and the only available column to do the join on. As a result, all the columns from idkpi are collected and needed to calculate each KPI separately, in addition to the components which will be used with their respective values. (The two rows in fig11 are now a combined row) In the next step, pivoting is implemented to the table again on the components. The column component now will be transformed into multiple columns and each cell in that column will possess its particular value. Figure 13 – Table showing the distribution of components and their values per KPI. After the previous transformation, a query is executed to do the calculations per KPI. this query operates by selecting the components and their values. Once established, the query can be passed to the descriptions found in Figure 12. These are SQL statements that intend to swap the values of the components and sum them instead. Later in this process, couple of tables are joined to append other ones needed to calculate more KPIs, additionally to provide option to calculate the extra columns requested by the DAs. With that being said, and after all the requirements are fulfilled to evaluate the final table, these tables are joined all together based on their [Date] and other components. One can then delete the values based on the minimum date in the table and push the data to the final fact table. Figure 14 – Table showing each KPI with their Numerator and Denominator Values. 18 3.1.4. Problem Solution Regarding this method, a lot of problems were encountered with the files, data, and their values. Some of the files were uploaded with many problems, sometimes the sheet name changes, and this will affect the mapping because once an excel file is mapped in the data source, the excel sheet name is specific and if it is not there, the data flow will crash. Another problem was the delimiter; sometimes the delimiter either changes and messes up with the distribution of the data with their columns, or some cell values contains the delimiter; for example, if the delimiter is a ‘,’ and a cell has some values with ‘,’ like specifying a list, then the values for the consecutive columns will be absolutely wrong. Regarding the values, extra checking was performed when inserting them from the processing schema to their dimensions by replacing spaces by empty space and commas to dots. Another problem was faced with date format, some files had different formats; sometimes dd/MM/YYYY and others MM/dd/YYYY and this would lead to KPIs’ miscalculations, so unifying the date format with the DAs was a must. Occasionally, some columns might share the same name in different tables/files, and because the join is based on the column name, the values might overlap and conduct false values. As a solution for that, an additional letter was added to the end of the columns per file which leads to distinctive names, and this will not be an issue anymore. Integrating the whole file will be excessive use of space in the server so a decision was taken to go with the components that are needed to conduct these measures. This option was catastrophic for calculation, but it was acknowledged once the comparison between the raw data and the data that was stored in the database took place. The reason why is because now multiple columns might share the same values and on joining them, a lot more will be missed. As a proposition, an increment row number was added for every file to keep all the columns, and eventually this issue will not be faced anymore. With that now the first solution was ready to go live. 25 deleting the single temp table created, a script will be executed to check the dates of the files that were integrated and delete those that their dates exceed a week to reduce space on the shared server. And thanks to the PDR files, a significant reduction of errors was detected mostly because the DAs are now responsible for filling all the information needed for the file to be integrated. (They are more in contact with the client and more aware of the scenarios that might be face in the future). Not only that, but the margin of errors was minimized especially with the date formats, because some files might come with mm/dd/yyyy format and other might be dd/mm/yyyy. The fact table will therefore lack integrity. As a result, with these PDRs, the DAs specify the format of the date type, so in case any file shared different format, it should be checked. A nice feature was adapted to the new solution which is the ability of adding extra columns that will be added manually to the data flow. For example, if someone wants to create a new column based on concatenating multiple columns, it is possible by specifying that in a SQL code and adding it in the table which will serve its purpose. This diagnostic process allowed multiple files that share the same columns but in a different order to be processed together. The manual mapping will not be needed because the generic temp table created will match later with the column name which is in the header of the file. Not only that, but the process was finalized by eliminating the user intervention and creating scheduled jobs. All what needed is to monitor the job activities and make sure everything is working smoothly. 26 4. FEATURES TO ADD After finalizing this solution, some features can be included to achieve more stability and integrity to the data. Adding a table to keep track of the rows and columns count with their integration date is a constructive idea. This will ensure the data integrity and will apply to an integration error if these numbers were not matching. This idea can be extended by creating a PowerBi report that will keep track of the jobs. While testing the integration process, a bug was found and needs to be fixed. This scenario occurs if the file was type csv. With this specific type, a delimiter should be defined. However, if the file has only 2 columns, this delimiter is hard to catch in the C# script which might lead to wrong data integration. In addition, if a file has no key, a method should be created to handle this. A way of fulfilling that is by selecting the date range in the file, deleting data from the respective table with the same date range and merge the data from the file to the table. After merging and executing of the jobs, an email can be sent with the status either completed with success or failure, with the error and the extension id so follow up can be performed. In case of job failure, insert into a table the exception that was thrown while executing that job to have a sort of idea what are the exceptions that are being generated. 27 5. REPORTING 5.1. SUMMARY Figure 19 – Revealing a summary for the calculated KPIs. According to Figure 18, the bar chart shows the distribution of targets per LOB. Moreover, as a user, one not only has the ability to drill down through these targets on a level more than LOB itself, but also through the KPIs that are dedicated to it. All of these data are selected based on dates so there is the potential to choose what to look at and check the target deviation. On the bottom right there is the scale that will assist the user to differentiate between these deviations for a better understanding. In addition, if one presses on any of these KPIs, it will show the distribution per language. 28 So, for example if the desired case is to study the absenteeism LOB, all what has to be done is click on it and it will show something like Figure 19. Figure 20 – Drill down one of the KPIs. All of these data are provided by the final table that was already induced before. 5.2. TREND Figure 21 – Bar chart showing the trend per LOB, KPI, Country, Site, and Language. 29 5.3. KPI Figure 22 – Graphs to compare multiple KPIs. In this part, a request was demanded to provide a way to compare multiple KPIs at once with specificities regarding languages and sites. This request was for the group to keep track of all these different sites at once and to check for problems or futuristic risks in any of the sites/languages. As seen in Figure 21 above, the comparison here is between absenteeism, adherence and AHT. If pressed on any of the sites, the graphs will eliminate all other sites except the selected one and will show all the data regarding it. It is also feasible to choose a language and/or site to provide the users with a better understanding for whatever they are looking for. 30 5.4. GLOSSARY In conclusion, a glossary was provided in case any DA that is new to the project or even a higher ranked position colleague would like to see the source of calculations and how they are done to answer any doubt. These glossaries are based on both the KPI group and the KPI itself. Figure 23 – Glossary for all measurements used in the project. As a result of this work, the project was done. Some more KPIs might show in the future to be added but will follow the same procedure of calculation and visibility. 31 6. CONCLUSIONS The data integration project took its first baby steps in February 2021 and began with a dive into the business strategies and a better understanding of what are the requirements the DAs need. Various meetings with them were done to align expectations, and to understand their goals. Once these conditions were met, the production started with specifying the strategy it will overtake. First it began with checking the input file type, then establishing the SSIS process, and finalizing it with the final solution. After having the final fact table, a report was generated to help visualizing the results in a friendly way, helping other untechnical colleagues filter and understand the data, allowing them to narrow down for a deeper dive through the data, and developing insights to improve the market and accordingly the profit. This project permitted the utilization of numerous concepts introduced in the first year of the Master’s in Data Science and Advanced Analytics. The process was built in ETLs and SQL, a software that became familiar in the Data Storage and Recovery course. Various business approaches as well were gained throughout the process especially the part related with the KPIs and their measurements and to what the imply to. All in all, the experience was fully related to the master’s concepts and opened the gate for me to pursue a career as a data engineer. 32 7. LIMITATIONS AND RECOMMENDATIONS FOR FUTURE WORKS During the development and after achieving the essential final fact table, a lot of limitations were faced and here are some of them. The first was in case the SQL agent went down for any reason, then this requires a user interference to run all the processes manually by providing the SSIS the extension id for each file. Additionally, the files are being processed in a C# script that goes through the file, checks the type and integrate it accordingly. In case the file was a csv, a delimiter should be defined and in case the file has only 2 columns, this delimiter is hard to catch. On the other hand, some features can be included to achieve more stability and integrity to the data. A table can be added to keep track of the rows and columns count with their integration date. This will ensure the data integrity. By Sending an email with the status of the job once done, it will give the DAs a heads up about the issue so they will not have to get back to the DE department to know the status of the job and the error will be easier to be track and faster to be treated. In case of job failure, insert into a table the exception that was thrown while executing the job to have a sort of idea what are the exceptions that are being generated. 33 8. REFERENCE • B. Nelson and T. Olovsson, "Security and privacy for big data: A systematic literature review," 2016 IEEE International Conference on Big Data (Big Data), 2016, pp. 3693-3702. • Colebatch HK (2014) Making sense of governance. Policy and Society 33(4): 307–316. • H. Bhasin. (2020). What is Customer Experience Management and its Importance? • J. Dinis-Carvalho. (2020). Presentation KPI. 10.13140/RG.2.2.32344.11521. • J. Morrow (2020). Reporting Made Easy: 3 Steps to a Stronger KPI Strategy • LINDELL, JIM. (2020). Big Data History – Big Data Sources and Characteristics. 2‐1-2‐22. 10.1002/9781119784692.ch2. • M., Smallcombe. (2019) Top 5 Reasons to Centralize Data & Become a Data-Driven Business. • M.T, Raghuraman. (2021). Assessment of ETL TOOLS ABSTRACT. • M. Van Asselt, O. Renn (2011) Risk governance. Journal of Risk Research 14(4): 431–449. • S. Kameliq (2021) Advantages of Data Mining for Digital Transformation of the Educational System. • Shabana, Mahammad & Sharma, K. (2021). A STUDY ON BIG DATA ADVANCEMENT AND BIG DATA ANALYTICS. Page | i