Stateless
We talked about stateless in the REST architectural constraints section. Being stateless makes web services highly scalable. There is no affinity need to retain between the clients and the servers. Any server can process requests from the API clients.
Let's go back to the question of whether or not HTTP sessions should be used in RESTful APIs. If you're creating APIs for internal usage between the frontend and the backend of a monolithic application, HTTP sessions provide a straightforward implementation of the API authentication. You can even archive the scalability using load balancers with the sticky session feature enabled to route the requests of the same session to the same server. Also, you can use Spring Session with Redis ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access