Why Membase Uses Erlang
Friday, October 29, 2010 at 2:00PM |
Derek Stainer Sean Lynch, a senior developer at Membase recently had a post on Membase's company blog explaning why Membase uses Erlang for it's cluster management and process supervision component.
Here are some of the reasons mentioned by Lynch:
Its dynamic type system and pattern matching (ala Haskell and ML) make Erlang code tend to be even more concise than Python and Ruby, two languages known for their ability to do a lot in few lines of code.
The single largest advantage to us of using Erlang has got to be its built-in support for concurrency. Erlang models concurrent tasks as “processes” that can communicate with one another only via message-passing (which makes use of pattern matching!), in what is known as the actor model of concurrency. This alone makes an entire class of concurrency-related bugs completely impossible. While it doesn’t completely prevent deadlock, it turns out to be pretty difficult to miss a potential deadlock scenario when you write code this way.
Erlang processes, in addition to being isolated from one another, are very lightweight. One can easily run a quarter million of them in a single Erlang VM. The cost of spawning them is also quite low, making silly hacks to reuse them unnecessary. Since they run in the same memory space and are isolated only by software, message passing between them is extremely fast, and while it does involve copying the data in the message most of the time, messages tend to be small and this allows Erlang processes to be garbage collected independently.
Check out the rest of Lynch's reasons for using Erlang: Why Membase Uses Erlang
Erlang,
Membase,
Sean Lynch 
