👋
Welcome to my blog!

Stateless Web Tier

Explore the benefits and implementation of a stateless web tier for scalable and resilient web applications.

Stateless Web Tier
System Design
Infrastructure

Published At

7/14/2022

Reading Time

~ 2 min read

Now it is time to consider scaling the web tier horizontally. For this, we need to move the state out of the web tier ( for instance, user session data). A good practice is to store session data in persistent storage such as a relational database or NoSQL. Each web server from the cluster can access state data from databases. This is called a stateless web tier.

Stateful architecture

A stateful server and a stateless server have some key differences. A stateful server remembers client data (state) from one request to another. A stateless servers keep no state information.

With stateful, the issue is that every request from the same client must be routed to the same server. This can be done with sticky sessions in most load balancers. However, this adds the overhead. Adding or removing servers is much more difficult with this approach. It is also challenging to handle server failures.

Stateless architecture

HTTP requests can be sent to any server which fetches data from data storage. A stateless system is more straightforward, more robust, and scalable.

After the state data is removed from the web server, auto-scaling of the web tier is easily achieved by adding or removing the server based on traffic load.

🍍

Do you have any questions, or simply wish to contact me privately? Don't hesitate to shoot me a DM on Twitter.

Have a wonderful day.
Abhishek 🙏

Join My Exclusive Newsletter Community

Step into a world where creativity intersects with technology. By subscribing, you'll get a front-row seat to my latest musings, full-stack development resources, and exclusive previews of future posts. Each email is a crafted experience that includes:

  • In-depth looks at my covert projects and musings to ignite your imagination.
  • Handpicked frontend development resources and current explorations, aimed at expanding your developer toolkit.
  • A monthly infusion of inspiration with my personal selection of quotes, books, and music.

Embrace the confluence of words and wonder, curated thoughtfully and sent straight to your inbox.

No fluff. Just the highest caliber of ideas.