1

I'm reading this paper about DDoS protection in AWS. One of the benefits of EC2 is that depending on the instance, it can scale for minimizing the effect of the attack.

In the paper there are two possible ways of scaling:

  • Horizontal: add more instances.
  • Vertical: increase the resources of the instances.

Which one is better?

  • 1
    For what application? The (lack of) ability of an application to scale horizontally is the largest factor in determining which is better. Correspondingly, there's no absolute "proven fact" without that context. – gowenfawr Feb 22 '16 at 13:10
  • @gowenfawr I was thinking in general, not application specific. In my case, it's for a signaling server which handle the status of thousands of nodes. – yzT Feb 22 '16 at 14:41
  • As a rule of thumb, scaling horizontally is better because if your application can then you have more room to maneuver - there's a limit to how much vertical scaling you can do because processors only go so fast, there are only so many slots for memory, memory only comes in so large sticks, etc. etc. But rules of thumb are not proven fact so I'll leave this as a comment. – gowenfawr Feb 22 '16 at 14:52
  • 1
    @gowenfawr looks to me like a valid answer, because it's true that vertical scaling will stop at some point whereas horizontal, if available, can be scaled "forever". Gonna remove the last paragraph, post this as answer :) – yzT Feb 22 '16 at 16:06
4

Short version:

When possible, horizontal is better because it has more scope to scale; vertical is limited by the amount of resources you can pack into a single instance. But some applications cannot be scaled well horizontally, and for those applications vertical is the better choice.

Long version:

Can it go horizontally?

Many applications are not designed to go horizontally. An application that uses local files, for example, cannot share them with an instance on another system. If files are made available to another system using, say, NFS, the file locking available may not be sufficient for resource contention and coordination.

Designing an application to be horizontal imposes complexity. And even an application that was defined to go horizontally - say, a web tier with a number of machines working with a backend database server - may have limits. It may be that each web frontend consumes 1/10th of database server capacity - so what happens when you amp it up to 11? The database becomes a bottleneck. You go back to step 1 and repeat the horizontal architecture work you did to apply the database server as well, and the system again mushrooms in complexity.

Horizontal systems are hard. Vertical systems are the default. Therefore, often vertical scaling is the only thing you can throw in front of a DDoS.

Wins you get with horizontal scaling

If you can go horizontally, however, there are a number of wins that make it superior.

  • Cost - If you need 10, two 5x boxes are a little more expensive than one 10x box. But if you need 20, four 5x boxes are probably cheaper than one 20x box.
  • Capability - Vertical scaling has limits; there may be no such thing as a 50x box, but ten 5x boxes is achievable. Memory only comes in sticks so big, and you can only plug so many of them into a motherboard...
  • Path - If you have a vertical solution, you're generally limited to one datacenter and at most a small handful of networks coming in. If you have a horizontal solution, and can spread across multiple sites, then you greatly increase the carrier redundancy available to you.
  • Robustness - by definition, if you designed your app to be horizontal, you probably designed it to cope with one or more component nodes becoming unavailable. Once you've got that, then the loss of subsets of your horizontally spread architecture are survivable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.