Is consistent hashing useless if our server uses RESTful APIs?

92 Views Asked by At

So RESTful APIs are stateless wherein the server does not store any state about the client session on the server side.

And consistent hashing in load balancing is used to associate a client with a server, ie, all requests from a given client will be directed to a given server only (amongst a group of servers) because that server has some data stored in it about that client.

So, if our server uses RESTful APIs then is there no need for consistent hashing while load balancing?

1

There are 1 best solutions below

0
On BEST ANSWER

Not necessarily. While RESTful APIs are stateless, your server isn't. Server-side caching doesn't violate the constraints of REST. If a server is able to keep information from a client in its cache, it could make a significant difference if future requests are made to that server instead of to another one which may need to perform more work to retrieve the client's data.

It is very situational, however, so I can't speak to your specific server setup!