2012 and Dima MayHadoop IntroductionOriginals of slides and source code for examples: see the customized Hadoop training courses (onsite or at public venues) – mlCustomized Java EE Training:, Java, JSF 2, PrimeFaces, Servlets, JSP, Ajax, jQuery, Spring, Hibernate, RESTful Web Services, Android.Developed and taught by well-known author and developer. At public venues or onsite at your location. 2012 and Dima MayFor live customized Hadoop training (including prepfor the Cloudera certification exam), please [email protected] by recognized Hadoop expert who spoke on Hadoopseveral times at JavaOne, and who uses Hadoop daily inreal-world apps. Available at public venues, or customizedversions can be held on-site at your organization. Courses developed and taught by Marty Hall– JSF 2.2, PrimeFaces, servlets/JSP, Ajax, jQuery, Android development, Java 7 or 8 programming, custom mix of topics– Coursesavailable in any stateor country.Maryland/DC companies can also choose afternoon/evening courses.CustomizedJavaEE Training: Coursesdevelopedand taught Servlets,by coreservlets.comexperts(editedHibernate,by Marty)RESTful Web Services, Android.Hadoop,Java,JSF 2, PrimeFaces,JSP, Ajax, jQuery,Spring,– Spring, Hibernate/JPA, GWT, Hadoop, HTML5, RESTful Web ServicesDeveloped and taught by well-knownand developer. At publicvenues or onsite at your [email protected] details

Agenda Big DataHadoop IntroductionHistoryComparison to Relational DatabasesHadoop Eco-System and DistributionsResources4Big Data Information Data Corporation (IDC)estimates data created in 2010 to be1.2 ZETTABYTES(1.2 Trillion Gigabytes) Companies continue to generate largeamounts of data, here are some 2011 stats:– Facebook 6 billion messages per day– EBay 2 billion page views a day, 9 Petabytes ofstorage– Satellite Images by Skybox Imaging 1 Terabyte per day5Sources:"Digital Universe" study by IDC; verse.htmHadoop World 2011 Keynote: Hugh E. Williams, eBayHadoop World 2011: Building Realtime Big Data Services at Facebook with Hadoop and HBaseHadoop World 2011: Indexing the Earth – Large Scale Satellite Image Processing Using Hadoop

Hadoop Existing tools were not designed to handlesuch large amounts of data "The Apache Hadoop project developsopen-source software for reliable, scalable,distributed computing."– Process Big Data on clusters of commodity hardware– Vibrant open-source community– Many products and tools reside on top of Hadoop6Hadoop Jobs7Source: cloud computing%2C hadoop%2C jpa%2C ejb3&l

Who Uses Hadoop?Source: Storage Storage capacity has grown exponentiallybut read speed has not kept up– 1990: Store 1,400 MB Transfer speed of 4.5MB/s Read the entire drive in 5 minutes– 2010: Store 1 TB Transfer speed of 100MB/s Read the entire drive in 3 hours Hadoop - 100 drives working at the sametime can read 1TB of data in 2 minutes9

Hadoop ClusterclientclientclientHadoop Cluster10Hadoop Cluster A set of "cheap" commodity hardware Networked together Resides in the same location– Set of servers in a set of racks in a data center11

Use Commodity Hardware “Cheap” Commodity Server Hardware– No need for super-computers, use commodity unreliablehardware– Not desktopsNOTBUT12Hadoop System Principles 13Scale-Out rather than Scale-UpBring code to data rather than data to codeDeal with failures – they are commonAbstract complexity of distributed andconcurrent applications

Scale-Out Instead of Scale-Up It is harder and more expensive to scale-up– Add additional resources to an existing node (CPU, RAM)– Moore’s Law can’t keep up with data growth– New units must be purchased if required resources can not beadded– Also known as scale vertically Scale-Out– Add more nodes/machines to an existing distributedapplication– Software Layer is designed for node additions or removal– Hadoop takes this approach - A set of nodes are bondedtogether as a single distributed system– Very easy to scale down as well14Code to Data Traditional data processing architecture– nodes are broken up into separate processing and storagenodes connected by high-capacity link– Many data-intensive applications are not CPU demandingcausing bottlenecks in networkProcessingNodeLoad DataSave ResultsStorageNodeLoad DataProcessingNodeSave ResultsRisk of bottleneckStorageNode

Code to Data Hadoop co-locates processors and storageHadoop Cluster– Code is moved to data (size is tiny, usually in KBs)– Processors execute code and access underlying op NodeHadoop NodeProcessorProcessorStorageStorageHadoop NodeHadoop NodeFailures are Common Given a large number machines, failures arecommon– Large warehouses may see machine failures weekly oreven daily Hadoop is designed to cope with nodefailures– Data is replicated– Tasks are retried17

