Building Horizontal Scalable Stateful Applications With ASP.NET Core

Making technologies like sessions and CSRF/authentication cookies fully horizontal scalable with Redis

Mattias te Wierik
The Startup

--

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.

--

--