Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool to create a visualization from existing MongoDB [closed]

I took over a project with existing MongoDB. I would like to get visual image (diagram etc) of the existing data. Obviously MongoDB is pretty different case compared to MySQL but I guess there is still something that can be visualized?

like image 437
Petteri H Avatar asked Sep 12 '12 10:09

Petteri H


People also ask

How do I visualize a schema in MongoDB?

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

Can I use GraphQL with MongoDB?

The GraphQL API lets you access data that you have stored in a MongoDB Atlas cluster or Federated database instance. To get started, create a free cluster and link it to your App. If you don't have any data yet but you still want to explore the GraphQL API, consider adding a sample data set to your cluster.

What is a Dashboard How do you create a dashboard using MongoDB charts?

Dashboards are a collection of charts assembled to create a single unified display of your data. Each chart shows data from a single MongoDB collection or view, so dashboards are essential to attain insight into multiple focal points of your data in a single display. Dashboards can be shared with other users.


1 Answers

This really depends on your requirements for "visualization". Typically most of the more interesting visual aspects of a diagram for a relational database are the high level relationships and integrity constraints (1:1, 1:many, primary key, foreign keys, etc).

MongoDB has flexible schema, in the sense that documents within a given collection do not have to comply with a predetermined format. That does not mean that the underlying data cannot have some organization .. just that there is no single schema imposed on a collection (as would be the case in a traditional relational database).

In MongoDB, a lot of the interesting details to visualize will require analysis by inspecting some or all of the documents in a collection OR by reviewing the code.

Code Review

If your application is using an ODM (Object Document Mapper) such as Mongoose (Node.js) or Morphia (Java), the application code may provide a quick and descriptive view of the intended schema (or at least the latest version of the intended schema). An appropriate language documentation tool such as jsdoc or javadoc may be helpful to generate a reasonable overview of your model classes. You will probably have to add some documentation annotations for best results.

Schema Analysis

Schema analysis is a more brute force approach which involves looking at the data in order to infer an observed schema. A common approach for this is to use Map/Reduce.

There are a few different mongo shell helpers that will give you an idea of the general structure of collections (eg. field/data types and their coverage in the source documents):

  • schema.js

  • variety

These aren't visual (in the graphical sense), but the schema analysis results do provide insight into the expected shape of the data and common variations.

Relationships

The MongoDB server does not have support for foreign key relationships, which removes a lot of potentially interesting visual annotations.

There are some different client driver approaches to creating Database References (DBRefs), but these are following usage conventions rather than a server feature. In order to determine relationships between collections using DBRefs, some or all of the documents in a collection would have to be scanned. Inference of relationships isn't supported by either variety or schema.js yet.

Content

To get a better idea of the actual content, you could try one of the Admin UIs.

like image 89
Stennie Avatar answered Sep 25 '22 06:09

Stennie