!! Help needed for Schema Design !!

99 views
Skip to first unread message

Deepak Gupta

unread,
Jan 17, 2016, 1:04:48 AM1/17/16
to mongodb-user
Hi Chaps,

I'm working on the project where I've to design a Schema for a JOB Portal web site , I know there a lot of things to be clear before you design your schema such as , Is it read heavy or write heavy application etc .

But what I'm looking here is for any suggestion or documentation for the JOB Portal web site , would help me a lot in order to design more appropriate schema. 

If some one has any idea or link for reference , Please do share !

Thanks D 

Clive Strong

unread,
Jan 18, 2016, 3:43:02 PM1/18/16
to mongodb-user
Maybe a better approach would be to post the specific challenges you are facing with your design?

I can see what your asking, but trying to fit your requirements into a generic design sounds like a painful exercise.

Deepak Gupta

unread,
Jan 19, 2016, 12:05:43 AM1/19/16
to mongod...@googlegroups.com
Hi Clive,

Please find the attachment , may be that would give you clear idea what I've designed so far , and if there is any need for further corrections , please suggest me !

Thanks & Regards
Deepak

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/xn64Ppz1Oyo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/827a1035-0c5f-47d9-8cad-f98cff68e955%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

RIG_JOB_PORTAL_SCHEMA.pdf

Wan Bachtiar

unread,
Jan 24, 2016, 8:40:02 PM1/24/16
to mongodb-user

I know there a lot of things to be clear before you design your schema such as , Is it read heavy or write heavy application etc .

Hi Deepak,

An important thing to know is how the application is going to interact with the database. Data in MongoDB has a flexible schema. A great thing about this is that it allows you to focus on your application design and let the database design conform for the benefit of the application (See Domain Driven Design approach). Instead of designing your database schema first, you should figure out how the application will access the data.

Using your schema as an example, a common case for a job-search landing page is to display all job listings along with their locations. Utilising the reference ID as currently designed, you would have to run two queries; one to fetch qualified jobs, then fetch all the related locations based on the location_id. On the other hand, if you embed the location information into the job document, you only have to execute one query. See Embedded Data Models for more examples.

While embedding works for the above case, this does not mean that we have to embed all data into a single document. There are cases where normalised data would be useful. In general, you should use normalised (reference) data models when embedding would result in duplication of data but would not provide sufficient read performance advantages to outweigh the implications of the duplication. As an example, you would use a reference to store company’s description instead of embedding company’s description into a job document. See Normalized Data Models for more examples.


if there is any need for further corrections , please suggest me

There are a couple of things to consider:

  • In MongoDB, documents stored in a collection already have a unique _id field (ObjectId). It may be worth using company._id instead of your own custom id company.company_id.
  • Generally, you would want to avoid using references in history if your goal is to capture a consistent point in time. For example, if the job_seeker skills set has been changed, the history information would have changed as well.


Also useful readings:


Regards,

Wan.

Deepak Gupta

unread,
Jan 25, 2016, 12:13:18 AM1/25/16
to mongod...@googlegroups.com, wan.ba...@mongodb.com
Hi Wan,

Thank you so much for your helping , its really a huge help . Much appropriated !  

Cheers 
Deepak 

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/xn64Ppz1Oyo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
Reply all
Reply to author
Forward
0 new messages