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

  • SEARCH
  • Home
  • 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 7772765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:57:10+00:00 2026-06-01T16:57:10+00:00

I have a very large MongoDB object, about 2MB. I have to update frequently

  • 0

I have a very large MongoDB object, about 2MB.

I have to update frequently the readCount field and I need to be sure that the operation is very fast.

I know about “update-in-place” and I’m able to send this simple operation

db.pages.update( { name:"SamplePage" }, { $inc: { readCount : 1 } } );

But how MongoDB process that operation internally?
It load all the document from disk, modify the value, and store the entire document, or, if the document size does not change, it is able to update on disk only the file part relative to the readCount value?

  • 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-01T16:57:12+00:00Added an answer on June 1, 2026 at 4:57 pm

    MongoDB uses memory-mapped files for its data file management. What this actually means is that mongo doesn’t load documents from disk. Instead it tries to access a memory page where that document is located. If that page is not yet in RAM, then the OS goes ahead and fetches it from the disk.

    Writing is exactly the same. Mongo tries to write to a memory page. If it’s in RAM, then it’s ultra-fast (just swapping some bits in the memory). The page is marked dirty and the OS will take care of flushing it back to disk (persisting your changes).

    If you have journal enabled, then your inserts/updates are somewhat more expensive, as mongodb has to make another write to the append-only file.

    In my app mongodb handles 10-50k updates per second per instance on a modest hardware.

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

Sidebar

Related Questions

I have a very large image that I would like to show a 200x200px
I have a very large code base that contains extensive unit tests (using CppUnit).
We have some very large data files (5 gig to 1TB) where we need
I have a very large file that looks like this (see below). I have
I have a very large codebase (read: thousands of modules) that has code shared
I have a very large possible data set that I am trying to visualize
I want to build an enterprise application that will have very large number of
I have a very large table with an indexed datetime field. I want to
I have very large string lists and arrays and i found 2 issues that
I have very large files (more than 10Gb). I need only some lines from

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.