What does document-oriented mean?
In the MongoDB context it 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 the JSON notation. This is by default: MongoDB uses JSON to exchange data , and BSON - an extended binary version of JSON - to allow descriptions of data types and logical operators.
What are the key 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
) prior to 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 database? If not, where else can it be used?
I would say no. Any structure that works with complex object serialization - disk storage of JSON files, for example - can be considered a document structure (as defined by MongoDB).