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

后端 未结 5 1515
借酒劲吻你
借酒劲吻你 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:14

    If you want a fully real-time web application, then sockets are the way to go. Socket.io or SockJS are both extremely good clients. They have the ability to degrade gracefully when web sockets aren't supported, though, you may choose which transportation method you'd like to use.

    You'll have to build a data subscription service for changes to be propagated between all users. Tower.js and Meteor both use a reactive approach, and they use event listeners on model changes. Depending on how complex, or how powerful you want this feature, they'll be different implementations available.

    It does become increasingly more complex when trying to sync client-side and server-side data across many users connected at once. I'd suggest you take a look at those two frameworks, see how they work, and possibly replicate parts of it, or all of it's functionality.

提交回复
热议问题