

How NodeJS saved my web application - transmit101
http://rfw.posterous.com/how-nodejs-saved-my-web-application

======
zackham
One issue with this approach is that the author is allowing users to start the
background work, rather than putting it into a queue like he had been doing
with his prior site. If his site gets slammed, this will be a problem, whereas
with a queue he could set up his interface to let the user continue browsing
the site while his/her work makes its way through the queue.

One nice find from the article is the link to the Flash implementation of
websockets: <http://github.com/gimite/web-socket-js>

~~~
codexon
Just curious, but does that implementation use the native websocket if
possible, and then falls back on Flash if needed? I am interested in such a
framework.

~~~
Derferman
Yep, the framework checks if the WebSocket object is defined, and if not,
defines a custom WebSocket objects based around flash sockets.

------
jbellis
Why is switching from rb to js to get server side event-driven code better
than using a rb library like EventMachine? Or is there another benefit of
node.js that I didn't pick up?

~~~
transmit101
My only problem in the past about using Ruby for this type of task has been
memory usage and stability of long-running processes, but since I started
using Ruby Enterprise Edition things are much improved.

Before I switched, I would typically have to log into the server several times
a week to restart the Workling processes. I switched to REE a couple of months
ago, and I just did a 'ps aux' on my server: the processes have now been
running for over a month without a problem.

Also there is something rather appealing about using Javascript on both sides
of the server/client divide. It's really very natural feeling.

I agree though, that EventMachine is potentially another option.

~~~
jerf
I've recently become a little nervous about the way that people are leaping
for Node.js when there are proved libraries in pretty much every other
language that are basically Node.js, _plus_ five to ten years refinement and
testing, _plus_ numerous other plugin libraries that have been created,
refined, and tested too.

If playing with the latest prettyshiny is your goal, have at it and have fun.
But for getting real work done on real sites I have a hard time believing it's
the best choice.

(If it seems simpler than the existing tech, that's the usual way of things.
New tech like this is always simpler. It will eventually be discovered by the
Node.js community that the complications present in EventMachine or Twisted or
other competition is in fact not there because the developers are stupid, but
because they learned the hard way it's necessary complication, for the most
part, if you want the stuff to actually work, and in another couple of years,
Node.js will end up being just as complicated and for the exact same reasons.
If you don't mind not working in JS, you can skip to the end of this process
if you pick up one of the other libraries that are already mature.)

~~~
transmit101
I suppose that one of the advantages of NodeJS is that it can learn from the
successes/mistakes of the others. Without having 5-10 years of cruft, baggage
and backward-compatibility to worry about.

I take your point though. I only know EventMachine a little, and I've never
used Twisted. And there's other solutions too. Pick the right tool for the
job.

------
JimBastard
Obligatory big ups to node:

<http://howtonode.org/>

<http://wiki.github.com/ry/node/modules>

