What is the difference between an object-oriented database and documents?

What is the difference between object oriented and documents?

I have not used object-oriented databases, but when I use a document database (RavenDb), I save and read ordinary object-oriented classes without problems.

+6
source share
1 answer

I switched from db4o (OODB) to RavenDB (db document). The big difference that I found is that the object databases store complete objects, and when an object is stored with another object inside it, this sub-object is stored in full and is the latest version of this object. Using a DB document, objects are saved, but they are organized in different ways. The aggregate / root object will store parts of the sub-object so that the aggregate / root object is self-contained. When you retrieve the root object, you do not stretch or grab the objects associated with it.

OODB will store the command this way:

TeamName City List<Player> // The entire player objects would be stored here 

The document database stores the command in this way:

 TeamName City List<string> PlayerNames 

Player names will be stored here because the entire team object is required.

RavenDB has a good explanation of DB document theory:

http://ravendb.net/docs/theory/document-structure-design

+10
source

Source: https://habr.com/ru/post/911723/


All Articles