Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
How to setup shared storage on DigitalOcean load balanced droplets
I have a WordPress site that periodically peaks in traffic, this does not happen often enough to warrant a beefy server. So I was planning on setting up a load balanced cluster of small droplets.
One problem rose though, how do I keep files synced across the multiple replicated servers, there is no master and slave here. I thought of using a tool like rsync, to keep files in check, but I don’t think this will work in this use case! If one session file got to the other server a little bit late, the user will find himself logged out, user uploaded files on one server might take longer to get to the other than it takes for the user to refresh the page.
So I’m feeling like this is not the right way to go about it.
One solution that I came across, is shared storage, but the block storage supported by DigitalOcean can only be attached to one server.
Is there a setup, where load balancing will ONLY use the other servers purely for their CPU and RAM, if I’m not mistaken, Nginx as a load balancer should work this way, right? Or do I still need to host my app files on all servers in an Nginx cluster.
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.×