Mongodb – Durability and other limitations in mongoDB

mongodb

I've created web app that use mongodb, my mongo database currently has 4,05 GB , but every day it increase, next year it will probably have about 8 GB ,

I have python scripts that runs every 30 minutes , collect data from Clear Case system and store it in mongodb ,

problem is that server where is web app runned, often crashes and restarts, that cause data corruption in my mongo database, so my web app don't works good , when user type information that will run mongo query that will get corrupcted data.

I solve this problem with backups, every week I make backup and when I notice data corrupcion I replace my mongodb with backup, but this isn't good solution .

I tried repairDatabase , but I get error

{

"errmsg" : "exception: can't map file memory - mongo requires 64 bit build for larger    datasets",

"code" : 10084,

"ok" : 0

}

I'm newbie in mongodb, can someone tell me more about durability in MongoDB, and other limitations in mongoDB, e.g. How will size of mongo database affect to work on my web app , next year size will be at least 8 GB , maybe more … Anyone has similar problems , how to solve it ….

Best Answer

You seem to be using the 32bit version of mongoDB.

It's a miracle you actually got to 4.05GB, because the 32bit version only supports up to 2GB of data.

Any serious MongoDB deployment should be on a 64bit server with a 64bit operating system running a 64bit build of MongoDB. The 64bit version of MongoDB theoretically allows database of almost unlimited size. In reality, you are of course limited to the storage capactity of your server, but MongoDB can always scale horizontally by creating a shard of multiple servers.

Running 64bit will also allow the database to use journaling (the 32bit version also allows journaling in theory, but it's disabled by default because it further limits the amount of data you can store). With journaling enabled, MongoDB is far less likely to require a repair after a sudden crash.