Question

I am looking into creating a real-time document editing and chat application. I have been wanting to learn Erlang for a while, and I was wondering whether this might be a good project to try it out on.

Specifically, at what point would I start to see the benefit of Erlang's fault tolerance and lightweight processes versus, say, a Rails app running on Mongrel or a LAMP stack? Would it be 100 concurrent users? 1,000? 100,000? Basically, I don't know if it is worthwhile learning a new language or if my current skill set will suffice. Thanks!

Was it helpful?

Solution

The question is a bit subjective, but I'll try to answer it anyway:

As a long time Erlang user, I'd say that you'd see the benefit as soon as you have more than 1 user. Erlang uses the actor model when dealing with concurrency. One of it's benefits is that you can handle each interaction / session / scenario with a user in a linear way, much as you would write any other procedural program.

The beauty becomes more apparent when you start handling interaction between many users at the same time. Then you launch one instance of your little "procedural program" for every user. Thus, you don't have to handle the hard parts of scaling yourself, you just have to define the interaction between your actors, and the Erlang VM will balance the rest (generally speaking).

Therefore, I'd say the biggest benefit of using Erlang is not performance (although, some things are more lightweight and optimized in Erlang), but the simplification of the model and how natural the concurrency programming becomes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top