Question

I have an account with MongoLab for MongoDB and the constant calls to this remote server from my app slow it down quite a lot. When I run the app locally on my computer with a local version of Mongod and MongoDB it's far, far faster, as would be expected.

When I deploy my app (running on Node/Express) it will be run from a VPS on CentOS. I have plenty of storage space available on my VPS, are there any major downsides to running MongoDB locally rather than remotely on Mongolab?

Specs of the VPS:

  • 1024MB RAM
  • 1024MB VSwap
  • 4 CPU Cores @ 3.3GHz+
  • 60GB SSD space
  • 1Gbps Port
  • 3000GB Bandwidth
Was it helpful?

Solution

Nothing apart from the obvious:

  • You will have to worry about storage yourself. MongoDB does tend to take a lot of disk space. upgrading storage will probably be harder to manage than letting Mongolab take care of it.
  • You will have to worry about making sure the Mongo server doesn't crash and it's running fine.
  • You will have scaling issues in the future once the load on your application and your database increases.
  • Using a "database-as-a-service" like Mongolab frees you from worrying about a lot of hardware/OS/system level requirements and configuration. Memory optimization? Which file system? Connection limits? Visualization and IO ops issues? (thanks to Nikolay for pointing that one out)

If your VPS provider doesn't account for local traffic in your bandwidth, then you can set up another VPS for MongoDB. That way, the server will be closer so the requests will be faster, and also, it will have the benefits of being an independent server. It still won't be fully managed like MongoLab though.

[ Edit: As Chris pointed out, MongoLab also helps you with your database schema design and bundles MongoDB support with their plans, so that's also nice. ]

Also, this is a good question, but probably not appropriate for StackOverflow. dba.stackexchange.com and serverfault.com are good places for this question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top