In the tech world new technologies come and go. With technologies like Docker Engine and Kubernetes, scaling out of applications became easier than ever. This unfortunately doesn’t mean that applications are horizontal scalable out of the box. In this article the problems will be explained and solved with the .NET landscape in mind.

In this post we will first define the difference between horizontal and vertical scaling, better known as Scaling out and Scaling up. We continue with learning the differences between a stateless and stateful application, followed by solving the problems for specific protocols and technologies that arise when scaling out a stateful ASP.NET Core application.


Scaling up vs Scaling out

When researching the principle of scaling an application, it is a must to understand what scaling is. Scaling an application is growing one or multiple infrastructure components (compute, storage, networking) larger in such a way that applications can serve more requests at the same time. This can be done in two ways.

Image for post

Scaling up

By scaling up, as well known as vertical scaling, existing components become bigger. In terms of a server this would mean to add more memory (Compute) or disk space (storage) to be able to run a heavier application on the same physical machine.

Image for post

Scaling out

Another way of scaling is by **scaling out, **as well known as horizontal scaling. Instead of making existing components larger, more components are added in parallel. In terms of compute this would mean to add an extra server with its own dedicated memory and disk space to serve an extra instance of an application.

When scaling up, a machine or a web application can only handle that limited amount of extra resources. The OS could for example only a certain amount of memory or disk space. Or all CPU power is already being utilized and can’t be expanded.

At that moment scaling out will inevitable. With scaling out, new problems are introduced since multiple instances will be responsible for handling concurrent requests. Can these requests for instance work with multiple instances of the application?

#scaling #cookies #sessions #dotnet #software-development

Building Horizontal Scalable Stateful Applications With ASP.NET Core
1.45 GEEK