Row vs Column-Oriented DB

Before understanding the data model of HBase, let’s first understand the difference between Row-Oriented DB and Column-Oriented DB.

Row-Oriented DB:

  1. Traditional Database follows a row-oriented design to store the data.
  2. It is based on a fixed schema and easy to read and write.
  3. The row and all its column values persisted together in the disk/memory. The Row-Oriented Database is suitable for OLTP systems where you want to insert a bunch of attributes for one record.
  4. This system is not efficient for aggregation function as the system has to scan the entire table and provide output.

Ex: When we do a table scan, let’s say select column-b from table where column-a=’Something’.

In this case, the query will read every row in the table and looks for the column-b in each row. This involves a lot of I/O costs.

Column-Oriented DB:

  1. Column-Oriented Databases stores data in disk column by column. Data is also retrieved in columns.
  2. This is suitable for OLAP systems.
  3. Faster access to data during select queries.
  4. Efficiently perform aggregation because it has to deal with only columns and involves less I/O cost.

Apart from Hbase, MariaDB, Greenplum Database, Cassandra, Apache Kudu etc are few examples of Column Oriented DB.

Leave a Reply