---
title: "Column vs row-oriented NoSQL databases"
subject: "Big Data Technologies"
chapter: 4
key: "semester_8/big_data_technologies:column-oriented-nosql-row-oriented"
source: https://www.bctengineer.com/q/semester_8/big_data_technologies/column-oriented-nosql-row-oriented
site: BCT Engineering
---

# Column vs row-oriented NoSQL databases

Big Data Technologies · Chapter 4: NoSQL

- Asked in: 2075 Bhadra, 10 marks
- Video: [Episode 2: Row vs Column Store](https://www.youtube.com/watch?v=XNrsRVMfj1c) — Databases Demystified
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/big_data_technologies/column-oriented-nosql-row-oriented
- Whole chapter: https://www.bctengineer.com/md/semester_8/big_data_technologies/chapter-4

## Question

Hbase, Cassandra and MongoDB are called column-oriented NoSQL database? How row-oriented database differ from column-oriented database? Explain with suitable examples.

## Short answer

HBase and Cassandra are column-family stores, while MongoDB is a document store. Row-oriented databases store entire rows together, optimizing OLTP; column-oriented stores store columns together, speeding up analytical queries on few columns by reading only necessary data, offering better compression and handling sparse data.

## Answer

#### Are HBase, Cassandra and MongoDB column-oriented?

Strictly, only **HBase and Cassandra** are called column-family (wide-column) stores. They are modelled on Google's BigTable: data is organised into rows and **column families**, columns can be added freely per row, and data of a column family is stored together on disk. HBase has rows -> column families -> qualifiers -> versioned cells. Cassandra has keyspaces -> column families (tables) -> rows with dynamic columns.

**MongoDB is not column-oriented.** It is a **document store**: it saves data as JSON-like (BSON) documents. It is often grouped loosely with the "NoSQL" family, but its storage unit is the document, not the column family. So the statement is correct for HBase and Cassandra, but wrong for MongoDB.

#### Row-oriented vs column-oriented databases

A **row-oriented** database stores all values of a row contiguously on disk (e.g. MySQL, Oracle). A **column-oriented** database stores the values of one column (or column family) contiguously.

Example table:

| ID | Name | Age | City |
|---|---|---|---|
| 1 | Ram | 25 | Kathmandu |
| 2 | Sita | 30 | Pokhara |
| 3 | Hari | 28 | Butwal |

```text
Row-oriented layout on disk:
[1,Ram,25,Kathmandu][2,Sita,30,Pokhara][3,Hari,28,Butwal]

Column-oriented layout on disk:
ID:   [1,2,3]
Name: [Ram,Sita,Hari]
Age:  [25,30,28]
City: [Kathmandu,Pokhara,Butwal]
```

| Point | Row-oriented | Column-oriented |
|---|---|---|
| Storage | Whole row together | Column together |
| Best for | OLTP: insert/update/read whole record | OLAP/analytics: aggregates on few columns |
| Query `AVG(Age)` | Reads all columns of every row | Reads only the Age column |
| Insert a new record | Fast, one write | Slower, touches many column files |
| Compression | Less effective (mixed types) | High (same type values together) |
| Schema | Fixed, rigid | Flexible, columns added on the fly (HBase, Cassandra) |
| Sparse data | Wastes space with NULLs | Missing cells simply not stored |
| Examples | MySQL, PostgreSQL, Oracle | HBase, Cassandra, Vertica |

#### Summary

Query "average age of all people" is faster in a column store as only the Age column is read. Query "show everything about person 2" is faster in a row store as one contiguous read gives the whole row. Big-data systems like HBase and Cassandra favour column-family storage because of high write throughput, scalability and sparse wide tables.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which statement about MongoDB is correct?
   A. It is a column-family store like HBase
   B. It is a document store, not column-oriented
   C. It is a graph database
   D. It is a key-value store only
   Answer: B. MongoDB stores BSON documents; only HBase and Cassandra are column-family stores. (Key point: MongoDB type)

2. Why is AVG(Age) faster in a column store?
   A. It reads every column of every row
   B. Columns are stored randomly
   C. Inserts are faster
   D. It reads only the Age column
   Answer: D. Column storage keeps Age values together, so only that column is read. (Key point: Analytics query)

3. Which task favours a row-oriented database?
   A. Aggregating one column over billions of rows
   B. Fetching or inserting a whole record (OLTP)
   C. Compressing same-type values
   D. Storing sparse wide tables
   Answer: B. A row store keeps a record contiguous, so one read or write handles it all. (Key point: Row store strength)

4. Why does a column store compress better?
   A. It stores NULLs
   B. It uses larger disks
   C. Values of the same type are stored together
   D. It stores rows twice
   Answer: C. Similar same-type values stored together compress well, unlike mixed-type rows. (Key point: Compression)

## Related in Big Data Technologies

- [Structured vs unstructured, NoSQL taxonomy](https://www.bctengineer.com/question.md?key=semester_8%2Fbig_data_technologies%3Astructured-unstructured-nosql-taxonomy) — Big Data Technologies, chapter 4

## Related in other subjects

- [DMQL; transactional vs warehouse database](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Admql-transactional-vs-dw) — Data Mining, chapter 2
- [DW characteristics vs operational database](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Adw-characteristics-vs-operational) — Data Mining, chapter 1
- [RDBMS vs DW database; DW terms](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Ardbms-vs-dw-terms) — Data Mining, chapter 1
- [Data warehouse vs database](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Adw-vs-database) — Data Mining, chapter 1
