views:

2949

answers:

15

I would like to know a list of the most common application/websites/solutions where Erlang is used, successfully or not.

Explaining why it is used into a specific solution instead of others programming languages would be very much appreciated, too.

Listing BAD Erlang case studies (cases in which Erlang is misused) it would be interesting, as well.

+7  A: 

Erlang comes from Ericsson, and is used within some of their telecoms systems.

Outside telecoms, CouchDb (a document-oriented database) is possibly the best known Erlang application so far.

Why Erlang ? From the overview (worth reading in full):

The document, view, security and replication models, the special purpose query language, the efficient and robust disk layout and the concurrent and reliable nature of the Erlang platform are all carefully integrated for a reliable and efficient system.

Brian Agnew
For **some** of their telecomms systems.
jldupont
CouchDB is not an OO database, it's a document-oriented database.
I GIVE TERRIBLE ADVICE
@I GIVE TERRIBLE ADVICE - yes, of course. Corrected. I would change your moniker :-)
Brian Agnew
A: 

Telephony applications, it was designed for it and it's still used there. Here's good video why it's nice.

egon
+5  A: 

Apparently, Yahoo used Erlang to make something it calls Harvester. Article about it here: http://www.ddj.com/architect/220600332

harms
Reading from the article: "While Harvester was originally written in Perl, Erlang's high-level concurrency constructs -- along with OTP design principles -- make it an ideal platform for building reliable, fault tolerant, and scalable applications like Harvester. The resulting service is more scalable, available, reliable, and able to comply with tighter service-level agreements (SLA) on a lighter code base and less expensive development efforts.". Thanks so much :)
Roberto Aloi
+4  A: 

Facebook chat is written in Erlang see link for description

Nikolay Ivanov
Lot of people is complaining about the Facebook chat. Since ever. It would be really nice to understand if the problem is in the "Erlang choice", in the actual implementation or just in the idea of a web chat.
Roberto Aloi
I think the problem mostly is related to just having a 400.000 person chat with really complex connections.That being said I've never had any problems with the Facebook chat.
Jon Gretar
+4  A: 

There is a list of some products using erlang at the Wikipedia page.

Jon Gretar
+20  A: 

ejabberd is one of the most well know erlang application and the one I learnt erlang with.

