Document databases offer a variety of advantages, including:
An intuitive data model that is fast and easy for developers to work with.
A flexible schema that allows for the data model to evolve as application needs change.
The ability to horizontally scale out.
Because of these advantages, document databases are general-purpose databases that can be
used in a variety of use cases and industries.
Document databases are considered to be non-relational (or NoSQL) databases. Instead of storing
data in fixed rows and columns, document databases use flexible documents. Document
databases are the most popular alternative to tabular, relational databases. Learn more about
NoSQL databases.
In this article, we'll explore answers to the following questions:
What are documents?
What are the key features of document databases?
What makes document databases different from relational databases?
How much easier are documents to work with than tables?
What are the relationships between document databases and other databases?
Why not just use JSON in a relational database?
What are the strengths and weaknesses of document databases?
What are the use cases for document databases?
What are documents?
A document is a record in a document database. A document typically stores information about
one object and any of its related metadata.
Documents store data in field-value pairs. The values can be a variety of types and structures,
including strings, numbers, dates, arrays, or objects. Documents can be stored in formats like
JSON, BSON, and XML.
Below is a JSON document that stores information about a user named Tom.