A stateful server retains client information (state) between requests. The problem is that the same server must receive all requests from the same client. Most load balancers include sticky sessions that may be used for this. But this increases the overhead. This method makes it considerably more difficult to add or remove servers. In addition, managing server failures is difficult.
A token is returned to the client when a user signs in to a stateless system. This token is kept in the client’s storage. Then, each request the user makes includes this token. We cross-reference the token supplied with the request with the information kept in the database to confirm that the request is coming from an authorised user. We can quickly restore if the server is unavailable because the token is kept in the client’s storage.
The ideal strategy is to utilise NoSQL because horizontal scalability is simpler in stateless architecture than with relational databases, Memcached/Redis, or NoSQL, is your database.
Thanks for reading. If you loved this article, feel free to hit that follow button so we can stay in touch.
This article is possible because of these references.