Stateless-services pattern
To make sure our services are scalable, we need to make sure we build them in a stateless manner. By stateless, we mean that the service does not retain any state from the previous calls and treats every request as a fresh, new one. The advantage this approach gives us is that we can easily create replicas of the same service and make sure it does not matter which service instance is handling the request.
For example, let's say we have ten instances of an EmployeeDetails service, which is responsible for serving me <url>/employees/id, and returning data for a specific employee. It does not matter which instance is serving the request, the user will always end up getting the same data. This helps us to maintain the ...
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