Showing posts with label Mapreduce. Show all posts
Showing posts with label Mapreduce. Show all posts

Monday, December 22, 2014

What difference of RDBMS and Hive?

Hive resembles a traditional database by supporting SQL interface but it is not a full database.

Hive can be better called as data warehouse instead of database.

Hive enforces schema on read time whereas RDBMS enforces schema on write time.

In RDBMS, a table’s schema is enforced at data load time, If the data being loaded doesn’t conform to the schema, then it is rejected. This design is called schema on write.But Hive doesn’t verify the data when it is loaded, but rather when a it is retrieved. This is called schema on read.

Schema on read makes for a very fast initial load, since the data does not have to be read, parsed, and serialized to disk in the database’s internal format. The load operation is just a file copy or move.

Schema on write makes query time performance faster, since the database can index columns and perform compression on the data but it takes longer to load data into the database.

Hive is based on the notion of Write once, Read many times but RDBMS is designed for Read and Write many times.

In RDBMS, record level updates, insertions and deletes, transactions and indexes are possible. Whereas these are not allowed in Hive because Hive was built to operate over HDFS data using MapReduce, where fulltable scans are the norm and a table update is achieved by transforming the data into a new table.

In RDBMS, maximum data size allowed will be in 10’s of Terabytes but whereas Hive can 100’s Petabytes very easily.
As Hadoop is a batchoriented system, Hive doesn’t support OLTP (Online Transaction Processing) but it is closer to OLAP (Online Analytical Processing) but not ideal since there is significant latency between issuing a query and receiving a reply, due to the overhead of Mapreduce jobs and due to the size of the data sets Hadoop was designed to serve.

RDBMS is best suited for dynamic data analysis and where fast responses are expected but Hive is suited for data warehouse applications, where relatively static data is analyzed, fast
response times are not required, and when the data is not changing rapidly.

To overcome the limitations of Hive, HBase is being integrated with Hive to support record level operations and OLAP.


Hive is very easily scalable at low cost but RDBMS is not that much scalable that too it is very costly scale up.

source:http://hadooptutorial.info/

Saturday, December 20, 2014

Overview of IMPALA | IMPALA vs PIG & HIVE

What is IMPALA ?

Impala is a High-performance SQL Engine for vast amounts of data.


  • Massively parallel procesing
  • Inspired by google's Dremel project
  • Query latency measured in milliseconds
Impala runs on hadoop clusters
  • Can query data store in HDFS or HBase tables
  • Read and Write data in common hadoop file formats
Developed by cloudera
  • 100% open source under apache server licence
Impala supports a subset of SQL-92

Why to use IMPALA ?

Many benefits are the same as with Hive or PIG
  • More productive than writing Map-Reduce code 
  • Leverage existing knowledge of SQL
One benefit exclusive to impala is Speed
  • Highly optimized for queries
  • Almost 5times faster than Hive or Pig. Often 20 times faster or more
IMPORTANT:
Pig & Hive functions from your laptop where as the impala sits on Hadoop cluster on all data nodes.

Comparing Impala to Hive & Pig

Similarities:
  • Queries expressed in high-level languages
  • Alternatives to writting mapreduce code
  • Used to analyze data stored on Hadoop clusters
  • Impala shares the meta store with Hive (Tables created in Hive as visible in Impala (viceversa))
Contrasting Impala to Hive & Pig

  • Hive & Pig answers queries by running Mapreduce jobs.Map reduce over heads results in high latency.(even a trivial query takes 10sec or more)
  • Impala does not use mapreduce.It uses a custom execution engine build specifically for Impala.
  • Queries can complete in a fraction of sec.
  • Hive & Pig are best suited long-running batch processes (Data Transformation Tasks).Impala best for interactive/Adhoc queries.
  • Impala can't handle complex data types(Array,Map or Struct)
  • No support for binary data type.
If a node fails in Hive or Pig, They answers queries by running mapreduce jobs in other nodes. But,incase of impala if the node fails during a query,the query will fails and it has to be re-run

Relation Database vs Impala