Document Database Explained

 

WHAT IS A DOCUMENT DATABASE?

A document database, also called a document store or document-oriented database, is a subset of a type of NoSQL database. Some document stores may also be key-value databases. A document database is used for storing, retrieving, and managing semi-structured data. Unlike traditional relational databases, the data model in a document database is not structured in a table format of rows and columns. The schema can vary, providing far more flexibility for data modeling than relational databases.

HOW DOES A DOCUMENT DATABASE WORK?

A document database uses documents as the structure for storage and queries. In this case, the term “document” may refer to a Microsoft Word or PDF document but is commonly a block of XML or JSON. Instead of columns with names and data types that are used in a relational database, a document contains a description of the data type and the value for that description. Each document can have the same or different structure. To add additional types of data to a document database, there is no need to modify the entire database schema as there is with a relational database. Data can simply be added by adding objects to the database.

Documents are grouped into “collections,” which serve a similar purpose to a relational table. A document database provides a query mechanism to search collections for documents with particular attributes.

BENEFITS OF A DOCUMENT DATABASE

Document stores offer important advantages when specific characteristics are required, including:

  • Flexible data modeling: As web, mobile, social, and IoT-based applications change the nature of application data models, document databases eliminate the need to force-fit relational data models to support new types of application data models.
  • Fast write performance: Unlike traditional relational databases, some document databases prioritize write availability over strict data consistency. This ensures that writes will always be fast even if a failure in one portion of the hardware or network results in a small delay in data replication and consistency across the environment.
  • Fast query performance: Many document databases have powerful query engines and indexing features that provide fast and efficient querying capabilities.

tier-1-line class=

USING RIAK AS A DOCUMENT DATABASE

When the data being persisted is easily rendered as a JSON document and needs to be queried, Riak is an excellent solution for persisting and modeling document data.

ブログの投稿を読む

STEP BY STEP: IMPLEMENTING A DOCUMENT STORE WITH RIAK

Learn how Riak can be used as a highly scalable, highly available document store with rich, full-text query capabilities.

Read the tutorial