6

I want to create a chat app which would use php/codeigniter to do the views and user interface. I've been reading lots of posts on stackoverflow which recommended node.js or socket.io. Yet I've also run across APE(Ajax Push Engine). I don't really know much about either and was wondering which to use.

I read up on node.js and saw lots of good things about it, but the major thing about it that worries me is that it's relatively new and doesn't have lots of real world websites testing/using it.

On the other hand, APE does. And it looks similar to node.js. But like I said, I don't know enough about either to know which one to choose.

Which one is better at creating a chat app?

Thanks!

Alex Churchill
  • 4,887
  • 5
  • 30
  • 42
Derek
  • 11,980
  • 26
  • 103
  • 162
  • Discalaimer: I have used socket.io/node (as well as socket.io/Tornadio) for many projects, but have never used APE. In terms of which is "better" at creating a chat app, they are both perfectly capable. As I see it, socket.io is a bit more powerful (it leverages WebSockets for instance) while APE is a bit more stable (socket.io's API has changed radically in the past month). Check out more info here: http://stackoverflow.com/questions/6513367/what-are-the-main-differences-between-ape-and-node-js – Alex Churchill Aug 19 '11 at 00:51

2 Answers2

6

I played a little bit with node.js, tried out socket.io - but in the end did a big project with APE.

I think, as always, there is the question of what you want to achieve. Only comparing the server parts: With node.js you get a machine that won't do anything on it's own, you need to write it yourself (or use libraries) With APE, the handling of channels and connections is already built in (compiled C). Still you need to build parts of your own logic on top with JS - or use the examples.

On the client side, socket.io provides a client framework with three commands - and APE has it's APE_JSF that handles the connections (which brings more functionality than socket.io regarding channels)

Personally, I prefer APE, even though there is a lack of documentation for beginners. However, keep in mind that APE won't deliver files/images, it's not a full Web-Server but optimized for real time push where it can handle ~10K concurrent users

Xosofox
  • 840
  • 1
  • 7
  • 21
  • I have been following your posts and it seems that you didnt read node.js supports native C/C++ modules aswell , they are hard to write and i admit they are hard to be found but the MongoDB BSON parser in C is a good example of how native node can get – ShrekOverflow Feb 09 '12 at 05:11
  • 1
    I agree APE is much much more stable then NodeJS but the confusing documentation needs to be upgraded or else new developers will not be happy with using it. – ShrekOverflow Feb 09 '12 at 05:14
  • You are right on both comments: I did not dig too deep into node.js options besides writing JS And the APE docs lack quite some stuff and it's hard to get into the topic However, once you got the hang of it, you can impressive things with it. You will still be able to achieve the same with node, I just think when it comes to pure performance (>10K users) node will get its problems – Xosofox Apr 25 '12 at 15:13
  • actually node.js can handle >10k users pretty easily i have ran a lot of apps and stuff with node.js and its performance is really insane .. i mean http://blog.famzah.net/2010/07/01/cpp-vs-python-vs-perl-vs-php-performance-benchmark/ look at the link node.js's performance is incredible moreover we can also write core C++ addons / modules for node.js which gives even more control with node. but yeah being a low level API node.js requires really a lot of knowledge and time to write apps but it worths learning :-) – ShrekOverflow Apr 26 '12 at 12:30
2

Like you, I'm not familiar with APE, however socket.io on node.js comes with a chat app as it's main example app.

True, there aren't a lot of sites using Node.js right now. Socket.io, however, is probably considered Node's 'Killer App', and thus has relatively a lot of talk/work done with it.

I'm presuming APE has stable APIs, though, which socket.io might not necessarily have - The 0.7 version was a pretty broad, API-changing update, for example. This might happen less often with the publication of the socket.io spec.

Stoive
  • 11,232
  • 4
  • 24
  • 32
  • Wrote this before I saw your comment... still relevant though, I think. The socket.io-spec publication is suggesting that it's becoming more stable, and even heading towards multiple server implementations, however that's a bit speculative. – Stoive Aug 19 '11 at 00:57
  • should i almost always use socket.io when using node.js? – Derek Aug 19 '11 at 01:59
  • 1
    No, rather if I needed to integrate 'push' functionality into something, I'd go to the effort of integrating Node.js+Socket.io with whatever existing backend (PHP/.NET/JSP/whatever) I'm already using. I tried finding something with .NET, for example, and concluded that I'd be better off just creating a 'sockets' layer with socket.io – Stoive Aug 19 '11 at 02:04
  • 1
    The link for the Socket.io chat example app is broken. This piece of code is apparently no longer available in the latest release. – davidbourguignon Feb 09 '14 at 17:43