Hi. I have a single Ubuntu droplet with Nodejs, nginx and mongodb running. I would like to move mongodb to seperate droplet to split the load. Please, give some advice regarding next questions:
Thanks in advance!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there,
Those are some very good questions. Let’s answer them one by one for anyone who comes across this in the future.
Private Networking: You can use a VPC for that. With the DigitalOcean VPCs, your Droplets are isolated at the network level, providing a secure and private environment for your resources. The traffic within a VPC is not visible to other Droplets outside the VPC.
Encryption: When using a VPC adding an extra layer of protection might be an overkill. However, this might depend on your security requirements, even with the enhanced privacy provided by a VPC, it might still a good idea to encrypt the communication between your application and database servers. Alternatively, you could use a Managed MongoDB cluster which already covers this:
Hide Database Server: Yes, you can restrict public access to your MongoDB server by configuring the firewall to only accept connections on the MongoDB port (27017 by default) from the IP of your application server. However, for SSH access, you should allow connections on port 22 from your own IP. This way, you’ll still be able to connect to the server for setup and administration. DigitalOcean provides a cloud firewall service that you can use for this purpose.
Load Balancer: Using a DigitalOcean Load Balancer could be beneficial if you have more than one application server, as it can distribute incoming network load across multiple droplets to ensure better availability and reliability. However, if you only have a single application droplet, using Nginx as a reverse proxy should be sufficient for your needs.
I would personally go for a Managed MongoDB cluster which covers most of the things that were mentioned.
Hope that this helps!
Best,
Bobby