What does document-oriented mean?

9

I've seen that there are a lot of targeted terminologies, such as object-oriented, agent-oriented, aspect-oriented, class-oriented, and many others.

But what I saw recently is document-oriented, as stated in MongoDB's description:

  

MongoDB (humongous, "gigantic") is an open-source, high-performance, schema-free, document-oriented application.

  • What does document-oriented mean?
  • What are the key qualities / differences of this paradigm?
  • Is this term only applicable to database? If not, where else can it be used?
asked by anonymous 10.07.2017 / 22:35

1 answer

7
  

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).

    
11.07.2017 / 15:39