QBoard » Big Data » Big Data - Hadoop Eco-System » When to use Hadoop, HBase, Hive and Pig?

When to use Hadoop, HBase, Hive and Pig?

  • What are the benefits of using either Hadoop or HBase or Hive ?

    From my understanding, HBase avoids using map-reduce and has a column oriented storage on top of HDFS. Hive is a sql-like interface for Hadoop and HBase.

    I would also like to know how Hive compares with Pig.

      December 18, 2020 4:27 PM IST
    0
  • MapReduce is just a computing framework. HBase has nothing to do with it. That said, you can efficiently put or fetch data to/from HBase by writing MapReduce jobs. Alternatively you can write sequential programs using other HBase APIs, such as Java, to put or fetch the data. But we use Hadoop, HBase etc to deal with gigantic amounts of data, so that doesn't make much sense. Using normal sequential programs would be highly inefficient when your data is too huge.

    Coming back to the first part of your question, Hadoop is basically 2 things: a Distributed FileSystem (HDFS) + a Computation or Processing framework (MapReduce). Like all other FS, HDFS also provides us storage, but in a fault tolerant manner with high throughput and lower risk of data loss (because of the replication). But, being a FS, HDFS lacks random read and write access. This is where HBase comes into picture. It's a distributed, scalable, big data store, modelled after Google's BigTable. It stores data as key/value pairs.

    Coming to Hive. It provides us data warehousing facilities on top of an existing Hadoop cluster. Along with that it provides an SQL like interface which makes your work easier, in case you are coming from an SQL background. You can create tables in Hive and store data there. Along with that you can even map your existing HBase tables to Hive and operate on them.

    While Pig is basically a dataflow language that allows us to process enormous amounts of data very easily and quickly. Pig basically has 2 parts: the Pig Interpreter and the language, PigLatin. You write Pig script in PigLatin and using Pig interpreter process them. Pig makes our life a lot easier, otherwise writing MapReduce is always not easy. In fact in some cases it can really become a pain.

    I had written an article on a short comparison of different tools of the Hadoop ecosystem some time ago. It's not an in depth comparison, but a short intro to each of these tools which can help you to get started. (Just to add on to my answer. No self promotion intended)

    Both Hive and Pig queries get converted into MapReduce jobs under the hood.

      July 29, 2021 2:19 PM IST
    0
  • Consider that you work with RDBMS and have to select what to use - full table scans, or index access - but only one of them.
    If you select a full table scan - use hive. If index access - HBase.
      December 21, 2020 1:13 PM IST
    0
  • For a Comparison Between Hadoop Vs Cassandra/HBase read this post.

    Basically HBase enables really fast read and writes with scalability. How fast and scalable? Facebook uses it to manage its user statuses, photos, chat messages etc. HBase is so fast sometimes stacks have been developed by Facebook to use HBase as the data store for Hive itself.

    Where As Hive is more like a Data Warehousing solution. You can use a syntax similar to SQL to query Hive contents which results in a Map Reduce job. Not ideal for fast, transactional systems.

      November 15, 2021 12:27 PM IST
    0
  • Hadoop is a a framework that allows for the distributed processing of large data sets across clusters of computers using simple programming models.

    There are four main modules in Hadoop.

    1. Hadoop Common: The common utilities that support the other Hadoop modules.


    1. Hadoop Distributed File System (HDFS™): A distributed file system that provides high-throughput access to application data.


    1. Hadoop YARN: A framework for job scheduling and cluster resource management.


    1. Hadoop MapReduce: A YARN-based system for parallel processing of large data sets.


    Before going further, Let's note that we have three different types of data.


    • Structured: Structured data has strong schema and schema will be checked during write & read operation. e.g. Data in RDBMS systems like Oracle, MySQL Server etc.

    • Unstructured: Data does not have any structure and it can be any form - Web server logs, E-Mail, Images etc.


    • Semi-structured: Data is not strictly structured but have some structure. e.g. XML files.


    Depending on type of data to be processed, we have to choose right technology.

    Some more projects, which are part of Hadoop:

    • HBase™: A scalable, distributed database that supports structured data storage for large tables.


    • Hive™: A data warehouse infrastructure that provides data summarization and ad-hoc querying.


    • Pig™: A high-level data-flow language and execution framework for parallel computation.


    Hive Vs PIG comparison can be found at this article and my other post at this SE question.

    HBASE won't replace Map Reduce. HBase is scalable distributed database & Map Reduce is programming model for distributed processing of data. Map Reduce may act on data in HBASE in processing.

    You can use HIVE/HBASE for structured/semi-structured data and process it with Hadoop Map Reduce

    You can use SQOOP to import structured data from traditional RDBMS database Oracle, SQL Server etc and process it with Hadoop Map Reduce

    You can use FLUME for processing Un-structured data and process with Hadoop Map Reduce

    Have a look at: Hadoop Use Cases.

    Hive should be used for analytical querying of data collected over a period of time. e.g Calculate trends, summarize website logs but it can't be used for real time queries.

    HBase fits for real-time querying of Big Data. Facebook use it for messaging and real-time analytics.

    PIG can be used to construct dataflows, run a scheduled jobs, crunch big volumes of data, aggregate/summarize it and store into relation database systems. Good for ad-hoc analysis.

    Hive can be used for ad-hoc data analysis but it can't support all un-structured data formats unlike PIG.

    This post was edited by Viaan Prakash at August 10, 2021 2:57 PM IST
      August 10, 2021 2:56 PM IST
    0