javascript - Advice on which technology to use for real time notifications -


i have x amount of activity sensors connected server inserts data database everytime sensor triggered. i'm trying create web interface blue print of facility (svg) , whenever sensor triggered, besides db insert, want show sort of alert in blue print. need keep open connection server think.

i thinking of using web sockets, might overkill since need retrieve data server. running ajax call every second doesn't sound efficient either. there other alternatives?

thank you

some potential choices include:

  • websocket
  • adobe® flash® socket
  • ajax long polling
  • ajax multipart streaming
  • forever iframe
  • jsonp polling

which actual transport end using depend on requirements browser support , technology using on server handle these requests. transport choice may depend on network topology - types of load balancers need integrate with, proxies, etc.

there many libraries available on both client , server sides, many of support more 1 of these transports.

for example (not exhaustive list):

  • socket.io nodejs
    • websocket
    • adobe® flash® socket
    • ajax long polling
    • ajax multipart streaming
    • forever iframe
    • jsonp polling
  • signalr asp/.net backend
    • websockets
    • server-sent events
    • foreverframe
    • long polling
  • atmosphere java backend
    • websockets
    • server side events (sse)
    • long-polling
    • forever frame
    • jsonp

imo - websockets not overkill type of problem , lend nicely type of application.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -