A Comparative Analysis Of Hadoop And Spark . - Thesai

Transcription

(IJACSA) International Journal of Advanced Computer Science and Applications,Vol. 12, No. 4, 2021A Comparative Analysis of Hadoop and SparkFrameworks using Word Count AlgorithmYassine Benlachmi1, Abdelaziz El Yazidi2, Moulay Lahcen Hasnaoui3ENSAM Moulay-Ismail University, LMMI Laboratory, Institute, Meknes, 50000, MoroccoAbstract—With the advent of the Big Data explosion due tothe Information Technology (IT) revolution during the last fewdecades, the need for processing and analyzing the data at lowcost in minimum time has become immensely challenging. Thefield of Big Data analytics is driven by the demand to processMachine Learning (ML) data, real-time streaming data, andgraphics processing. The most efficient solutions to Big Dataanalysis in a distributed environment are Hadoop and Sparkadministered by Apache, both these solutions are open-sourcedata management frameworks and they allow to distribute andcompute the large datasets across multiple clusters of computingnodes. This paper provides a comprehensive comparison betweenApache Hadoop & Apache Spark in terms of efficiency,scalability, security, cost-effectiveness, and other parameters. Itdescribes primary components of Hadoop and Sparkframeworks to compare their performance. The majorconclusion is that Spark is better in terms of scalability and speedfor real-time streaming applications; whereas, Hadoop is moreviable for applications dealing with bigger datasets. This casestudy evaluates the performance of various components ofHadoop-such, MapReduce, and Hadoop Distributed File System(HDFS) by applying it to the well-known Word Count algorithmto ascertain its efficacy in terms of storage and computationaltime. Subsequently, it also provides an analysis of how Spark’sin-line memory processing could reduce the computational timeof the Word Count Algorithm.Keywords—Big data; hadoop; spark; machine learning;Hadoop Distributed File System (HDFS)); mapreduce; word countI.INTRODUCTIONDue to the advancements in computational technology,hardware resources, and fast underlying networks, the worldwitnessing an explosion of Big Data generated by social medianetworks [1], Internet of Things (IoT)[2], streaming real-timeapplications [3], banking sector [4], industrial setups, andalmost every notable R&D sector. According to [5] an estimateby a well-known online source, Social Media Today, 2.5Exabyte (1018) data is generated per day, as of 2020. This datacreation is expected to increase to 463 Exabytes per day by theend of 2025, according to Statista [6]. Consequently, itbecomes extremely difficult to handle such enormous volumesof Big Data by using traditional methods and tools [7]. Forexample, the traditional database systems administering thelegacy warehouses have become inefficient due to theutilization of conventional query tools. Venkatraman et al. [8]found multiple reasons for the failure of these tools. Firstly, thedesign of relational databases and data warehouses is notsuitable to synthesize the new types of data with respect tovolume, storage, veracity, and processing. Secondly, intraditional systems, the Structured Query Language (SQL) isutilized for communicating with databases. Thirdly, themaintenance of rational data-houses becomes very costly andunmanageable. Fourthly, traditional warehouses are based onorganizing records in fields in a structured manner, while mostof the Big Data on the Internet is unstructured by nature [9].Therefore, traditional database management tools cannotefficiently be utilized in the case of Big Data, which isexponentially growing due to the surge in the number ofInternet & social media users, and the development of newtechnologies like IoT, 5G networks, and Deep Learning (DL),etc. This entails an extremely competitive atmosphere amongtechnology companies to provide accurate data in a minimumamount of time at a low cost. It is the only concept of Big Datathat gives equal opportunity to everyone to extract the data anduse the full value from in their particular organization orconcerned field of interest. Chen et al. and Ward et al. [10, 11]more formally defined Big Data as ―a set of several structured,unstructured data generated from different formats of varioustasks with bulk volume that is uncontrollable by currenttraditional data-handling tools‖. Contrary to the conventionaldata handling tools, the Big Data analysts at Apache and theresearch community developed a very efficient framework—called Hadoop—that can process and manage huge volumes ofdata [12]. Primarily, the Hadoop (Highly Archived ObjectOriented Programming) framework spawns the input data tomultiple distributed computing nodes and provides reliable andscalable computing results [12, 13]. Bangari et al. [14] usessimple programming models based on Java language fordistributed processing of a large volume of datasets through theclusters of computers. The basic idea of Hadoop setup is to usea single server in order to handle a collection of slaveworkstation nodes in which each node contains its own localstorage and computational resources. To process and storedata, Hadoop utilizes the MapReduce algorithm, which dividesany given task into smaller parts in order to distribute themacross a set of cluster nodes [15, 16]. Sharmila et al. [17]showed another basic feature of Hadoop as is its file systemknown as the Hadoop Distributed File System (HDFS), whichis an efficient storage system for cost-effective hardware.Although Apache Hadoop remained one of the most reliableframeworks to handle Big Data within a decade after its firstrelease in 2006, its efficacy was reduced after the exponentialgrowth of streaming real-time data, Machine/Deep Learning(M/DL) technologies, and the use of graphics in online games& other related applications [18]. Bell et al. [19] overcomethese limitations by another open-source framework calledApache Spark that was developed, which incorporates diversefeatures such as better memory & storage management andmore scalability.778 P a g ewww.ijacsa.thesai.org

