SQL vs NOSQL: Which to use for this schema? SQL vs NOSQL: Which to use for this schema? mongodb mongodb

SQL vs NOSQL: Which to use for this schema?


Just my opinion:

I Stared at diagram for approx 3 sec, this is clearly relational. Benefits of an RDBMS heavily outweigh a NoSQL solution here. Why would you want to use NoSQL? Are there 100,000+ records (may a million plus)? You need microsecond/millisecond performance?

NoSQL, as I understand, is not because you don't like lots of joins. It's because big systems for hierarchical data don't suit every situation. This suit this perfectly, however.


You can probably implode all of the {organisation, region,campus,event } hierarchy into one hierarchical / tree based / self-referential relation. Maybe "user", too.That would drastically reduce the number of tables needed. for an example, please take a look at this implementation: Interesting tree/hierarchical data structure problem (which is actually more complex than yours).

BTW: I don't have the faintest idea what "metric model" means. Inches? Miles to the gallon? Or just "measurements" ? Could you please explain a bit more what you intend to do?

EDIT: BTW2: the model you propose is technically not too difficult for postgres. But it is probably bigger than necessary for humans.


My question: Given my concerns, do you think this schema -- because of how deeply nested it is -- lends itself more to NoSQL?

Deep nesting is not a point pro or contra SQL/NoSQL.

If so, do you > think the reporting on the "records" will be difficult?

That's the tipping point and here you don't give us the relevant information: What is this "reporting" thing in your case?

  • Does one report aggregate much data?
    E.g. does it simply aggregate all records and return a sum of them?

  • Does it aggregate over many of your layers?

  • Does a report evaluate strictly hierarchical or does it correlate event1.metric4.record42 to event2.metric18.record50 (or something like that)?

  • How much data must be transfered from the NoSQL DB to your application only to aggregate it an throw most of the parts away.

  • How unstructured is your data? Well - very structured it seems.

Those are typical situations/points where RDBMs have proven their value. If these items are not important in your case, then you can choose freely.