What is WebSocket Protocol ?

Current HTTP protocol isn’t designed to be a real-time medium means modern web applications use classic polling solutions(via Ajax) to give the impression of continuous feel.

Polling is a good solution, even though it might suffer from client-to-server and server-to-client latency.

So, we can overcome a structural limitation of the HTTP protocol using WebSocket protocol. It enables bidirectional communication between Web applications and Web servers over a single TCP socket.

It also make possible for a Web application hosted in a browser to stay connected with a Web endpoint all the time while incurring minimal costs such as pressure on the server, memory and resource consumption.

In which scenario WCF data services provides better result ?

You can select WCF data services when you

  • Want to implement the Data layer.
  • Want to access it from javascript.
  • Want to connect with database server by using HTTP protocol.