Data Models and DBMS Types

What are the 5 common database models?

Relational, document, key-value, wide-column and graph are five database models common in modern work. Here's what each one stores and when it tends to fit.

On this page
  1. Short answer
  2. Relational
  3. Document
  4. Key-value
  5. Wide-column
  6. Graph
  7. How to choose among them
  8. Data warehouses use a different design

Short answer

Five database models come up most often in current work: relational, document, key-value, wide-column and graph. Relational is the only one of the five that is not usually grouped under NoSQL. The other four are NoSQL models, many of them built for flexible structure or for spreading data across many servers. Older textbooks list a different set, covered in what are the four types of database models.

Relational

Relational databases store data in tables with defined columns, linked by keys and queried with SQL. They are a common choice for applications that need structured records and transactions. MySQL, PostgreSQL and Microsoft SQL Server are relational. For the products people most often choose, see what are the top 5 sql databases.

Document

A document database stores each record as a self-contained document, often in a JSON-like format with nested fields. Documents in the same database do not have to share the same fields, which allows a flexible structure. MongoDB and CouchDB are common examples.

Key-value

A key-value store maps each key to a value, much like a dictionary. Lookups by key are simple and quick, but queries that look inside the value are limited or need extra tools. Redis is a widely used example, often used for caching.

Wide-column

A wide-column store keeps rows that can hold different sets of columns, with columns grouped into column families. Data is typically spread across servers by a partition key, so access by that key can scale out. Apache Cassandra, Apache HBase and Google Bigtable are examples.

Graph

A graph database stores nodes and the relationships between them, and a query can follow those links across several steps. This suits social connections, product recommendations and similar questions. Neo4j is a common example.

How to choose among them

Start from the questions you need to answer. If records are structured and need transactions across tables, a relational database is the usual starting point. If your data is mostly looked up by one key, a key-value store may fit. Document, wide-column and graph models fit specific shapes of data. Many NoSQL systems give up some features, such as joins across collections or strict consistency across servers, in return for flexibility or scale. Some products blend models; these are called multi-model databases.

Data warehouses use a different design

Data warehouses often use dimensional models, with star or snowflake schemas, built on relational engines. They are a design pattern rather than a separate model, so they are not one of the five. For the warehouse products themselves, see what are the top 5 data warehouses.

The complete guide to data models and dbms types

What Are the Types of Data Models in DBMS?
Read the guide

Keep exploring

Guides from other topics

All topics →