Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of ERD for MongoDB?

Tags:

mongodb

nosql

erd

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

like image 671
Catalin Braescu Avatar asked May 15 '11 18:05

Catalin Braescu


People also ask

Is there ER diagram for MongoDB?

Entity Relationship Diagram (ERD) MongoDB is a non-relational NoSQL database technology, since relationships are not enforced by the database engine. However, data itself contains relationships, and an ER Diagram provides a visualization of these relationships.

Does NoSQL have ER diagram?

NoSQL, unlike SQL which has ER and class diagrams, has neither names nor constraints for data modeling diagrams. The obvious reason is the relaxed rules of NoSQL about relationships, which aim to get a developer started with minimum requirements.

How do I visualize a schema in MongoDB?

Deducing a Virtual SchemaDbSchema can connect to MongoDB, look in the sample collection records, and deduce a virtual diagram from there. All you have to do is to connect to MongoDB and the tool will deduce the schema automatically. Once the diagram is deduced, the possibilities are endless.


2 Answers

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?

like image 95
Gates VP Avatar answered Sep 30 '22 18:09

Gates VP


You could just use a UML class diagram instead too.

like image 32
sinha Avatar answered Sep 30 '22 16:09

sinha