Question

Can I use Block or Object (Spaces) Storage for a load balanced infrastructure or do I have to use GlusterFS

Posted October 28, 2018 681 views
Block Storage Object Storage Ubuntu 18.04

I created a load balanced infrastructure but wanted to make sure it could scale by putting the entire app on GlusterFS. Now I’m wondering if I could have used Block/Object storage instead.

For a load balanced WordPress cluster, is it possible to have just mounted Block/Object Storage on a media server and then mounted the folder to WordPress folder for both WordPress nodes?

Or is it possible to mount Block/Object storage to the GlusterFS servers?

1 comment

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.

1 answer

Whenever you are building a distributed system it is important to understand the different functions that are performed, which systems are involved, and what specific distributed/replication measures those systems support internally.

In your specific case you mentioned Wordpress so I’ll go with that as an example.

Whenever you are dealing with static files or media files, it is best to store them in Object Storage, such as Spaces, by default, this will is a system that is automatically distributed and fault tolerant, and you don’t need to monitor it for available diskspace and you can also enable a CDN immediately.

You can find information on how to integrate spaces here:

https://medium.com/muhammet-arslan/how-to-use-digitalocean-spaces-with-wordpress-d4e7f48ece55

https://www.digitalocean.com/community/tutorials/how-to-store-wordpress-assets-on-digitalocean-spaces

When it comes to storing media, block storage itself can only be mounted to a single droplet, so you would need to export it out via NFS if you want multiple systems to access it. But there isn’t a need to do this, as you are better off using Spaces instead.

Next you would have to distribute the database. DigitalOcean now has a Managed Database service which provides support for MySQL and Postgres and sets up replication for you. This way you can create a master database sever and add slave replicas as necessary. You can also enable backups to ensure that if anything goes wrong you can always roll back.

Now your assets and media are stored on Object Storage and your database is replicated.

Last you will need to replicate your web servers and you would use load balancing to split the load across them.

You can find a full tutorial series on that here:
https://www.digitalocean.com/community/tutorial_series/load-balancing-wordpress-with-haproxy

You can also use DigitalOcean’s load balancers for this setup to reduce the need to setup HAproxy yourself.

Hopefully that gives you a head start as well as some basic explanation of the implementation and process.

by Kathleen Juell
DigitalOcean Spaces Sync offers direct compatibility with DigitalOcean Spaces. You can use it to connect your media library to your Space, and it offers options for storing your items on your server and Space, or on your Space alone.
Submit an Answer