asgagnon
By:
asgagnon

Separate droplets for mongoDB and nodejs

October 26, 2015 1.7k views
MongoDB Node.js

Hi,

I'm looking to run a web app hosted on digital ocean. Basically, what I'd like is the following.
Server running linux and node.js.
MongoDB, with a RESTful interface so both a website and native apps can easily access the data.
Storage of static files, including the website files, and a boatload of images (since from what I understand, MongoDB is not as efficient at transmitting binary data, so it's better to just have the records store links to the images in a cloud storage site).

Is it better to have the server with the static files on one droplet, and the database on another, or just lump them all together? Or if there is an even better alternative I'm all ears!

1 comment
  • Generally, it's a good practice to separate your database out to another Droplet from something with static storage, which you could potentially keep on your node server. A lot of the potential lumping together, or parsing apart is dependent on the workload, traffic, and utilization of your Droplet. If you find that the static files are being accessed to the point that it is hindering your Node.js performance, perhaps separate that out into another Droplet too.

1 Answer

This question was answered by @BrookDO:

Generally, it's a good practice to separate your database out to another Droplet from something with static storage, which you could potentially keep on your node server. A lot of the potential lumping together, or parsing apart is dependent on the workload, traffic, and utilization of your Droplet. If you find that the static files are being accessed to the point that it is hindering your Node.js performance, perhaps separate that out into another Droplet too.

View the original comment

Have another answer? Share your knowledge.