What it means document-oriented?
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 next two darlings are equivalents:
SELECT * FROM BOOKS WHERE pages >= 216; // Transact-SQL
and
db.getCollection("BOOKS").find({pages: { $gte: 216 } }) // BSON
Note that the object follows the JSON notation. This is by default: O 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 (e.g.. NotaFiscalCabecalho
, NotaFiscalItens
) before storage - and conversely collect records from multiple tables to recompose the object.
With a database that stores complex objects, this step is unnecessary.
Is this term only applicable to the database? If not, where else can it be used?
I would say not. 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).
It is to counter relational database. It uses the concept of document, not linked tables.
– Jefferson Quesado
If I’m not mistaken, Couchbase is also documentary
– Jefferson Quesado