1

Am developing location based job search application .

In this use case, Organization object will have a jobPost object. Jobpost object will have job_description,skill_sets,location..etc.

Organization can post Unlimited jobs hence if i use mongodb jobPost section inside Organization document will be growing.

Query : Is it good to design schema by Embedding jobPost object inside Organization object Or is it good to create two documents one for Organization and other for jobPost and use reference of organisation in jobPost Or Its not suggested to use MongoDb for this UseCase.

Pravin Reddy
  • 651
  • 2
  • 8
  • 20

1 Answers1

0

I probably wouldn't use MongoDB for this use case. This is relational data and would be better served by MySql or Sql Server.

If you choose to use MongoDB, you should put the jobPost documents in their own collection for efficient indexing. It is better to return each jobPost document that meets your query rather than a whole Organization document with all the jobPost sub docs. That said, you could do map reduce gymnastics to pull out the jobPost sub docs if they were nested in an organization but query writing will be much easier in separate collections.

avanti
  • 129
  • 6
  • 1
    Also, embedding job postings (assuming they can be large and not truncated) will probably exceed the 16MB document size limit – Steve Tarver Sep 13 '15 at 23:40
  • in my use case i have one or two joins maximum per query.Does MongoDb didn't evolved even for two joins in a query.I don't have experience with mondogb at production level.I love to use mongodb with node.js for my use case where i can store huge number of job post's for a organization and there location.I felt as data grows huge, mongodb scalability and geo-indexing will help the app to work efficiently. – Pravin Reddy Sep 14 '15 at 07:08
  • MongoDB is awesome... but you need a paradigm shift in your understanding of data stores to fully get it. – avanti Sep 14 '15 at 15:28
  • See this post for more information. http://stackoverflow.com/questions/2350495/how-do-i-perform-the-sql-join-equivalent-in-mongodb. – avanti Sep 14 '15 at 15:35