Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Is NoSQL an object-oriented database?

Popular NoSQL databases like MongoDB and AWS DynamoDB are document-
oriented databases while others like Cassandra are key-value stores. Document
databases, like OODs, don't work in terms of tables, rows, and columns; but some
languages might need an ODM to better work with objects.

Every “record” is seen as a document, which can shrink and grow in terms of the
attributes it stores for a given entity. At times, relationships between documents
might be the preferred approach.

For example, you can think of a BlogPost document that has associations with
multiple Comment documents and Like documents. At other times, relationships can be
embedded directly into a document. In this case, you can imagine
a BlogPost document with a Comments attribute which is an array of text strings and
usernames, and then another Likes attribute which is an array of usernames and
timestamps.

Document databases provide flexible structures that scale well horizontally. They
can be powerful in storing very complex documents which, on the surface, might
seem like they're the same thing as objects — and many modern programming
languages confuse MongoDB further by calling these documents “objects.” However,
 these documents are not objects in the traditional sense of object-oriented
programming as described above.

Document databases are similar but not the same thing as object-oriented
databases.

What are the advantages of object-oriented


databases?
With all of their complex associations to other objects, and because complex data
objects persist in an OOD, the most significant advantage of the OOD over RDBMS
is the ability to query across these complex relationships very quickly.

 There are no slow “joins” as in an RDBMS. Instead, you have fast queries
with complex data.
 Since the database structure is so close to the programming objects, the code
is simpler and lighter.
As another example, we might think back to our task object instance, which cannot
be stored as-is in MySQL. It needs first to be decomposed into its attributes to be
stored in the table as a row with columns. The reverse process will involve
retrieval and composition. Not so with object-oriented or document databases. Have
an object? Store the whole thing in the database.

You might also like