Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Erlang's secret to scalability?

Erlang is getting a reputation for being untouchable at handling a large volume of messages and requests. I haven't had time to download and try to get inside Mr. Erlang's understanding of switching theory... so I'm wondering if someone can teach me (or point to a good instructional site.)

Say as a thought-experiment I wanted to port the Erlang ejabberd to a combination of Python and C, in a way that gave me the same speed and scalability. What structures or patterns would I have to understand and implement? (Does Python's Twisted already do this?)

like image 932
Jim Carroll Avatar asked Feb 05 '09 16:02

Jim Carroll


2 Answers

How/why do functional languages (specifically Erlang) scale well? (for discussion of why)

http://erlang.org/course/course.html (for a tutorial chain)

As far as porting to other languages, a message passing system would be easy to do in most modern languages. Getting the functional style can be done in Python easily enough, although you wouldn't get the internal dispatching features of Erlang "for free". Stackless Python can replicate much of Erlang's concurrency features, although I can't speak to details as I haven't used it much. If does appear to be much more "explicit" (in that it requires you to define the concurrency in code in places that Erlang's design will allow concurrency to happen internally).

like image 156
Godeke Avatar answered Oct 10 '22 17:10

Godeke


Erlang is not only about scalability but mostly about

  • reliability
  • soft real-time characteristics (enabled by soft real-time GC which is possible because immutability [no cycles] and share nothing and so)
  • performance in concurrent tasks (cheap task switch, cheap process spawn, actors model, ...)
  • scalability - debatable in current state , but rapidly evolving (about 32 cores well, it is better than most competitors but should be better in near future).
like image 27
Hynek -Pichi- Vychodil Avatar answered Oct 10 '22 17:10

Hynek -Pichi- Vychodil