(IJACSA) International Journal of Advanced Computer Science and Applications,Vol. 12, No. 4, 2021The primary objective of the research were analyzing theprocessing times and file management systems of theheterogeneous environment to get better performance ofHadoop. This paper contributes by giving a comprehensivecomparison between Apache Hadoop & Apache Spark in termsof their application, scalability, reliability, security, costeffectiveness, and other features. Moreover, the discussion ofprimary components of these frameworks ascertains theirperformance. The study concludes that the Spark framework ismore useful for streaming applications, and hence it is fast andscalable. On the other hand, Hadoop has better securityfeatures, and it can handle very large volumes of data.Furthermore in this paper, a case study discusses theperformance of the Hadoop framework by implementing thefamous WorldCount algorithm. The results show theeffectiveness of Hadoop in terms of processing time andstorage required to process large dataset files. In addition, ananalysis was described by comparing these results with Spark‘sframework to determine how its features could reduce theprocessing time of the algorithm for the given files.The remainder of this paper is organized into the followingsections. In section 2, the characteristics of Big Data arediscussed in detail. Section 3 provides the related work.Section 4 discusses the major components of Hadoop. Section5 describes the WordCount Algorithm. Section 6 details theSpark framework followed by Spark Components in Section 7and its comparison with Hadoop in Section 8. Section 9describes the experimental setup and results by implementingthe WordCount application on the Hadoop cluster. Thensection 10 discusses how Spark implementation of theWordCount application could improve the execution times.Finally, Section 11 provides the conclusion and future work.II. CHARACTERISTICS OF BIG DATAThe Data grows in three dimensions—also known as the3Vs model—according to the Gartner research report; thesethree are Volume, Variety, and Velocity [10, 11]. It has beenobserved that many industries and organizations use the 3Vsmodel to analyze Big Data. However, it cannot be formallydefined by merely 3Vs, and many other characteristics alsoexist to properly define Big Data [20]. Chen et al. [10] statedthese characteristics are extended to 5Vs including the abovementioned 3Vs. These are elaborated on the basis of linespacing, and typestyles. Examples of these type styles aregiven below and are depicted in Figure 1.A. VeracityIt is one of the most important properties of Big Data toolsand is defined as data accuracy and it is quality relative to itsusers. The veracity is ensured by providing accurate and cleandata [10].B. VolumeIt may be defined as the bulk of data to be organized,stored, and processed. The data volume is exponentiallygrowing, and it is expected to grow multiple times in thecoming few decades. Chen et al. [10] Stated the currentvolume of Big Data generated per day is in the realms ofExabyte (1018).Fig. 1. The 5Vs of Big Data.C. VarietyIt refers to the various forms in which data is available tothe users. Currently, the data can be structured, unstructured, orsemi-structured[11], depending upon its organization.Moreover, it may be in the form of plain text, image, audio,video, etc., or any combination of these forms.D. ValueThis simply implies how important or critical the data is tothe user. Data value describes its beneficence for a particularorganization or individual. The ratio of the valuable data isinversely proportional to the total volume of data. Chen et al.and Ward et al. [10, 11] for instance, in an hour-long video, theratio of valuable data can be of a few seconds.E. VelocityVelocity implies the rate at which the data is retrieved, andit assists to identify the difference between normal data and BigData. The characteristic of velocity for the data warehouse is avery significant parameter in this competitive field. Forinstance, it is the velocity that plays a critical role in dataretrieval or storage at a typical social media warehouse for itsusers to efficiently use it for socializing. [10, 11, and 17] foundthat the users of Facebook, Twitter, Instagram, and otherfamous platforms expect to communicate with each other inreal-time for their everyday experience.Most of the data analysts and experts suggest utilizing avariety of open-source Big Data platforms in order to takebenefit from Big Data analytics [10, 21]. Elgendy and Elragal[22] showed these platforms offer a mixture of hardwareresources using state-of-the-art software tools for data storage,processing, analysis, and visualization. The opportunitiesgenerally vary based upon the phenomenon where data is beingutilized, and its value depends upon the type of applications.For example, in the stock exchange system, where demandsand consumption change at a fast rate, data has importanceonly for a limited period of time [20]. Furthermore, due to theenormity of data volumes and Big Data applications, itbecomes extremely tough for managers to select a single or asmall group of data platforms. Undoubtedly, the ever-growingcompetition and limited time make it inconvenient for them towork with a large number of Big Data platforms. However,they still require multiple platforms due to the demands of779 P a g ewww.ijacsa.thesai.org

