There are two types of databases classification based on the layout of the data on disk:

  • Row-oriented

  • Column-oriented

Row-oriented

The row-oriented database organizes data by entity, keeping all the attributes associated with the same entity next to each other. This organization method uses a tabular data format with a row representing an entity and a column representing attributes. In short, row-oriented databases partition data horizontally.

Since disk memory uses blocks as an abstraction to store and retrieve records, modeling individual records to fit inside a block or contiguous blocks allows for efficient data retrieval. As a result, a row-oriented database is optimized for reading and writing records efficiently.

The queries on row-oriented databases are often short-lived and targeted. These databases are generally used in transactional and web applications, where latency is a prime concern.

Advantages of row-oriented databases

  • Allows for easy insertion, update, and deletion of a small batch of records.

  • Uses point-in-time queries to fetch an individual record by a primary key or combination of secondary keys.

  • Offers a range of queries to fetch a small subset of records using a combination of secondary keys.

  • Fetches all or most columns corresponding to point-in-time or range queries.

Disadvantages of row-oriented database

  • They are not suitable for long-running queries that fetch a large set of records.

  • It is more difficult to compute aggregations on a large data set.

Most RDBMS databases are row-oriented, such as MySQL and Postgresql.

Get hands-on with 1400+ tech skills courses.