Facebook chat is a heavy erlang user (so is SimpleDB). Erlang is one of these languages that open your eyes to a new way of programming. Eight years ago, shortly after it was open-sourced, I used it to build a reliable message passing system for a small start-up (that never quite made it). I remember being in awe of 3 features:
- The explicit inclusion of time in the language, this is probably the killer feature. You can write elegant program that expect events to happen within a certain timeframe and react if no events show up. Because it is an integral part of the language you have to think about failure and how to handle it.
- Hot code upgrades; it was hot in 1999, it’s still hot. Build systems with the aim of zero-downtime, even for releases. With share-nothing architecture this might be less relevant now, but there is often a little shared state that creeps in and requires high-availability of a core component.
- Service dependency; a service is built out of components that must be functional for the service to be rendered properly. One often ends up slapping an external monitoring layer on top of the whole thing and kludgy scripts to restart components the best one can based on the data available to the external monitoring layer. With erlang, it’s all in the box, no tools required.
Nice to see a great piece of engineering (you have to read to the book “Programming in Erlang”) getting the exposure it deserves.