In Greek mythology, the Hydra was a serpent-like monster with many heads.
The creature was notoriously difficult to defeat because, for each head that Hercules cut off, two more would grow back in its place.
The Hydra and Vertical Scale #
In the software world, the Hydra of Lerna is a great example of scale.
Vertical Scaling (Scaling Up): Adding more power (CPU, RAM) to an existing machine.
Vertical scaling refers to adding more power (CPU, RAM) to an existing machine. If you consider each head of the Hydra as a “machine,” enhancing its attributes is a form vertical scaling.
- Venomous Blood: The Hydra’s blood was extremely poisonous.
- Venemous Breath: Even its breath and scent were toxic, causing death to anyone who inhaled it.
- Jaw Strength: Use its teeth to SMASH!
- Neck Length: Longer Reach
Uprading its head is like Verticaly Scaling a Web Server and beefing up its power
- Increase CPU: Adding more cores for better workloads
- Increase RAM: Adding more GB to run applications and services
- Larger Disk: More Storage
- 10GB Networking: Faster Network Speed
However, just as Hercules could still cut off the head and render all that built-up power useless, a beefed-up web server can still go down and make all that power ineffective.
There is Strength in Numbers #
After cutting off the head, Hercules realizes the Hydra has a trick up its sleeve…
Regenerative Ability: When one of its heads was cut off, two new heads would grow back in its place.
This regeneration made the Hydra incredibly difficult to defeat, as the challenge multiplied with each attempt to eliminate it.
The Monster Scaled Out its heads so it could distribute the load.
When one head couldnt handle the load, instead of dying, instead of wearing armor, or instead of increasing its power vertically, the monster threw another instance at the problem.
This is the same for web servers.
If you take a containered approach or a cloud function approach, its as simple as deploying multiple instances to allow the load to be dispersed across all the instaces.
There is strength in Numbers.
Best of Both Worlds #
This doesn’t mean you should pick one approach over the other. You should choose what makes sense for your use case.
Cost Efficiency #
If you want to cut costs, find the optimal number of heads and scale them up and down horizontally as needed. This allows you to run the minimum CPU and RAM needed per instance. When it reaches capacity, you can deploy additional instances to handle the increased load. As the load decreases, you can scale back down, using the minimum resources necessary.
High Availability #
Alternatively, you can increase the resources per service and run multiple instances simultaneously for resilient high availability. Just understand that when the battle intensifies and you horizontally scale, the costs will increase accordingly. So be mindful in the cloud!