SlideShare a Scribd company logo
Big
Data
Systems
• Before 2004 “Google have implemented
hundreds of special-purpose computations
that process large amounts of raw data, such
as crawled documents, web request logs, etc.,
to compute various kinds of derived data, such
as inverted indices etc.”
• Nutch search system at 2004 was effectively
limited to 100M web pages
Use Cases
• 2002: Doug Cutting started Nutch: crawler & search
system
• 2003: GoogleFS paper
• 2004: Start of NDFS project (Nutch Distributed FS)
• 2004: Google MapReduce paper
• 2005: MapReduce implementation in Nutch
• 2006: HDFS and MapReduce to Hadoop subproject
• 2008: Yahoo! Production search index by a 10000-core
Hadoop cluster
• 2008: Hadoop – top-level Apache project
Hadoop History
• Need to process Multi Petabyte Datasets
• Need to provide framework for reliable application
execution
• Need to encapsulate nodes failures from application
developer.
– Failure is expected, rather than exceptional.
– The number of nodes in a cluster is not constant.
• Need common infrastructure
– Efficient, reliable, Open Source Apache License
Hadoop Objectives
• Hadoop Distributed File System (HDFS)
• Hadoop MapReduce
• Hadoop Common
Hadoop
• Very Large Distributed File System
– 10K nodes, 100 million files, 10 PB
• Assumes Commodity Hardware
– Files are replicated to handle hardware failure
– Detect failures and recovers from them
• Optimized for Batch Processing
– Data locations exposed so that computations can move to
where data resides
– Provides very high aggregate bandwidth
Goals of GFS/HDFS
• Data Coherency
– Write-once-read-many access model
– Client can only append to existing files
• Files are broken up into blocks
– Typically 128 MB block size
– Each block replicated on multiple DataNodes
• Intelligent Client
– Client can find location of blocks
– Client accesses data directly from DataNode
HFDS Details
Client reading data from HDFS
Client writing data to HDFS
Compression
• Java API
• Command Line
– hadoop dfs -mkdir /foodir
– hadoop dfs -cat /foodir/myfile.txt
– hadoop dfs -rm /foodir myfile.txt
– hadoop dfsadmin –report
– hadoop dfsadmin -decommission datanodename
• Web Interface
– http://host:port/dfshealth.jsp
HDFS User Interface
HDFS Web UI
• The Map-Reduce programming model
– Framework for distributed processing of large data sets
– Pluggable user code runs in generic framework
• Common design pattern in data processing
cat * | grep | sort | uniq -c | cat > file
input | map | shuffle | reduce | output
• Natural for:
– Log processing
– Web search indexing
– Ad-hoc queries
Hadoop MapReduce
Map function
Reduce function
Run this program as a
MapReduce job
Lifecycle of a MapReduce Job
MapReduce in Hadoop (1)
MapReduce in Hadoop (2)
MapReduce in Hadoop (3)
Hadoop WebUI
Hadoop WebUI
• 190+ parameters in
Hadoop
• Set manually or defaults
are used
Hadoop Configuration
Pro:
• Cheap components
• Replication
• Fault tolerance
• Parallel processing
• Free license
• Linear scalability
• Amazon support
Con:
• No realtime
• Difficult to add MR tasks
• File edit is not supported
• High support cost
Summary
• Distributed Grep
• Count of URL Access Frequency
• Reverse Web-Link Graph
• Inverted Index
Examples
• Streaming
• Hive
• Pig
• HBase
Hadoop
API to MapReduce that uses Unix standard streams
as the interface between Hadoop and your program
MAP: map.rb
#!/usr/bin/env ruby
STDIN.each_line do |line|
val = line
year, temp, q = val[15,4], val[87,5], val[92,1]
puts "#{year}t#{temp}" if (temp != "+9999" && q =~ /[01459]/)
end
% cat input/ncdc/sample.txt | map.rb
1950 +0000
1950 +0022
1950 -0011
1949 +0111
1949 +0078
LOCAL EXECUTION
Hadoop Streaming (1)
REDUCE: reduce.rb
#!/usr/bin/env ruby
last_key, max_val = nil, 0
STDIN.each_line do |line|
key, val = line.split("t")
if last_key && last_key != key
puts "#{last_key}t#{max_val}"
last_key, max_val = key, val.to_i
else
last_key, max_val = key, [max_val, val.to_i].max
end
end
puts "#{last_key}t#{max_val}" if last_key
% cat input/ncdc/sample.txt | map.rb | sort | reduce.rb
1949 111
1950 22
LOCAL EXECUTION
Hadoop Streaming (2)
HADOOP EXECUTION
% hadoop jar 
$HADOOP_INSTALL/contrib/streaming/hadoop-*-streaming.jar 
-input input/ncdc/sample.txt 
-output output 
-mapper map.rb 
-reducer reduce.rb
Hadoop Streaming (3)
 Intuitive
 Make the unstructured data looks like tables regardless how