Abstract Complexity Hadoop abstracts many complexities indistributed and concurrent applications– Defines small number of components– Provides simple and well defined interfaces of interactionsbetween these components Frees developer from worrying about systemlevel challenges– race conditions, data starvation– processing pipelines, data partitioning, code distribution– etc. Allows developers to focus on applicationdevelopment and business logic18History of Hadoop Started as a sub-project of Apache Nutch– Nutch’s job is to index the web and expose it for searching– Open Source alternative to Google– Started by Doug Cutting In 2004 Google publishes Google File System(GFS) and MapReduce framework papers Doug Cutting and Nutch team implementedGoogle’s frameworks in Nutch In 2006 Yahoo! hires Doug Cutting to work onHadoop with a dedicated team In 2008 Hadoop became Apache Top LevelProject– http://hadoop.apache.org19

Naming Conventions? Doug Cutting drew inspiration from hisfamily– Lucene: Doug’s wife’s middle name– Nutch: A word for "meal" that his son used as a toddler– Hadoop: Yellow stuffed elephant named by his son20Comparisons to RDBMS Until recently many applications utilizedRelational Database Management Systems(RDBMS) for batch processing– Oracle, Sybase, MySQL, Microsoft SQL Server, etc.– Hadoop doesn’t fully replace relational products; manyarchitectures would benefit from both Hadoop and aRelational product(s) Scale-Out vs. Scale-Up– RDBMS products scale up Expensive to scale for larger installations Hits a ceiling when storage reaches 100s of terabytes– Hadoop clusters can scale-out to 100s of machines and topetabytes of storage21

Comparisons to RDBMS (Continued) Structured Relational vs. Semi-Structuredvs. Unstructured– RDBMS works well for structured data - tables thatconform to a predefined schema– Hadoop works best on Semi-structured and Unstructureddata Semi-structured may have a schema that is looselyfollowed Unstructured data has no structure whatsoever and isusually just blocks of text (or for example images) At processing time types for key and values are chosen bythe implementer– Certain types of input data will not easily fit intoRelational Schema such as images, JSON, XML, etc.22Comparison to RDBMS Offline batch vs. online transactions– Hadoop was not designed for real-time or low latencyqueries– Products that do provide low latency queries such asHBase have limited query functionality– Hadoop performs best for offline batch processing onlarge amounts of data– RDBMS is best for online transactions and low-latencyqueries– Hadoop is designed to stream large files and largeamounts of data– RDBMS works best with small records23

Comparison to RDBMS Hadoop and RDBMS frequently complementeach other within an architecture For example, a website that– has a small number of users– produces a large amount of audit logs2Web Server1RDBMS431 Utilize RDBMS to provide rich User32 RDBMS generates large amounts of audit4 Results copied to RDBMS to be usedInterface and enforce data integrity24Hadooplogs; the logs are moved periodically tothe Hadoop clusterAll logs are kept in Hadoop; Variousanalytics are executed periodicallyby Web Server; for example"suggestions" based on audit historyHadoop Eco System At first Hadoop was mainly known for two coreproducts:– HDFS: Hadoop Distributed FileSystem– MapReduce: Distributed data processing framework Today, in addition to HDFS and MapReduce, theterm also represents a multitude of products:– HBase: Hadoop column database; supports batch and randomreads and limited queries– Zookeeper: Highly-Available Coordination Service– Oozie: Hadoop workflow scheduler and manager– Pig: Data processing language and execution environment– Hive: Data warehouse with SQL interface25

Hadoop Eco System To start building an application, you need a filesystem– In Hadoop world that would be Hadoop Distributed File System(HDFS)– In Linux it could be ext3 or ext4 Addition of a data store would provide a nicerinterface to store and manage your data– HBase: A key-value store implemented on top of HDFS– Traditionally one could use RDBMS on top of a local file systemHBaseHadoop Distributed FileSystem (HDFS)26Hadoop Eco System For batch processing, you will need toutilize a framework– In Hadoop’s world that would be MapReduce– MapReduce will ease implementation of distributedapplications that will run on a cluster of commodityhardwareMapReduceHBaseHadoop Distributed FileSystem (HDFS)27

Hadoop Eco System Many problems lend themselves to aMapReduce solution with multiple jobs– Apache Oozie is a popular MapReduce workflow andcoordination productOozieMapReduceHBaseHadoop Distributed FileSystem (HDFS)28Hadoop Eco System MapReduce paradigm may not work well foranalysts and data scientists– Addition of Apache Pig, a high-level data flow scriptinglanguage, may be beneficialOoziePigMapReduceHBaseHadoop Distributed FileSystem (HDFS)29

