• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Advantage to storing data row wise in Hbase tables as compared to Relational DB?

 
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hbase tables stores data row wise instead of column wise like in Relational DB tables like sql.what is the advantage of this.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Monica. Shiralkar wrote:Hbase tables stores data row wise instead of column wise like in Relational DB tables like sql.what is the advantage of this.



Flexibility, scalability among a couple. Any type of NoSQL database has advantages over SQL in areas that that type of NoSQL database is used for. It isn't necessarily one better than another, or that one is used over any other. It is that now we can store data in our app in a style of database that best fits that type of data. Which also means that I might have more than one database in my application. I could have a Relational DB, one like HBase, one like Neo4J, and one like MongoDB as an example.

Mark
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mark.Now if this data is huge say in terbytes and I have to display this in JSP, what should be the way of accessing this.One way is using Hive queries but since hive query uses map reduce it can take several minutes so JSP page has to wait all that time.What should be the correct way to displaying huge hbase data in JSP
 
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Monica. Shiralkar wrote:Thanks Mark.Now if this data is huge say in terbytes and I have to display this in JSP, what should be the way of accessing this.One way is using Hive queries but since hive query uses map reduce it can take several minutes so JSP page has to wait all that time.What should be the correct way to displaying huge hbase data in JSP


Surely you don't really want to display terabytes of data in your JSP?
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, no one will ever have time in their life to go through a jsp page that has terabytes of data displayed in it.

Monica also don't get confused when you use the sentences like

"Hbase tables stores data row wise instead of column wise like in Relational DB tables"

Because that isn't exactly a correct accurate statement, it can definitely confuse someone.

HBase just doesn't have a predefined set of columns that each and every row has to follow. They don't have any predefined set of columns.

So you have a concept of Keyspace which you can analogize with a database/schema

You have a ColumnFamily which you can analogize to a Table.

Then in a ColumnFamily you basically have a Key that is analogize to a Primary Key Column, and that key maps to a set of columns. Or you could think of it as the Key is mapped to a Map<Byte[], Byte[]> of data.

Hope that helps clear things up.

There is a lot more flexibility in this form that a relational database doesn't have.

Form a query perspective, in SQL you might have a 3rd normal form database that requires many joins, which will slow down the performance.

Again, not one database is a one size fits all solution. The idea behind No SQL and New SQL is that not all data works well in a Relational Database. And vice versa.

Mark
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mark Spritzler wrote:
HBase just doesn't have a predefined set of columns that each and every row has to follow. They don't have any predefined set of columns.


Thanks
Is the primary benefit of this that this causes fast retrieval and the secondary advantage that this saves space (because in case of relational db with predefined columns the null values take lot of space)?
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mark Spritzler wrote:
So you have a concept of Keyspace which you can analogize with a database/schema



I think keyspace is a concept of Cassandra instead of Hbase. Let me check what Hbase uses instead for such a thing.
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mark Spritzler wrote:
There is a lot more flexibility in this form that a relational database doesn't have.



By flexibility, do you primarily mean that not having to go for relations?
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mark Spritzler wrote:

You have a ColumnFamily which you can analogize to a Table.

Then in a ColumnFamily you basically have a Key that is analogize to a Primary Key Column, and that key maps to a set of columns. Or you could think of it as the Key is mapped to a Map<Byte[], Byte[]> of data.

Hope that helps clear things up.



Thanks. That was very useful for understanding.
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mark Spritzler wrote:

Monica also don't get confused when you use the sentences like

"Hbase tables stores data row wise instead of column wise like in Relational DB tables"



I think my question statement itself is wrong because Hbase stores in columnar fashion not row wise.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic