I am building a project for one of my classes and need help choosing the proper database.
So I want to create organizational charts online and save them in some database. I know this is technically a tree structure, so I wondered if using a graph database like neo4j would be better than a document JSON database (like MongoDB).
Ideally, I would need to be able to save the node's metadata (like name, occupation, previous node, node location on the page...) in order to be able to open the file later on while keeping the data the same (like the location of the nodes would be the same on the page).
Lastly, I would also need a database to update the nodes quickly when a change is created.
Any help would be tremendous! I don't have much knowledge of NoSQL and graph databases.
Both MongoDB as well as Neo4j should be fine, however both have a few limitations:
MongoDB:
Neo4j:
I personally use a polyglot architecture in my code, which means that I use multiple databases in parallel. I use Neo4j for the basic structure and advanced cypher query capability, and MongoDB for additional data (arrays, objects). All elements have UUIDs as identifiers, which are set in all databases. A bit harder to use than a single database, but once your insert/update/delete code works across them, it's super useful to benefit from every database's primary advantage.
Don't underestimate the query advantage Neo4j/Cypher provides; I would recommend you to experiment with Neo4j a bit, maybe create a manual dataset etc. In the beginning you can also test it online: https://neo4j.com/cloud/platform/aura-graph-database/
Note 1: As Christophe Willemsen pointed out, Neo4j does support arrays as properties. Although they are not as flexible as generic arrays like in JSON, as Neo4j's implementation requires all properties of the Array to be the same type. Mixed numbers, i.e. integers and floats, will all be converted to floats.