Selfit
By:
Selfit

Is it possible to scale horizontally?

June 1, 2017 1.1k views
Scaling Clustering Ubuntu

I have a droplet, where my Parse Server is deployed and now, I'm going to get another one for my Parse LiveQuery Server... Before I do that, I need to know if it's possible to scale horizontally - automatically AND manually - and how!

Thanks in advance!

2 Answers

Hi @Selfit, I'll join @jtittle in this question for few more samples.

Above mentioned way is vertical scaling, which means you're adding more resources to existing Droplet. You also have horizontal scaling, which means that you're adding more Droplets rather than expanding existing.

Vertical is easiest, but there is a big downside. To scale vertically, you need to power-off your Droplet, resize it, then turn it up again. If you don't have another Droplet, your service will not be available until resizing is done.

With horizontal, you add new Droplet so existing doesn't need to go down.

However, there downside with Horizontal scaling is that you need more complex infrastructure. You need some sort of Load Balancer to balance requests between multiple servers.

For Load Balancing, DigitalOcean got you covered.
An Introduction to DigitalOcean Load Balancers will show you how LB works. Price for an LB is $20/mo, without traffic or number of Droplets restrictions.

Also, you will need something that will watch your current Droplets and order creating new one when needed. For that, you will need to build yourself solution, as it depends on user and I'm not sure is there any unified solution.

To help with creating new Droplets, you can resort to API. With new Droplet, you need to configure them appropriately. To help you with provisioning new Droplets, you can build Droplet from Snapshot which will contain everything pre-installed, or to use User data to configure new Droplets.
An Introduction to Cloud-Config Scripting will show you how to use User Data.

What is High Availability? will help you better understand some of key concepts.

If you have any question, feel free to ask anything.

The DigitalOcean metadata service includes a field called "user-data", which can be used to specify a script that will be run as your server is brought online. The CloudInit program, which runs these scripts, can process a special script type called "cloud-config". In this guide, we'll explore how to create cloud-config files and the best ways to leverage their power.

@Selfit

Auto-Scaling can be done, though currently, it's not automatic. You'd need to use the API and one of the existing libraries for your preferred programming language, then interact with it programatically.

https://developers.digitalocean.com/documentation/v2/

You can scale manually from the DigitalOcean control panel by clicking on the name of the Droplet, then Resize from the left side menu. From there you have two options, the first being to scale only the CPU and RAM, and the second being to scale CPU, RAM, and Disk.

The difference between the two is that you can scale down if you only choose to scale the CPU and RAM. If you choose to scale the CPU, RAM, and Disk, you can't scale back down (currently).

  • Hello @jtittle and thanks for responding!
    I'll check the offered API! The manual scale-up you described, is for vertical scaling, correct?

    • @Selfit

      You can use the API or DigitalOcean control panel to scale vertically (in terms of CPU, RAM and Disk), as well as horizontally, though the process of adding Droplets to your cluster or configuration will be manual unless you implement the API programmatically and create a feature that handles the required tasks for you.

      DigitalOcean does use cloud-init, so you can pass either a bash script, or a formatted cloud-init script to the API when deploying. That could handle much of the setup and configuration of the deployed Droplet for you.

      ...

      That said, for example, scaling out a MySQL server and turning it in to a clustered master master, or master slave isn't something that's automatic. You'd have to do some degree of manual configuration there as there's no automatic linking of Droplets, or auto-config.

Have another answer? Share your knowledge.