Hadoop Eco System Your organization may have a good numberof SQL experts– Addition of Apache Hive, a data warehouse solution thatprovides a SQL based interface, may bridge the gapOoziePigHiveMapReduceHBaseHadoop Distributed FileSystem (HDFS)30Hadoop Distributions Let’s say you go download Hadoop’s HDFS andMapReduce from At first it works great but then you decide to startusing HBase– No problem, just download HBase from and point it to your existing HDFSinstallation– But you find that HBase can only work with a previous versionof HDFS, so you go downgrade HDFS and everything still worksgreat Later on you decide to add Pig– Unfortunately the version of Pig doesn’t work with the version ofHDFS, it wants you to upgrade– But if you upgrade you’ll break HBase.31

Hadoop Distributions Hadoop Distributions aim to resolve versionincompatibilities Distribution Vendor will– Integration Test a set of Hadoop products– Package Hadoop products in various installation formats Linux Packages, tarballs, etc.– Distributions may provide additional scripts to executeHadoop– Some vendors may choose to backport features and bugfixes made by Apache– Typically vendors will employ Hadoop committers so thebugs they find will make it into Apache’s repository32Distribution Vendors Cloudera Distribution forHadoop (CDH) MapR Distribution Hortonworks Data Platform(HDP) Apache BigTop Distribution Greenplum HD Data ComputingAppliance33

Cloudera Distribution forHadoop (CDH) Cloudera has taken the lead on providingHadoop Distribution– Cloudera is affecting the Hadoop eco-system in the sameway RedHat popularized Linux in the enterprise circles Most popular distribution–– 100% open-source Cloudera employs a large percentage ofcore Hadoop committers CDH is provided in various formats– Linux Packages, Virtual Machine Images, and Tarballs34Cloudera Distribution forHadoop (CDH) Integrates majority of popular Hadoopproducts– HDFS, MapReduce, HBase, Hive, Mahout, Oozie, Pig,Sqoop, Whirr, Zookeeper, Flume CDH4 is used in this class35

Supported Operating Systems Each Distribution will support its own list ofOperating Systems (OS) Common OS supported–––––Red Hat EnterpriseCentOSOracle LinuxUbuntuSUSE Linux Enterprise Server Please see vendors documentation forsupported OS and version– Supported Operating Systems for re You Install CDH4 on a eratingSystemsforCDH436Resources Apache Hadoop Documentation– Each project will have their owndocumentation artifacts and usually a wiki Each Hadoop Distribution Vendor providesdocumentation as well:– For entation37

Resources: BooksHadoop: The Definitive GuideTom White (Author)O'Reilly Media; 3rd Edition (May6, 2012)Hadoop in ActionChuck Lam (Author)Manning Publications; 1st Edition (December, 2010)MapReduce Design PatternsDonald Miner (Author), Adam Shook (Author)O'Reilly Media (November 22, 2012)38Resources: BooksHBase: The Definitive GuideLars George (Author)O'Reilly Media; 1 edition (September 20, 2011)Programming PigAlan Gates (Author)O'Reilly Media; 1st Edition (October, 2011)Hadoop OperationsEric Sammer (Author)O'Reilly Media (October 22, 2012)39

Resources: BooksData-Intensive Text Processing with MapReduceJimmy Lin and Chris Dyer (Authors) (April, 2010)Download for /index.htmlProgramming HiveEdward Capriolo, Dean Wampler,Jason Rutherglen (Authors)O'Reilly Media; 1 edition (October, 2012)Hadoop in PracticeAlex Holmes (Author)Manning Publications; (October 10, 2012)40Resources: Your Instructor Dima May– [email protected]– Email me any time!41

2012 and Dima MayWrap-UpCustomized Java EE Training:, Java, JSF 2, PrimeFaces, Servlets, JSP, Ajax, jQuery, Spring, Hibernate, RESTful Web Services, Android.Developed and taught by well-known author and developer. At public venues or onsite at your location.Summary We learned about– Data storage needs are rapidly increasing– Hadoop has become the de-facto standard for handlingthese massive data sets– The Cloudera Distribution for Hadoop (CDH) is the mostcommonly used Hadoop release distribution– There is a number of Hadoop related publicationsavailable43

2012 and Dima MayQuestions?More info: – Hadoop programming ining.html – Customized Hadoop training courses, at public venues or onsite at your -Materials/java.html – General Java programming l/ – Java 8 sf2/ – JSF 2.2 rimefaces/ – PrimeFaces tutorial – JSF 2, PrimeFaces, Java 7 or 8, Ajax, jQuery, Hadoop, RESTful Web Services, Android, HTML5, Spring, Hibernate, Servlets, JSP, GWT, and other Java EE trainingCustomized Java EE Training:, Java, JSF 2, PrimeFaces, Servlets, JSP, Ajax, jQuery, Spring, Hibernate, RESTful Web Services, Android.Developed and taught by well-known author and developer. At public venues or onsite at your location.

– Hadoop performs best for offline batch processing on large amounts of data – RDBMS is best for online transactions and low-latency queries – Hadoop is designed to stream large files and large amounts of data – RD