(IJACSA) International Journal of Advanced Computer Science and Applications,Vol. 12, No. 4, 2021repeated and multiple task solvers [22]. Nonetheless, it can be avery useful analysis to determine an optimum set of platformsfor a given organization considering its R&D requirements andapplications.Another significant aspect of the Big Data paradigm is datasecurity concerns created during the management, storage, andprocessing of data.F. Management IssuesData is normally retrieved or stored in structured,unstructured, or semi-structured modes in variousorganizations. It is difficult to manage such diversity in data inlarge volumes.G. Storage IssuesThe data sources are diverse, and it is normally retrievedfrom social media, streaming systems, mobile signalcoordinates, sensor information, online recordings, and ebusiness exchange reports. Storing this data in various formscreates storage issues and requires standards to be properlyimplemented.H. Processing IssuesBased on user requirements, the Big Data systems areexpected to process data in volumes of Petabyte, Exabyte, oreven in Zettabyte. This processing can be real-time or in batchmode. Therefore, Big Data systems must be able to cope withuser requirements.I. Security IssuesIn government & private sectors, the data is normallyvulnerable to malicious attacks and intrusions. Therefore,organizations are expected to carry effective intrusion detectionsystems and data integrity systems in order to ensure the safetyof user data and avoid data exploitation.All the above-mentioned issues and challenges are tackledby using efficient tools like Apache Hadoop & Spark.Currently, the most widely used framework is Hadoop, and it isparticularly useful for processing large volumes of data by techgiants such as Twitter, LinkedIn, eBay, and Amazon [23]. Alot of research is performed to evaluate the performance ofHadoop, but there is a need to improve its functionality interms of its time efficiency. [16,18] Identified that Hadoop isextremely powerful in the case of storage systems due toHDFS, but it struggles to compete with Spark in the processingpart performed by its MapReduce algorithm. This workfocused on the testing of MapReduce by recording the timeelapsed by each processing step of the algorithm with variousvolumes of data downloaded in the form of data files from theInternet. The primary aim is to ascertain the performance ofHadoop compared to Spark to learn which applicationscenarios are suitable for a particular framework.III. RELATED WORKDue to the enormous amount of data generated daily, theissues of its management, storage, and processing are not onlysignificant for the academic community but also the industry.For instance, Zhao et al. [18] conducted a performancecomparison between Hadoop and HAMR based on the runningPageRank algorithm. HAMR is a new technology, whichprovides faster processing and memory utilization compared toHadoop. The comparison parameters used in the research werememory usage, CPU consumption, and running time. Shah etal. [24] observed the performance of Hadoop in aheterogeneous environment with various types of hardwareresources. They developed an algorithm called Saksham, whichenables the rearrangement of the data blocks to optimize theperformance of the Hadoop in homogeneous & heterogeneousenvironments. A region-based data placement policy isproposed by Muthukkaruppan et al. [25]. The main purpose ofthe proposed policy is to achieve high fault tolerance and datalocality, which does not exist in the default policy. A specificregion data block is placed in the contiguous data portion ofnodes in the region-based policy. Qureshi et al. [13] describedstorage media-aware policy in order to improve theperformance of Hadoop. This policy is known as the RobustData Placement (RDP), which also handles the network trafficand unbalanced workload.Meng et al. [26] proposed a strategy that places data blockswith disk utilization and network load while in default Hadoop,block placement is done by Round Robin that reduces theperformance in a heterogeneous environment. This strategyimproved the HDFS performance by enhancing the spacestorage utilization and throughput.Similarly, Dai et al. [27] presented their proposed ReplicaReplacement Policy (RRP) developed in 2017 to improve theHadoop performance by eliminating the utility of HDFSbalancer; consequently, the replica is evenly distributed amongthe homogeneous and heterogeneous nodes. This policygenerates better results of replica management as compared tothe default replica management policy of the HDFS in Hadoop.Herodotou et al. [28] proposed a new tool to optimize thedefault parameters of Hadoop; for instance, the total number ofmap reduces, scheduling policy and the reuse of JVM toincrease the performance. The tool is called Startfish, and itsmain purpose is to work with Hadoop phases such asplacement, scheduling, and tuning of the assigned jobs to thecomputing nodes. Panatula et al. [29] worked on theperformance of HadoopMapReduce Word Count Algorithmand presented it on the Twitter data. The experimental setupwas based on a 4-node Hadoop system to analyze theperformance of the algorithm. It was concluded that Hadoopcan work efficiently with the setup of 3 or more nodes. Gohil etal. [15] processed a different set of applications of MapReduceincluding Word Count and Tera Sort etc. to evaluate Hadoopperformance. The evaluation parameters were to set up adedicated cluster and decrease the I/O latency of the network.Likewise, the in-house Hadoop cluster setup and Amazon EC2instances are also used to evaluate the Hadoop performance.Khan et al. [30] have modeled the estimation of theprovisioning of the resources and completion time of the jobs.Furthermore, the Hadoop and Spark-based distributed systemperformance has been evaluated by Taran et al. [31]. Aperformance evaluation framework is proposed for Hadoop byLin et al. [16] on the basis of cluster computing nodes across aclustered network. A configuration strategy is proposed by Jainet al. [32], in which MapReduce parameters are configuredwith optimized tuning to improve the performance of Hadoop.To analyze the performance of Hadoop, several applications780 P a g ewww.ijacsa.thesai.org

