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 6762175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:17:08+00:00 2026-05-26T14:17:08+00:00

I am about to deploy a web app using MongoDB as storage. The problem

  • 0

I am about to deploy a web app using MongoDB as storage. The problem is, that locally I can build the indexes whenever I want (also done automatically) – but you shouldn’t do that in production. Now switching to production I am not quite sure on when to build the indexes and how often. Should I do it every day? Should I do it once a week? My project is like a small social network – so let’s say I will have about 100.000 users someday. Depending on the amount of data it could take hours or even days to build indexes.

I intend to build my indexes in the background (see here http://www.mongodb.org/display/DOCS/Indexing+as+a+Background+Operation). It will still cause a write lock, but the build job will pause to allow other readers and writers to access the database – so if I there would be a heavy load on the database, a background index build would still affect the performance in a negative way. So it should be done within a time window where the traffic is at a minimum (researched here http://www.javabeat.net/articles/353-indexing-in-practice-using-mongodb-1.html).

Does anybody have experience on when and how often to create indexes in production (preferably with a large amount of data)? I am using Rails with Mongoid (http://mongoid.org/).

  • 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-05-26T14:17:08+00:00Added an answer on May 26, 2026 at 2:17 pm

    You seem to assume you have to periodically rebuild indexes. This is not the case. MongoDB updates indexes as you write to the related data.

    The only possible reason I can see for production index rebuilds are :

    • Live optimization (e.g. adding an index to a field because it will dramatically improve performance)
    • After deploys that involve schema changes
    • After index related errors (should not occur)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to deploy my web app remotely using the tomcat plugin from
I'm looking to deploy a web app and I have a simple question about
We're about to deploy a Java web application built using JBoss Seam as the
I am using eclipse and I can build the webapp and deploy it to
I am working on a Java web app with unit tests that deploy the
I have a plain ruby application (it's not a Web app, so not using
I'm thinking about putting the virtualenv for a Django web app I am making
I am developing a web app and want to be able to stagger the
Is it possible to deploy an application to a GlassFish app server that would
I have a Flex/Java web application that uses Maven as a build tool. Currently,

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.