2

I'm planning to build a wiki/resource app which, by itself, makes sense to be using Mongo for. However, the primary purpose of the app is to have associative tables showing connections between individual content items. A majorly simplified example would be, Odin, Zeus, Jupiter would be a row within an "Allfather" association. The problem is that these tables could grow indefinitely and it seems like developing this type of network in Mongo would be a rather complex and frustating experience.

I've thinking about using Mongo for the pages and just maintaining a small Postgres database for these associations, but something intuitively feels wrong about that. However, I'm an experienced frontend dev that's just starting to dabble in backend/database, so I'm not willing to trust my intuitions on databases yet haha.

Is postgres + mongo a good solution for the above problem, or is this where something like a graph database (which I only learned about yesterday) would come into play?

4
  • normalization slows down the select query when there are many tables involved and the data is huge. de-normalized table is better for such scenarios Commented Oct 11, 2018 at 2:26
  • But still i am not experienced in it so please do more research.. Haha Commented Oct 11, 2018 at 2:28
  • 1
    Why use MongoDB at all? AFAIK PostgreSQL with jsonb out-performs MongoDB for working with most semi-structured data while giving you all the excellent and incredibly useful relational features (joins, recursive CTEs, referential integrity, ...). I don't have any direct experience with graph databases so I can't comment on that. That said, we're deep into opinion territory here so I suspect that this question won't stay open for long. Commented Oct 11, 2018 at 5:14
  • @muistooshort well, mostly because 15 years of JavaScript means Mongo is super easy for me to grasp and adding SQL to the list to learn before I can start building seemed like a PITA... it was just the association part that I was struggling with making work in Mongo. Commented Oct 11, 2018 at 9:16

1 Answer 1

1

After spending the last several hours researching further, it does appear that a graph database is the right solution to managing the "association" feature that I'm looking to develop here because the actual relationships will be rather multidimensional in nature.

Furthermore, I've decided to go with ArangoDB as it merges key-value (ie. Redis or postgres' hstore IIRC), document store (ie. Mongo's documents or Postgres' JSONB), and also does graph database functionality. Arango can do joins between documents and, even better, it has a single, unified query language that works across all 3 types of models. It also has a rather robust tooling environment around it already that seems pretty promsing.

I found this youtube video rather enlightening as well if anyone wants a nice introduction to understanding why you might want to use a "multi-model database" like ArangoDB.

Sign up to request clarification or add additional context in comments.

2 Comments

did you consider RedisGraph?
@GuyKorland no, it didn't come up in my research, but I'll give it a look, thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.