I think it's the one of most interesting project for learning erlang because it is really building on erlang's strength. (However some will argue that it's not OTP, but don't worry there's still a trove of great code inside...)

Why ?

An XMPP server (like ejabberd) can be seen as a high level router, routing messages between end users. Of course there are other features, but this is the most important aspect of an instant messaging server. It has to route many messages simultaneously, and handle many a lot of TCP/IP connections.

So we have 2 features:

  • handle many connections
  • route messages given some aspects of the message

These are examples where erlang shines.

handle many connections

It is very easy to build scalable non-blocking TCP/IP servers with erlang. In fact, it was designed to solve this problem. And given it can spawn hundreds of thousand of processes (and not threads, it's a share-nothing approach, which is simpler to design), ejabberd is designed as a set of erlang processes (which can be distributed over several servers) :

  • client connection process
  • router process
  • chatroom process
  • server to server processes

All of them exchanging messages.

route messages given some aspects of the message

Another very lovable feature of erlang is pattern matching. It is used throughout the language.

For instance, in the following :

access(moderator, _Config)->  rw;
access(participant, _Config)->  rw;
access(visitor, #config{type="public"})->  r;
access(visitor, #config{type="public_rw"})->  rw;
access(_User,_Config)->  none.

That's 5 different versions of the access function. Erlang will select the most appropriate version given the arguments received. (Config is a structure of type #config which has a type attribute).

That means it is very easy and much clearer than chaining if/else or switch/case to make business rules.

To wrap up

Writing scalable servers, that's the whole point of erlang. Everything is designed it making this easy. On the two previous features, I'd add :

  • hot code upgrade
  • mnesia, distributed relational database (included in the base distribution)
  • mochiweb, on which most http erlang servers are built on
  • binary support (decoding and encoding binary protocol easy as ever)
  • a great community with great open source projects (ejabberd, couchdb but also webmachine, riak and a slew of library very easy to embed)

Fewer LOCs

There is also this article from Richard Jones. He rewrote an application from C++ to erlang: 75% fewer lines in erlang.

cstar
+1  A: 

I came across this is in the process of writing up a report: Erlang in Acoustic Ray Tracing.

It's an experience report on a research groups attempt to use Erlang for Acoustic Ray Tracing. They found that while it was easier to write the program, less buggy, etc. It scaled worse, and performed 10x slower then a comparable C program. So one spot where it may not be well suited is CPU intensive scenarios.

Do note though, that the people that wrote the paper were in the stages of first learning Erlang, and may not have known the proper development procedures for CPU intensive Erlang.

CoderTao
The paper is an interesting read. It doesn't directly make that generalization about suitability, it indicates that they found Erlang to unsuitable if you are trying to deploy on an IBM Cell BE processor, found in the Playstation 3. It also states they are inexperienced with Erlang. With more experience and suitable hardware they may have arrived at a different conclusion. I get the impression that their code may have included use of non-tail-recursive functions ; if so then it may go some way to explaining their problems with memory, garbage collection, crashes and performance.
Tim
I think you misread the article. The inability to run on a Cell processor was unfortunate, but it was only a side note. The 12x performance difference between a C++ and an Erlang implementation running on an x86 platform was the real problem, combined with the fact that it didn't scale linearly. That said, they were new to the language, and may have taken a few unwise code paths... such is life. I'm curious about the non-linear scaling though.
CoderTao
I stand corrected on the 12x performance issue with regards to the Intel versus Cell, but I maintain that Erlang can be well suited to CPU challenging scenarios. That's not to say they aren't right : this really might be a problem where a good C++ solution will always beat a good Erlang solution. Perhaps this does go some way towards serving as a reminder to some folks that Erlang, like any other technology, is no silver bullet and it will only shine when used the right way in the right place.
Tim
+6  A: 

The list of most common applications for Erlang as been covered (CouchDb, ejabberd, RabbitMQ etc) but I would like to contribute the following.

The reason why it is used in these applications comes from the core strength of Erlang: managing application availability.

Erlang was built from ground up for the telco environment requiring that systems meet at least 5x9's availability (99.999% yearly up-time). This figure doesn't leave much room for downtime during a year! For this reason primarily, Erlang comes loaded with the following features (non-exhaustive):

  • Horizontal scalability (ability to distribute jobs across machine boundaries easily through seamless intra & inter machine communications). The built-in database (Mnesia) is also distributed by nature.

  • Vertical scalability (ability to distribute jobs across processing resources on the same machine): SMP is handled natively.

  • Code Hot-Swapping: the ability to update/upgrade code live during operations

  • Asynchronous: the real world is async so Erlang was built to account for this basic nature. One feature that contributes to this requirement: Erlang's "free" processes (>32000 can run concurrently).

  • Supervision: many different strategies for process supervision with restart strategies, thresholds etc. Helps recover from corner-cases/overloading more easily whilst still maintaining traces of the problems for later trouble-shooting, post-mortem analysis etc.

  • Resource Management: scheduling strategies, resource monitoring etc. Note that the default process scheduler operates with O(1) scaling.

  • Live debugging: the ability to "log" into live nodes at will helps trouble-shooting activities. Debugging can be undertaken live with full access to any process' running state. Also the built-in error reporting tools are very useful (but sometimes somewhat awkward to use).

Of course I could talk about its functional roots but this aspect is somewhat orthogonal to the main goal (high availability). The main component of the functional nature which contributes generously to the target goal is, IMO: "share nothing". This characteristic helps contain "side effects" and reduce the need for costly synchronization mechanisms.

I guess all these characteristics help extending a case for using Erlang in business critical applications.

One thing Erlang isn't really good at: processing big blocks of data.

jldupont
Could you explain the following: "One thing Erlang isn't really good at: processing big blocks of data."
sinnus
He means things like decoding mpeg data. There is too much numerical computation which Erlang is not optimized for. If the processing just involves shuffling big blocks of data from one place to another, then Erlang is quite good at it. (Files to TPC Sockets, etc)
Christian
You can't update shared blocks of data (there are no pointers in Erlang) and hence data must be shuttled across processes which in turn translate to inefficiencies.
jldupont
+46  A: 
JRL
Ahem. No, it's not. The new system is MySQL for the datastore, a huge piece of C++ for the "backend" and PHP for the front end.The script that copies the data from the old system to the new one is what they wrote in Erlang.
Ramiz Uddin
Ramiz Uddin - which new system are you talking about when you say "No, it's not?"
Great Turtle
A: 

Erlang draws its strength from being a functional language with no shared memory. Hence IMO, Erlang won't be suitable for applications that require in place memory manipulations. Image editing for example.

beidy
A: 

Erlang has a problem with floating operation. It's very slow.

sinnus
But this is not a case study, is it?
Roberto Aloi
Yes, of course.
sinnus
+2  A: 

What is erlang good for?

http://beebole.com/en/blog/erlang/why-erlang/

http://www.aquabu.com/2008/2/15/erlang-pragmatic-studio-day-3-notes

http://www.reddit.com/r/programming/comments/9q0lr/erlang%5Fand%5Fhighfrequency%5Ftrading/ (jerf's answer)

It's important to realize that Erlang's 4 parts: the language itself, the VMs(BEAM, hipe) standard libs (plus modules on github, CEAN, etc.) and development environment are being steadily updated / expanded/improved. For example, i remember reading that the floating point performance improved when Wings3d's author realized it needed to improve (I can't find a source for this). And this guy just wrote about it:

http://marian-dan.com/wordpress/?p=324

A couple years ago, Tim Bray's Wide Finder publicity and all the folks starting to do web app frameworks and HTTP servers lead (at least in part) to improved regex and binaries handling. And there's all the work integrating HiPE and SMP, the dialyzer project, multiple unit testing and build libs springing up, ..

So its sweet spot is expanding, The difficult thing is that the official docs can't keep up very well, and the mailing list and erlang blogosphere volume are growing quickly

Gene T
+2  A: 

We built a betting exchange (aka prediction market) using Erlang. We chose Erlang over some of the more traditional financial languages (C++, Java etc) because of the built-in concurrency. Markets function very similarly to telephony exchanges. Our CTO gave a talk on our use of Erlang at blog.smarkets.com/2009/07/03/smarkets-tech-talk-on-erlang/.

We also use CouchDB and RabbitMQ as part of our stack.

Jason Trost
+2  A: 

I've finally found a list of companies, projects and universities using Erlang:

http://erlangotp.com/wiki/companiesUsingErlang

Roberto Aloi
+1  A: 

We are using Erlang to provide the back-end muscle power for our really real-time browser-based multi-player game Pixza. We don't use Flash or any other third-party plugins, though the game is real-time multi-player. We use pure JS and COMET techniques instead. And Erlang supports the "really realtimeliness" of Pixza.

ErJab