Can I use two droplets for one website?

January 30, 2016 740 views
Server Optimization Configuration Management MySQL

Can I use one droplet for my website whilst another droplet for the MySQL, xmpp chat, images/videos. The problem is that I have easily exhausted my Disk space whilst I dont really need the huge RAM/CPU.

Our site, a social website has lots of images and then we are having "A Database Error Occurred. Unable to connect to your database server using the provided settings " messages often.

Will appreciate words of wisdom from a kind member

2 Answers

One option would be to use DO private networking. Where one droplet would host your application server and the other would hold the database. Or maybe have your master droplet remote mount directories from your slave droplet. In both examples, you would probably want all of those resources only directly accessible behind the firewall. NOTE: private networking need to be located in the same data center, last time I looked.

Another tool to use with multiple droplets is to use DNS to seperate your URI's, such as one droplet serving your http or https URIs, and another droplet being your ftp resource. Even though both droplets would be directly accessible, you can still use private networking between your droplets to have your server apps talk to your privately networked database.

by Etel Sverdlov
Here's documentation on how to set up and use DigitalOcean private networking.
  • Thanks @gndo for your kind response. However, is it possible that I host the images/video on S3 whilst I host the application server and database on DO's two droplets in the same datacenter

    • @ogbongefriends1 - I don't know, but I'm thinking remote mounting AWS filesystems to DO droplets would incur enough network delays that may trigger timeouts during filesystem accesses. Sorry, but I don't have another simple system level solution to suggest.

Have another answer? Share your knowledge.