Which is the better way to build real-time applications using Angular.js and Node.js?

后端 未结 5 1514
借酒劲吻你
借酒劲吻你 2020-12-29 13:36

I\'m beginner in Angular.js and Node.js, but I\'ve realized that there are two possible ways to make real-time applications. The first is using Socket.io and the other is us

5条回答
  •  鱼传尺愫
    2020-12-29 14:12

    Socket.io has the following advantages:

    • less unnecessary trafic and rendering
    • lower latency
    • (arguably) cleaner code

    REST has these advantages:

    • Supported on all browsers and clients
    • Less open connections
    • Works better in clustered, proxied and otherwise complex network topologies

    Each of these points deserves a long discussion on it's own, some depend a lot on the application characteristics. But if you tag them by priority, you'll see what is probably best for you.

提交回复
热议问题