it really lay out
 SQL based query can be directly against these tables
 Generate specify execution plan for this query
 What’s Hive
 A data warehousing system to store structured data on
Hadoop file system
 Provide an easy query these data by execution Hadoop
MapReduce plans
Hive: overview
HDFS
Map Reduce
Hive: architecture
hive> SHOW TABLES;
hive> CREATE TABLE shakespeare (freq
INT, word STRING) ROW FORMAT
DELIMITED FIELDS TERMINATED BY ‘t’
STORED AS TEXTFILE;
hive> DESCRIBE shakespeare;
loading data…
hive> SELECT * FROM shakespeare LIMIT 10;
hive> SELECT * FROM shakespeare
WHERE freq > 100 SORT BY freq ASC
LIMIT 10;
Hive: shell
-- max_temp.pig: Finds the maximum temperature by year
records = LOAD 'input/ncdc/micro-tab/sample.txt'
AS (year:chararray, temperature:int, quality:int);
filtered_records = FILTER records
BY temperature != 9999
AND (quality == 0 OR quality == 1 OR quality == 4 OR quality == 5 OR quality == 9);
grouped_records = GROUP filtered_records BY year;
max_temp = FOREACH grouped_records
GENERATE group, MAX(filtered_records.temperature);
DUMP max_temp;
Pig
Initial public launch
Move from local workstation to shared, remote hosted
MySQL instance with a well-defined schema.
Service becomes more popular; too many reads hitting the
database
Add memcached to cache common queries. Reads are
now no longer strictly ACID; cached data must expire.
Service continues to grow in popularity; too many writes
hitting the database
Scale MySQL vertically by buying a beefed up server
with 16 cores, 128 GB of RAM,
and banks of 15 k RPM hard drives. Costly.
RDBMS scaling story (1)
New features increases query complexity; now we have
too many joins
Denormalize your data to reduce joins.
Rising popularity swamps the server; things are too slow
Stop doing any server-side computations.
Some queries are still too slow
Periodically prematerialize the most complex
queries, try to stop joining in most cases.
Reads are OK, but writes are getting slower and slower
Drop secondary indexes and triggers (no indexes?).
RDBMS scaling story (1)
NoSQL
• Tables have one primary index, the row key
• No join operators
• Data is unstructured and untyped
• No accessed or manipulated via SQL
– Programmatic access via Java, REST, or Thrift APIs
• There are three types of lookups:
– Fast lookup using row key and optional timestamp
– Full table scan
– Range scan from region start to end
Hbase: differences from RDBMS
• Automatic partitioning
• Scale linearly and automatically with new
nodes
• Commodity hardware
• Fault tolerance: Apache Zookeeper
• Batch processing: Apache Hadoop
Hbase: benefits over RDBMS
 Tables are sorted by Row
 Table schema only define it’s column families .
 Each family consists of any number of columns
 Each column consists of any number of versions
 Columns only exist when inserted, NULLs are free.
 Columns within a family are sorted and stored together
 Everything except table names are byte[]
 (Row, Family: Column, Timestamp)  Value
