Ajax Push Engine (APE) Vs Node.js

后端 未结 4 1228
谎友^
谎友^ 2021-01-30 11:54

I am considering few options for pushing data from server to the client for my web application in real time.

I have implemented a polling based (each client sends http

相关标签:
4条回答
  • 2021-01-30 12:02

    I strongly suggest you to take a look at the Socket.IO. It's a complete solution for server push, that includes both server side library (written in node.js) and client JS library that is made in a cross browser manner. I see no reason for you to implement your own code for doing what is already made, working and tested.

    The only case that socket.IO won't handle is your third request, but that is impossible anyway. If I understand you correctly, you would like two clients to communicate without help of third party server? You can't change HTTP into P2P, at least not now.

    If on the other hand you meant to communicate two users via your server (doing something like a private two-person chat) that is totally doable using socket.io.

    0 讨论(0)
  • 2021-01-30 12:05

    Even though everybody is running towards node.js right now, we did a chat application based on APE and we are very happy with it.

    APE provides what you are looking for quite "out of the box" since it is a combination of server side JS and a client framework APE_JSF that provides the functionality (and more) that you get from socket.io.

    In this project we handle ~9000 concurrent users with real time messages. An nginx server is put in front of APE to provide deflate/gzip support

    This configuration (without nginx as well) will have no problem dealing with your requirements, even on a "not so high end" machine.

    Since you can push data to "a channel" or a single user, you should be able to achieve exactly what you are looking for with APE, from broadcasts to direct messages.

    0 讨论(0)
  • 2021-01-30 12:05

    If you are using Apache within your existing stack then, as you already said, there will be problems with scaling you users even if you use long polling instead of continuous one. Solution might be to use high performance web server like nginx in order to handle many concurrent connections.

    On the other hand node.js is made for this kind of connection concurrency and there are packages, like socket.io, which can make your developer life much easier since it offers various kinds of transport options with fallback solutions and other useful functionality.

    0 讨论(0)
  • 2021-01-30 12:05

    I wouldnt recommend ape for large scale applications , its just fine for chat applications but as far as mass data transport concerned client's browser starts to slow down and crush after a while.

    0 讨论(0)
提交回复
热议问题