Equivalent of ERD for MongoDB?

44,043

Solution 1

It looks like you asked a similar question on Quora.

As mentioned there, the ERD is simply a mapping of the data you intend to store and the relations amongst that data.

You can still make an ERD with MongoDB as you still want to track the data and the relations. The big difference is that MongoDB has no joins, so when you translate the ERD into an actual schema you'll have to make some specific decisions about implement the relationships.

In particular, you'll need to make the "embed vs. reference" decision when deciding how this data will actually be stored. Relations are still allowed, just not enforced. Many of the wrappers for MongoDB actually provide lookups across collections to abstract some of this complexity.

Even though MongoDB does not enforce a schema, it's not recommended to proceed completely at random. Modeling the data you expect to have in the system is still a really good idea and that's what the ERD provides you.

So I guess the equivalent to the ERD is the ERD?

Solution 2

You could just use a UML class diagram instead too.

Solution 3

Moon Modeler supports schema design for MongoDB. It allows users to define diagrams with nested structures.

Solution 4

I know of no standard means of diagramming document-oriented "schema".

I'm sure you could use an ERD to map out your schemata but since document databases do not truly support--or more importantly enforce--relationships between data, it would only be as useful as your code was disciplined to internally enforce such relationships.

Solution 5

I have been thinking about the same issue for quite some time. And I came to the following conclusion: If NoSQL databases are generally schemaless, you don't actually have a 'schema' to illustrate in a diagram.

Thus, I think you should take a "by example" approach. You could draw some mindmaps exemplifying how your data would look like when stored in a NoSQL DB such as MongoDB.

And since these databases are very dynamic you could also create some derived mindmaps to show how the data from today could evolve in time.

Take a look at this topic too.

Confusion about NoSQL Design

Share:
44,043
Admin
Author by

Admin

Updated on November 16, 2020

Comments

  • Admin
    Admin over 3 years

    What would be the equivalent of ERD for a NoSQL database such as MongoDB?

  • Calypso
    Calypso almost 2 years
    joins are possible in MongoDb with the $lookup feature of the aggregation framework