4

I'm using Neo4j for a large graph of data, and using MongoDB to store detailed document information about individual nodes.

I need to be able to take the results of my graph traversals (sometimes up to 1000 bson_ids) and query Mongo for them. I've noticed that even with selects and limits, the performance isn't great.

Any ideas on how I can make this mapping more efficient?

1
  • 1
    Can you provide some details on how you're doing your queries? Are you using the $in command? How large are the 1000 documents you're returning. If you're returning 1000 docs and they're each one MB in size, that's going to affect performance.
    – Gates VP
    Apr 30, 2011 at 23:33

1 Answer 1

1

Unfortunately I have no advice regarding fast mongo document retrieval. Perhaps the $in operator helps.

Are you querying mongo directly too on other occasions ? Or are you just querying the graph? Then perhaps you could also either serialize your documents directly to node properties. Or even better represent them in the graph - graph databases are a superset of document databases anyway. (document being described aggregate root node and its tree of dependend nodes or a dynamic document which is defined with a traversal - see the neo4j spatial dynamic layers) Other people use graph databases for document centric applications and engines too (e.g. the structr CMS on Neo4j)

2
  • 1
    Also, have a look at Square Pegs and Round Holes in the NOSQL World by Jim Webber regarding document dbs and graphdbs.
    – nawroth
    Apr 29, 2011 at 9:46
  • 1
    I appreciate the answer, and the article in the comment here is great. Thanks for the tips, I've been inspired
    – Tim
    May 1, 2011 at 4:38

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.