[erlang-questions] node.js compared to erlang

Joe Armstrong erlang@REDACTED
Thu Oct 7 10:23:29 CEST 2010


A thought struck me - people ask "what's the different between yaws
and apache" or
"erlang and node.js"

It's the difference between having one web server and a few hundred thousand.

An erlang web server will spawn a single process per connection - each
process is
in itself a complete little web server - if you are running mochiweb
with 100K chat sessions
you really have 100K webservers on your machine - not one. If one of these web
servers crashes who cares.

If Apache crashes it's a big deal - if an erlang process representing
a web server crashes it's
not a big deal. Erlang itself crashing (or yaws etc) is more akin to
an entire machine failure.

Think of an erlang system as providing hundreds of thousands of tiny
isolated web servers.

This argument is not entirely true and should not be pushed to far, but it does
illustrate an essential difference in philosophy.

/Joe




On Wed, Oct 6, 2010 at 7:58 PM, Tony Arcieri <tony.arcieri@REDACTED> wrote:
> On Sun, Oct 3, 2010 at 9:00 AM, Pablo Platt <pablo.platt@REDACTED> wrote:
>
>> In what areas erlang dominates and what areas will you consider using
>> node.js?
>> For example, would you consider building something like rabbitmq or
>> ejabberd in
>> node.js?
>
>
> Node makes you write everything in a fully asynchronous, event-driven
> manner, an upside down world of callbacks and inverted control. Erlang
> provides abstractions like processes and messages which allow things to
> appear synchronous when in fact they're fully asynchronous underneath.
> Erlang processes will hang on to state for you, so you can process incoming
> requests as a combination of the request and the current state, rather than
> having to backtrack and figure out what state you're in from a centralized
> I/O handler.
>
> Node may be nice for smaller servers that handle more trivial I/O problems.
> Erlang is better suited for building larger systems which are factored apart
> into several different processes.
>
> --
> Tony Arcieri
> Medioh! A Kudelski Brand
>


More information about the erlang-questions mailing list