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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:56:59+00:00 2026-05-31T19:56:59+00:00

I am deploying my first ROR app with MongoDB. I’ve noticed that if the

  • 0

I am deploying my first ROR app with MongoDB. I’ve noticed that if the machine that I have it deployed on is reset then usually the database will be partially or fully gone. This was also happening before I had it explicitly stated in my Rails app that I was using MongoDB without active record, although it worked before I did.

I looked in the /data/db/ folder and there appears to be numerous database files: app-production.1, app-production.2, etc. In my mongo_config.rb initializer file I have the database specified as

 MongoMapper.database = "app-#{Rails.env}"

I also launched the interative mongo console and noticed that there were 5+ app databases. So my question is, does MongoDB or Rails automatically create a new instance of the database when it shuts down? Does MongoDB use multiple files to span the database? Thanks!

  • 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-31T19:57:01+00:00Added an answer on May 31, 2026 at 7:57 pm

    MongoDB database is spanned across multiple files (app-production.1, app-production.2, …). Each new database resides in its own set of files.

    MongoDB offers lazy database creation. If you write to a database and it doesn’t exist, it will be created. If a database with this name exists, it will be used.

    if the machine is reset then database will be partially or fully gone

    It depends on your definition of “reset”. If you unplug power cord, then mongodb won’t have the time to shutdown properly. Recent versions ship with journaling turned on by default, so no major data loss should occur – in case of hard crash, mongodb will try to replay journal. Note: if you’re not running with journaling enabled, you should repair database after any unclean shutdown, or risk facing imminent database corruption.

    If you reinstall the machine instead, then it’s no wonder that data is gone 🙂

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

Sidebar

Related Questions

I have a basic rails3 app that I am deploying on site5. I have
I am deploying my first little app with MongoDB and Mongoid as a driver.
I've always taken the approach of first deploying the database with a minimal set
First thing I would like to say is, i know deploying ror applications in
On my server when deploying the app for the first time, I ran rake
Im having problems deploying my django app to heroku in the first part, heroku's
I have created my first project in C# which uses sql server database (file
Does anyone have any best practices around deploying database changes in an EF 4.1
Deploying an app first time with Capistrano, but having problem running the cap deploy:update
I'm deploying a new Rails app to Heroku. This is the first time I've

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.