Row key
Column Family
valueTimeStamp
Hbase: data model
• Master
– Responsible for monitoring region servers
– Load balancing for regions
– Redirect client to correct region servers
• regionserver slaves
– Serving requests (Write/Read/Scan) of Client
– Send HeartBeat to Master
Hbase: members
$ hbase shell
> create 'test', 'data'
0 row(s) in 4.3066 seconds
> list
test
1 row(s) in 0.1485 seconds
> put 'test', 'row1', 'data:1', 'value1'
0 row(s) in 0.0454 seconds
> put 'test', 'row2', 'data:2', 'value2'
0 row(s) in 0.0035 seconds
> scan 'test'
ROW COLUMN+CELL
row1 column=data:1, timestamp=1240148026198, value=value1
row2 column=data:2, timestamp=1240148040035, value=value2
2 row(s) in 0.0825 seconds
Hbase: shell
Hbase: Web UI
• Amazon
• Facebook
• Google
• IBM
• Joost
• Last.fm
• New York Times
• PowerSet
• Veoh
• Yahoo!
Who uses Hadoop?
Books

More Related Content

PDF
Hadoop in Practice (SDN Conference, Dec 2014)
ODP
Hadoop - Overview
PPTX
Hadoop And Their Ecosystem
PPTX
An intriduction to hive
PDF
Introduction to the Hadoop Ecosystem (IT-Stammtisch Darmstadt Edition)
PPTX
Data Pipelines in Hadoop - SAP Meetup in Tel Aviv
PPTX
Introduction to Data Analyst Training
PPTX
Hadoop Demystified + MapReduce (Java and C#), Pig, and Hive Demos
Hadoop in Practice (SDN Conference, Dec 2014)
Hadoop - Overview
Hadoop And Their Ecosystem
An intriduction to hive
Introduction to the Hadoop Ecosystem (IT-Stammtisch Darmstadt Edition)
Data Pipelines in Hadoop - SAP Meetup in Tel Aviv
Introduction to Data Analyst Training
Hadoop Demystified + MapReduce (Java and C#), Pig, and Hive Demos

What's hot (20)

PDF
SQOOP - RDBMS to Hadoop
PPTX
Hadoop overview
PPTX
Real time hadoop + mapreduce intro
PPTX
Asbury Hadoop Overview
PPTX
Hadoop Summit 2015: Hive at Yahoo: Letters from the Trenches
PPTX
Introduction to the Hadoop EcoSystem
PDF
Introduction To Hadoop Ecosystem
PDF
Practical Problem Solving with Apache Hadoop & Pig
PDF
Hortonworks.Cluster Config Guide
PDF
Migrating structured data between Hadoop and RDBMS
PPTX
HADOOP TECHNOLOGY ppt
PDF
Big Data and Hadoop Ecosystem
PDF
August 2016 HUG: Better together: Fast Data with Apache Spark™ and Apache Ign...
PDF
Introduction to Hive and HCatalog
PDF
Apache Spark & Hadoop
PDF
Next Generation Hadoop Operations
PDF
20131205 hadoop-hdfs-map reduce-introduction
PPTX
Apache drill
PDF
Apache Drill and Zeppelin: Two Promising Tools You've Never Heard Of
PDF
Hadoop trainting in hyderabad@kelly technologies
SQOOP - RDBMS to Hadoop
Hadoop overview
Real time hadoop + mapreduce intro
Asbury Hadoop Overview
Hadoop Summit 2015: Hive at Yahoo: Letters from the Trenches
Introduction to the Hadoop EcoSystem
Introduction To Hadoop Ecosystem
Practical Problem Solving with Apache Hadoop & Pig
Hortonworks.Cluster Config Guide
Migrating structured data between Hadoop and RDBMS
HADOOP TECHNOLOGY ppt
Big Data and Hadoop Ecosystem
August 2016 HUG: Better together: Fast Data with Apache Spark™ and Apache Ign...
Introduction to Hive and HCatalog
Apache Spark & Hadoop
Next Generation Hadoop Operations
20131205 hadoop-hdfs-map reduce-introduction
Apache drill
Apache Drill and Zeppelin: Two Promising Tools You've Never Heard Of
Hadoop trainting in hyderabad@kelly technologies
Ad

Viewers also liked (20)

PDF
MoSQL: An Elastic Storage Engine for MySQL
PDF
JBug_React_and_Flux_2015
PDF
Building search app with ElasticSearch
KEY
Elasticsearch & "PeopleSearch"
PPT
OseeGenius - Semantic search engine and discovery platform
PDF
Elasticsearch
PDF
Social Miner: Webinar people marketing em 30 min
PDF
Oxalide Academy : Workshop #3 Elastic Search
PDF
Elasticsearch first-steps
PDF
Introduction to Elasticsearch
PDF
Amministratori Di Sistema: Adeguamento al Garante Privacy - Log Management e ...
PDF
Oak / Solr integration
ODP
Elastic search
PPTX
quick intro to elastic search
PPTX
Elastic search Walkthrough
PPTX
[Case machine learning- iColabora]Text Mining - classificando textos com Elas...
PDF
Elastic search adaptto2014
PDF
Using Elastic Search Outside Full-Text Search
PDF
03. ElasticSearch : Data In, Data Out
PDF
Data replication in Sling
MoSQL: An Elastic Storage Engine for MySQL
JBug_React_and_Flux_2015
Building search app with ElasticSearch
Elasticsearch & "PeopleSearch"
OseeGenius - Semantic search engine and discovery platform
Elasticsearch
Social Miner: Webinar people marketing em 30 min
Oxalide Academy : Workshop #3 Elastic Search
Elasticsearch first-steps
Introduction to Elasticsearch
Amministratori Di Sistema: Adeguamento al Garante Privacy - Log Management e ...
Oak / Solr integration
Elastic search
quick intro to elastic search
Elastic search Walkthrough
[Case machine learning- iColabora]Text Mining - classificando textos com Elas...
Elastic search adaptto2014
Using Elastic Search Outside Full-Text Search
03. ElasticSearch : Data In, Data Out
Data replication in Sling
Ad

Similar to Apache Hadoop 1.1 (20)

PPTX
Hands on Hadoop and pig
DOC
PPT
Hadoop presentation
PPTX
Big Data and Hadoop - History, Technical Deep Dive, and Industry Trends
PPT
Hadoop - Introduction to Hadoop
PDF
Apache Hadoop and Spark: Introduction and Use Cases for Data Analysis
PDF
Tcloud Computing Hadoop Family and Ecosystem Service 2013.Q2
PDF
Apache Hadoop and HBase
PPTX
Bigdata workshop february 2015
PPT
Brust hadoopecosystem
PDF
Tcloud Computing Hadoop Family and Ecosystem Service 2013.Q3
PPTX
Sf NoSQL MeetUp: Apache Hadoop and HBase
PPT
HADOOP AND MAPREDUCE ARCHITECTURE-Unit-5.ppt
PPTX
Big Data and Hadoop - History, Technical Deep Dive, and Industry Trends
PPT
Nextag talk
PDF
introduction to data processing using Hadoop and Pig
PDF
Константин Швачко, Yahoo!, - Scaling Storage and Computation with Hadoop
PPTX
2016-07-21-Godil-presentation.pptx
PPT
Finding the needles in the haystack. An Overview of Analyzing Big Data with H...
PDF
Understanding Hadoop
Hands on Hadoop and pig
Hadoop presentation
Big Data and Hadoop - History, Technical Deep Dive, and Industry Trends
Hadoop - Introduction to Hadoop
Apache Hadoop and Spark: Introduction and Use Cases for Data Analysis
Tcloud Computing Hadoop Family and Ecosystem Service 2013.Q2
Apache Hadoop and HBase
Bigdata workshop february 2015
Brust hadoopecosystem
Tcloud Computing Hadoop Family and Ecosystem Service 2013.Q3
Sf NoSQL MeetUp: Apache Hadoop and HBase
HADOOP AND MAPREDUCE ARCHITECTURE-Unit-5.ppt
Big Data and Hadoop - History, Technical Deep Dive, and Industry Trends
Nextag talk
introduction to data processing using Hadoop and Pig
Константин Швачко, Yahoo!, - Scaling Storage and Computation with Hadoop
2016-07-21-Godil-presentation.pptx
Finding the needles in the haystack. An Overview of Analyzing Big Data with H...
Understanding Hadoop

More from Sperasoft (20)

PDF
особенности работы с Locomotion в Unreal Engine 4
PDF
концепт и архитектура геймплея в Creach: The Depleted World
PPTX
Опыт разработки VR игры для UE4
PPTX
Организация работы с UE4 в команде до 20 человек
PPTX
Gameplay Tags
PDF
Data Driven Gameplay in UE4
PPTX
Code and Memory Optimisation Tricks
PPTX
The theory of relational databases
PPTX
Automated layout testing using Galen Framework
PDF
Sperasoft talks: Android Security Threats
PDF
Sperasoft Talks: RxJava Functional Reactive Programming on Android
PDF
Sperasoft‬ talks j point 2015
PDF
Effective Мeetings
PDF
Unreal Engine 4 Introduction
PDF
JIRA Development
PDF
MOBILE DEVELOPMENT with HTML, CSS and JS
PDF
Quick Intro Into Kanban
PDF
ECMAScript 6 Review
PDF
Console Development in 15 minutes
PDF
Database Indexes
особенности работы с Locomotion в Unreal Engine 4
концепт и архитектура геймплея в Creach: The Depleted World
Опыт разработки VR игры для UE4
Организация работы с UE4 в команде до 20 человек
Gameplay Tags
Data Driven Gameplay in UE4
Code and Memory Optimisation Tricks
The theory of relational databases
Automated layout testing using Galen Framework
Sperasoft talks: Android Security Threats
Sperasoft Talks: RxJava Functional Reactive Programming on Android
Sperasoft‬ talks j point 2015
Effective Мeetings
Unreal Engine 4 Introduction
JIRA Development
MOBILE DEVELOPMENT with HTML, CSS and JS
Quick Intro Into Kanban
ECMAScript 6 Review
Console Development in 15 minutes
Database Indexes

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Modernizing your data center with Dell and AMD
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
KodekX | Application Modernization Development
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Modernizing your data center with Dell and AMD
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Approach and Philosophy of On baking technology
Reach Out and Touch Someone: Haptics and Empathic Computing
Dropbox Q2 2025 Financial Results & Investor Presentation
NewMind AI Monthly Chronicles - July 2025
20250228 LYD VKU AI Blended-Learning.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Advanced Soft Computing BINUS July 2025.pdf
KodekX | Application Modernization Development
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Network Security Unit 5.pdf for BCA BBA.
Advanced methodologies resolving dimensionality complications for autism neur...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...

Apache Hadoop 1.1

  • 2. • Before 2004 “Google have implemented hundreds of special-purpose computations that process large amounts of raw data, such as crawled documents, web request logs, etc., to compute various kinds of derived data, such as inverted indices etc.” • Nutch search system at 2004 was effectively limited to 100M web pages Use Cases
  • 3. • 2002: Doug Cutting started Nutch: crawler & search system • 2003: GoogleFS paper • 2004: Start of NDFS project (Nutch Distributed FS) • 2004: Google MapReduce paper • 2005: MapReduce implementation in Nutch • 2006: HDFS and MapReduce to Hadoop subproject • 2008: Yahoo! Production search index by a 10000-core Hadoop cluster • 2008: Hadoop – top-level Apache project Hadoop History
  • 4. • Need to process Multi Petabyte Datasets • Need to provide framework for reliable application execution • Need to encapsulate nodes failures from application developer. – Failure is expected, rather than exceptional. – The number of nodes in a cluster is not constant. • Need common infrastructure – Efficient, reliable, Open Source Apache License Hadoop Objectives
  • 5. • Hadoop Distributed File System (HDFS) • Hadoop MapReduce • Hadoop Common Hadoop
  • 6. • Very Large Distributed File System – 10K nodes, 100 million files, 10 PB • Assumes Commodity Hardware – Files are replicated to handle hardware failure – Detect failures and recovers from them • Optimized for Batch Processing – Data locations exposed so that computations can move to where data resides – Provides very high aggregate bandwidth Goals of GFS/HDFS
  • 7. • Data Coherency – Write-once-read-many access model – Client can only append to existing files • Files are broken up into blocks – Typically 128 MB block size – Each block replicated on multiple DataNodes • Intelligent Client – Client can find location of blocks – Client accesses data directly from DataNode HFDS Details
  • 11. • Java API • Command Line – hadoop dfs -mkdir /foodir – hadoop dfs -cat /foodir/myfile.txt – hadoop dfs -rm /foodir myfile.txt – hadoop dfsadmin –report – hadoop dfsadmin -decommission datanodename • Web Interface – http://host:port/dfshealth.jsp HDFS User Interface
  • 13. • The Map-Reduce programming model – Framework for distributed processing of large data sets – Pluggable user code runs in generic framework • Common design pattern in data processing cat * | grep | sort | uniq -c | cat > file input | map | shuffle | reduce | output • Natural for: – Log processing – Web search indexing – Ad-hoc queries Hadoop MapReduce
  • 14. Map function Reduce function Run this program as a MapReduce job Lifecycle of a MapReduce Job
  • 20. • 190+ parameters in Hadoop • Set manually or defaults are used Hadoop Configuration
  • 21. Pro: • Cheap components • Replication • Fault tolerance • Parallel processing • Free license • Linear scalability • Amazon support Con: • No realtime • Difficult to add MR tasks • File edit is not supported • High support cost Summary
  • 22. • Distributed Grep • Count of URL Access Frequency • Reverse Web-Link Graph • Inverted Index Examples
  • 23. • Streaming • Hive • Pig • HBase Hadoop
  • 24. API to MapReduce that uses Unix standard streams as the interface between Hadoop and your program MAP: map.rb #!/usr/bin/env ruby STDIN.each_line do |line| val = line year, temp, q = val[15,4], val[87,5], val[92,1] puts "#{year}t#{temp}" if (temp != "+9999" && q =~ /[01459]/) end % cat input/ncdc/sample.txt | map.rb 1950 +0000 1950 +0022 1950 -0011 1949 +0111 1949 +0078 LOCAL EXECUTION Hadoop Streaming (1)
  • 25. REDUCE: reduce.rb #!/usr/bin/env ruby last_key, max_val = nil, 0 STDIN.each_line do |line| key, val = line.split("t") if last_key && last_key != key puts "#{last_key}t#{max_val}" last_key, max_val = key, val.to_i else last_key, max_val = key, [max_val, val.to_i].max end end puts "#{last_key}t#{max_val}" if last_key % cat input/ncdc/sample.txt | map.rb | sort | reduce.rb 1949 111 1950 22 LOCAL EXECUTION Hadoop Streaming (2)
  • 26. HADOOP EXECUTION % hadoop jar $HADOOP_INSTALL/contrib/streaming/hadoop-*-streaming.jar -input input/ncdc/sample.txt -output output -mapper map.rb -reducer reduce.rb Hadoop Streaming (3)
  • 27.  Intuitive  Make the unstructured data looks like tables regardless how it really lay out  SQL based query can be directly against these tables  Generate specify execution plan for this query  What’s Hive  A data warehousing system to store structured data on Hadoop file system  Provide an easy query these data by execution Hadoop MapReduce plans Hive: overview
  • 29. hive> SHOW TABLES; hive> CREATE TABLE shakespeare (freq INT, word STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘t’ STORED AS TEXTFILE; hive> DESCRIBE shakespeare; loading data… hive> SELECT * FROM shakespeare LIMIT 10; hive> SELECT * FROM shakespeare WHERE freq > 100 SORT BY freq ASC LIMIT 10; Hive: shell
  • 30. -- max_temp.pig: Finds the maximum temperature by year records = LOAD 'input/ncdc/micro-tab/sample.txt' AS (year:chararray, temperature:int, quality:int); filtered_records = FILTER records BY temperature != 9999 AND (quality == 0 OR quality == 1 OR quality == 4 OR quality == 5 OR quality == 9); grouped_records = GROUP filtered_records BY year; max_temp = FOREACH grouped_records GENERATE group, MAX(filtered_records.temperature); DUMP max_temp; Pig
  • 31. Initial public launch Move from local workstation to shared, remote hosted MySQL instance with a well-defined schema. Service becomes more popular; too many reads hitting the database Add memcached to cache common queries. Reads are now no longer strictly ACID; cached data must expire. Service continues to grow in popularity; too many writes hitting the database Scale MySQL vertically by buying a beefed up server with 16 cores, 128 GB of RAM, and banks of 15 k RPM hard drives. Costly. RDBMS scaling story (1)
  • 32. New features increases query complexity; now we have too many joins Denormalize your data to reduce joins. Rising popularity swamps the server; things are too slow Stop doing any server-side computations. Some queries are still too slow Periodically prematerialize the most complex queries, try to stop joining in most cases. Reads are OK, but writes are getting slower and slower Drop secondary indexes and triggers (no indexes?). RDBMS scaling story (1)
  • 33. NoSQL
  • 34. • Tables have one primary index, the row key • No join operators • Data is unstructured and untyped • No accessed or manipulated via SQL – Programmatic access via Java, REST, or Thrift APIs • There are three types of lookups: – Fast lookup using row key and optional timestamp – Full table scan – Range scan from region start to end Hbase: differences from RDBMS
  • 35. • Automatic partitioning • Scale linearly and automatically with new nodes • Commodity hardware • Fault tolerance: Apache Zookeeper • Batch processing: Apache Hadoop Hbase: benefits over RDBMS
  • 36.  Tables are sorted by Row  Table schema only define it’s column families .  Each family consists of any number of columns  Each column consists of any number of versions  Columns only exist when inserted, NULLs are free.  Columns within a family are sorted and stored together  Everything except table names are byte[]  (Row, Family: Column, Timestamp)  Value Row key Column Family valueTimeStamp Hbase: data model
  • 37. • Master – Responsible for monitoring region servers – Load balancing for regions – Redirect client to correct region servers • regionserver slaves – Serving requests (Write/Read/Scan) of Client – Send HeartBeat to Master Hbase: members
  • 38. $ hbase shell > create 'test', 'data' 0 row(s) in 4.3066 seconds > list test 1 row(s) in 0.1485 seconds > put 'test', 'row1', 'data:1', 'value1' 0 row(s) in 0.0454 seconds > put 'test', 'row2', 'data:2', 'value2' 0 row(s) in 0.0035 seconds > scan 'test' ROW COLUMN+CELL row1 column=data:1, timestamp=1240148026198, value=value1 row2 column=data:2, timestamp=1240148040035, value=value2 2 row(s) in 0.0825 seconds Hbase: shell
  • 40. • Amazon • Facebook • Google • IBM • Joost • Last.fm • New York Times • PowerSet • Veoh • Yahoo! Who uses Hadoop?
  • 41. Books