Why Stateless Architecture is better than Stateful Architecture when scaling web applications

A stateful and stateless server has some key differences. A stateful server remembers client data from one request to the next. A stateful server retain states and needs to remember the past and apply it to current operations.

The following image show…


This content originally appeared on DEV Community and was authored by Amietubodie Collins Otonye

A stateful and stateless server has some key differences. A stateful server remembers client data from one request to the next. A stateful server retain states and needs to remember the past and apply it to current operations.

The following image shows how a stateful architecture is designed.

Image description

From the diagram Client A data are stored in server 1. For Client A to be authenticated all http requests must be routed to server 1. Client B data are stored in server 2. For Client B to be authenticated all http requests must be routed to server 2 if a request is sent to server 1 or any other server the request will fail because those other servers does not contain Client B information. Same goes for Client A, Client C and Client D.

This makes it very difficult to scale because of every request from the same client must be routed to the same server. Adding and removing servers are very difficult with this approach and it is difficult to handle if your server should fail.

STATELESS SERVERS

In stateless architecture http request from a user can be sent to any web server which fetches data from the same data store. Below is an image of a stateless architecture.

Image description

The stateless system is more robust and scalable and it is also more simple than the stateful system.

The added flexibility of autoscaling the web servers on the application layer depending on the network traffic allows you to not worry about overhead.


This content originally appeared on DEV Community and was authored by Amietubodie Collins Otonye


Print Share Comment Cite Upload Translate Updates
APA

Amietubodie Collins Otonye | Sciencx (2022-06-20T21:48:34+00:00) Why Stateless Architecture is better than Stateful Architecture when scaling web applications. Retrieved from https://www.scien.cx/2022/06/20/why-stateless-architecture-is-better-than-stateful-architecture-when-scaling-web-applications/

MLA
" » Why Stateless Architecture is better than Stateful Architecture when scaling web applications." Amietubodie Collins Otonye | Sciencx - Monday June 20, 2022, https://www.scien.cx/2022/06/20/why-stateless-architecture-is-better-than-stateful-architecture-when-scaling-web-applications/
HARVARD
Amietubodie Collins Otonye | Sciencx Monday June 20, 2022 » Why Stateless Architecture is better than Stateful Architecture when scaling web applications., viewed ,<https://www.scien.cx/2022/06/20/why-stateless-architecture-is-better-than-stateful-architecture-when-scaling-web-applications/>
VANCOUVER
Amietubodie Collins Otonye | Sciencx - » Why Stateless Architecture is better than Stateful Architecture when scaling web applications. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/06/20/why-stateless-architecture-is-better-than-stateful-architecture-when-scaling-web-applications/
CHICAGO
" » Why Stateless Architecture is better than Stateful Architecture when scaling web applications." Amietubodie Collins Otonye | Sciencx - Accessed . https://www.scien.cx/2022/06/20/why-stateless-architecture-is-better-than-stateful-architecture-when-scaling-web-applications/
IEEE
" » Why Stateless Architecture is better than Stateful Architecture when scaling web applications." Amietubodie Collins Otonye | Sciencx [Online]. Available: https://www.scien.cx/2022/06/20/why-stateless-architecture-is-better-than-stateful-architecture-when-scaling-web-applications/. [Accessed: ]
rf:citation
» Why Stateless Architecture is better than Stateful Architecture when scaling web applications | Amietubodie Collins Otonye | Sciencx | https://www.scien.cx/2022/06/20/why-stateless-architecture-is-better-than-stateful-architecture-when-scaling-web-applications/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.