Skip to main content
added 777 characters in body
Source Link
Christophe
  • 82.3k
  • 11
  • 136
  • 202

The following questions may influence your choice:

  • how long the server needs to compute its result ?
  • is the result for a unique request or is it broadcasted to several requesters ?
  • how large is the data (payload) to be pushed ?
  • are the clients always interested in all the results pushed ?
  • can some results be lost, or must data always be delivered ?
  • is it possible that clients loose connections or have connection quality issues ?

Based on these matters you may opt for a data push if:

  • the connections are reliable
  • or if the data is not too large
  • or if the client is always interested in the results
  • or if results need to be frequently updated
  • or if the results are needed as realtime as possible

You may be interested in a push notificationpush notification or in SSEServer-Sent-Events (SSE) in all the other cases, and for example to cope with:

  • reconnectsreconnects (with SSE) and closed client applications
  • network quality issues when transmitting large sets of data that would make postponing the transmission a more pleasant alternative (or take into account huge roaming costs when using a cell-phone abroad...)
  • ignore obsolete requestsresults
  • if server side constraints do not allow full-duplex or require to go over http

Note however that SSE is not as well supported by browsers as websockets, certainly making the later the easier choice.

The following questions may influence your choice:

  • how long the server needs to compute its result ?
  • is the result for a unique request or is it broadcasted to several requesters ?
  • how large is the data (payload) to be pushed ?
  • are the clients always interested in all the results pushed ?
  • can some results be lost, or must data always be delivered ?
  • is it possible that clients loose connections or have connection quality issues ?

Based on these matters you may opt for a data push if:

  • the connections are reliable
  • or if the data is not too large
  • or if the client is always interested in the results

You may be interested in a push notification or in SSE in all the cases, and for example cope with:

  • reconnects
  • network quality issues when transmitting large sets of data that would make postponing the transmission a more pleasant alternative (or take into account huge roaming costs when using a cell-phone abroad...)
  • ignore obsolete requests

The following questions may influence your choice:

  • how long the server needs to compute its result ?
  • is the result for a unique request or is it broadcasted to several requesters ?
  • how large is the data (payload) to be pushed ?
  • are the clients always interested in all the results pushed ?
  • can some results be lost, or must data always be delivered ?
  • is it possible that clients loose connections or have connection quality issues ?

Based on these matters you may opt for a data push if:

  • the connections are reliable
  • or if the data is not too large
  • or if the client is always interested in the results
  • or if results need to be frequently updated
  • or if the results are needed as realtime as possible

You may be interested in a push notification or in Server-Sent-Events (SSE) in all the other cases, and for example to cope with:

Note however that SSE is not as well supported by browsers as websockets, certainly making the later the easier choice.

Source Link
Christophe
  • 82.3k
  • 11
  • 136
  • 202

The following questions may influence your choice:

  • how long the server needs to compute its result ?
  • is the result for a unique request or is it broadcasted to several requesters ?
  • how large is the data (payload) to be pushed ?
  • are the clients always interested in all the results pushed ?
  • can some results be lost, or must data always be delivered ?
  • is it possible that clients loose connections or have connection quality issues ?

Based on these matters you may opt for a data push if:

  • the connections are reliable
  • or if the data is not too large
  • or if the client is always interested in the results

You may be interested in a push notification or in SSE in all the cases, and for example cope with:

  • reconnects
  • network quality issues when transmitting large sets of data that would make postponing the transmission a more pleasant alternative (or take into account huge roaming costs when using a cell-phone abroad...)
  • ignore obsolete requests