What does document-oriented mean?
I have seen that there are numerous oriented terminologies, such as Object-Oriented, agent-oriented, aspect-oriented, class-oriented, and several others.
But what I've seen recently is document-oriented, as said in the MongoDB description:
MongoDB (humongous, "gigantic") is an open source, high-performance, schema-free, document-oriented application.
- What does oriented mean to documents?
- What are the main qualities / differences of this paradigm?
- is this term only applicable to database? If not, where else can it be used?
1 answers
What does document-oriented mean?
In the context of MongoDB means that data is stored in complex object format, as in the example below:
{
title: "MongoDB: The Definitive Guide",
author: [ "Kristina Chodorow", "Mike Dirolf" ],
published_date: ISODate("2010-09-24"),
pages: 216,
language: "English",
publisher: {
name: "O'Reilly Media",
founded: 1980,
location: "CA"
}
}
The following two queries are equivalent :
SELECT * FROM BOOKS WHERE pages >= 216; // Transact-SQL
And
db.getCollection("BOOKS").find({pages: { $gte: 216 } }) // BSON
Notice that the object follows JSON notation. This is by default: MongoDB uses JSON for data exchange , and BSON - a binary, extended version of JSON-to allow descriptions of data types and logical operators.
What are the main qualities / differences of this paradigm?
Traditional DBMS tables are two-dimensional structures (columns x rows). This means that you need to decompose a complex object into nested structures (eg.NotaFiscalCabecalho
, NotaFiscalItens
) before storage-and, conversely, collect records from various tables to recompose the object.
With a database that stores complex objects, this step is unnecessary.
Is this term only applicable to database? If not, where else can it be used?
I would say no. Any structure that works with serialization of complex objects - disk storage of JSON files, for example-can be considered a document structure (according to the definition of MongoDB).