O'Reilly logo

Developing RESTful Services with JAX-RS 2.0, WebSockets, and JSON by Bhakti Mehta, Masoud Kalali

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Comparison and use cases of different programming models and standards

The following table shows a comparison and conclusion of how the three major techniques and standards described in this chapter compare to each other:

Subject

SSE

WebSockets

Long polling

Error handling

Build-in support for error handling

Build-in support for error handling

Almost no error handling in case of chunked transfer

Performance

Usually results are better than long polling and inferior to WebSockets

Best performance result compared to the other two solutions

Small CPU resource but idle process/thread per client connection, limits scalability and extensive memory usage

Browser support1,2

Firefox, Chrome, Safari, Opera

For RFC 6455: IE 10, Firefox 11, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required