Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8080239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:21:17+00:00 2026-06-05T16:21:17+00:00

We are developing an application which is read heavy and could possibly have millions

  • 0

We are developing an application which is read heavy and could possibly have millions of documents. We need to refer to user information in almost every collection. User information has some attribute that can change from time to time.

Should we use DBref or embed the user information in all collections?

How bad is DBref performance in a heavy read app?

If we will not use DBref, how can we update each document, if the user information changes periodically?

In Mongodb, is there any alternative for DBref and embedded documents for this kind of use case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:21:19+00:00Added an answer on June 5, 2026 at 4:21 pm

    DBref isn’t anything like a Foreign key in traditional relational systems. Its only a convention which easily tells a driver (who’s capable of) to autoload those referred documents. Please see DBRef for more information on this.

    Depending on the driver used, you may be able to load those references automatically only when you need them (lazy), so the performance overhead should be really small. But the storage overhead is a bit higher than a simple referenced _id of another document. Basically, I would say that you should only use those DBrefs if the linked document can be of variable type. If it’s static then you’re stuck with _id-references and maybe your own lazy loader functionality, so you don’t repeat yourself.

    Don’t repeat yourself (or data duplication in database terms) applies in your context as well, as MongoDB recommends (so I would too), is to only link your documents. Else you would have higher storage usage and somewhat long running updates, to update only one logical entity (duplicated physically very often).

    With the previously mentioned custom lazy loader you may add some caching so that not every lookup actually results in a mongodb lookup. Most likely you would then need to take care of your data consistency between cache and db.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am developing an web application in which i have to read binary from
I am developing an application in which i have to read the contents of
I am developing an application which requires real-time updates to the end user. However,
I am developing an application which requires to add Calendar event. I have written
We're developing a data heavy modular web application stack with java but have little
I have an application/phone which I am developing to be given to people who
I'm developing an application which read some data from a db. The connection to
I am developing a Grails-application which uses several databases, others are read-only and 1
I am developing an application which requires the user to drag a file from
Sir, I am developing an application in which i am to save some information

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.