[erlang-questions] node.js compared to erlang

Moritz Ulrich <>
Sun Oct 3 21:20:35 CEST 2010


There is a whole chapter in the erlang documentation about this:
http://www.erlang.org/doc/design_principles/distributed_applications.html

(It's an application-, not a supervisor-feature)

On Sun, Oct 3, 2010 at 9:07 PM, Kaiduan Xie <> wrote:
> Joe,
>
> - cross platform error detection and recovery
> (i.e. to make something fault tolerant needs at least 2 machines,
> think the case when one machine crashes - the second machine must be
> able to take over)
>
> Can you give us a real-life example on this point? I have not seen an
> illustration for this in your book, and in Francesco/Simon's book. The
> upcoming Erlang/OTP-In-Action also does not touch this area. OTP
> supervisor structure seems focusing on re-start process on local
> machine.
>
> Of course Mnesia is a good example. I would like to see a code example
> from other projects too.
>
> Best regards,
>
> /Kaiduan
> On Sun, Oct 3, 2010 at 2:40 PM, Joe Armstrong <> wrote:
>> You have to ask why was erlang designed? why was node.js designed?
>>
>> I don't know why node.js ws desiged - I guess so you could write servers
>> in js.
>>
>> Erlang was designed for building soft real-time fault-tolerant systems
>> that could be
>> upgraded without taking them out of service. These design criteria led
>> to erlang features like:
>>
>> - fast per/process garbage collection
>> - ability to change code on-the-fly (ie the module reload stuff, with the
>>  ability to run old and new module code at the same time)
>> - several orthogonal error detection mechanisms (catch-throw/links/ ...)
>> - cross platform error detection and recovery
>>  (ie to make something fault tolerant needs at least 2 machines,
>>   think the case when one machine crashes - the second machine must be
>>  able to take over)
>>
>> In the erlang system there is quite a lot going on behind the scenes to make
>> sure this all happens without the user being aware of it - to first
>> approximation
>> you can spread processes and database tables over multiple nodes and
>> it will behave in a reasonable manner ...
>>
>> I don't think things like have any correspondence in node.js - I guess if
>> an entire node.js node crashes the user would not expect another node
>> to take over
>> in a seamless manner.
>>
>> The fun stuff in Erlang has to do with how the failure model interacts with
>> code changing, moving code around, upgrading code without stopping the system
>> and so on - these characteristics are extremely important if you want to
>> build a 24x7 system with zero down time - less so if you just want to serve up
>> pages as fast as possible and don't care if you take the system out of service
>> for upgrades or errors.
>>
>> Erlang was designed for building fault-tolerant systems - node.js was not
>>
>> Cheers
>>
>> /Joe
>>
>>
>>
>>
>> On Sun, Oct 3, 2010 at 5:00 PM, Pablo Platt <> wrote:
>>> Hi
>>>
>>> I'm using erlang and I love it.
>>> I'm not trying to create an argument but to better understand the power of
>>> erlang.
>>>
>>> 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?
>>> Or maybe you'll use node.js just for a simple single chat room but erlang for
>>> anything complicated than that.
>>>
>>> Are there a fundamental differences in performance or stability or use in
>>> distributed systems?
>>>
>>> Ulf Wiger commented on the comparison of erlang and node.js
>>> and said that erlang solves the problem of non blocking functions which might be
>>> very hard for other languages.
>>> http://journal.dedasys.com/2010/04/29/erlang-vs-node-js
>>>
>>> Thanks
>>>
>>>
>>>
>>
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:
>>
>>
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>



-- 
Moritz Ulrich
Programmer, Student, Almost normal Guy

http://www.google.com/profiles/ulrich.moritz
BB5F086F-C798-41D5-B742-494C1E9677E8


More information about the erlang-questions mailing list