Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are web services truly stateless?

Its a well know fact that webservices are stateless. Its written in every text that deals with WCF basics. But I need to know, Are they truely stateless.

I was reading about the PerCall WCF webservice, which destroy the service instance for every call. I am not able to comprehend the use of Percall service. If webservices are stateless, then what is the need of destroying service instance for each call.

like image 230
Vaibhav Jain Avatar asked Jul 20 '10 07:07

Vaibhav Jain


1 Answers

WCF has several instance models.

  • Single (Singleton) , where 1 instance handles all requests.
  • PerCall model where each call gets a separate instance
  • PerSession model where each client gets an instance (statefull)

The PerCall model is truly stateless. With the singleton model it depends on how you write it (but stateless is strongly advised). The PerSession model is not stateless at all.

There are trade-offs regarding memory use, concurrency, latency and security.

like image 51
Henk Holterman Avatar answered Nov 11 '22 20:11

Henk Holterman