(IJACSA) International Journal of Advanced Computer Science and Applications,Vol. 12, No. 4, 2021were processed and tested repeatedly by Londhe et al. [33]using the Amazon platform for Hadoop. In [34], an analysis ofthe computational performance of the processors on a privatenetwork was presented in order to reduce the input/outputlatency of the network.This work implemented a well-known WordCountAlgorithm using Hadoop to evaluate the frameworkperformance and provide a thorough analysis of the differencebetween Hadoop and Spark frameworks.IV. HADOOP COMPONENTSHadoop framework allows the users to record & processBig Data in a distributed network, across several computingnodes using easy-to-use programming methods. It is an opensource framework designed by D. Cutting & M. Cafarella [14].Most researchers and developers consider Hadoop the mostefficient tool in the Big Data domain. It is sometimesmisunderstood as merely a database, but it is a comprehensiveecosystem that allows distributing data for processing acrossthousands of servers and keeping the overall performanceextremely optimized. As mentioned earlier, there are two basiccomponents of the Hadoop system: HDFS and MapReducealgorithm [35].The basic architecture of the Hadoop framework is depictedin Figure 2. It based on the Master-Slave system, in which themaster node is called the name node, and the slave is the datanode, which keeps and processes the actual data. For faulttolerance, the factor of replication is set at 3, where theMapReduce algorithm helps the replicated data to be processedin parallel mode [26]. In the following, the components of theHadoop system describe in detail:Fig. 2. Hadoop Architecture.A. HDFSA large amount of data in the form of sets is stored onHDFS which is a distributed file management system andworks on the commodity hardware [38]. Thousands of nodesclustered in a distributed system can be supported using theHDFS in a reliable manner at a low cost. It can support largefiles containing volumes of data in terabytes. Furthermore, itprovides portability for data across various platforms andnodes. However, the most important feature of HDFS is itsability to reduce traffic congestion across networks, becauseprocessing and data are moved closer to each other.To p

Apache Hadoop & Apache Spark in terms of efficiency, scalability, security, cost-effectiveness, and other parameters. It describes primary components of Hadoop and Spark frameworks to compare their performance. The major conclusion is t