--
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.
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:
_id field (ObjectId). It may be worth using company._id instead of your own custom id company.company_id. 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.
--
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/ba99f54a-c165-4619-9a2b-80ed9a70cae6%40googlegroups.com.