Row oriented databases are databases that organize data by record, keeping all of the data associated with a record next to each other in memory. Row oriented databases are the traditional way of organizing data and still provide some key benefits for storing data quickly. They are optimized for reading and writing rows efficiently.
let’s take this Facebook_Friends data:
This data would be stored on a disk in a row oriented database in order row by row like this:
Column oriented databases are databases that organize data by field, keeping all of the data associated with a field next to each other in memory. Columnar databases have grown in popularity and provide performance advantages to querying data. They are optimized for reading and computing on columns efficiently.
Let’s look at the same data set again and see how it would be stored in a column oriented database.
A table is stored one column at a time in order row by row:
Difference Between Row-Oriented and Column-Oriented Database
Data us stored and retrieved one row at a time and hence could read unnecessary data if some of the data in a row are required
Data is stored and retrieved in columns and hence it can only able to read the relevant data if required.
Records are easy to read and write.
Read and write operations are slower as compared to row-oriented.
Row-oriented data stores are best suited for online transaction system
Column-oriented stores are best suited for online analytical processing.
These are not efficient in performing operations applicable to the entire datasets and hence aggregation in row-oriented is an expensive job or operations.
These are efficient in performing operations applicable to the entire dataset and hence enables aggregation over many rows and columns.
Typical compression mechanisms which provide less efficient result than what we achieve from column-oriented database
These type of data stores basically permits high compression rates due to little distinct or unique values in columns.
The Tech Platform