Download - A Brief Introduction To Erlang
A Brief Introduction to ErlangPhillip Trelford Lightning Talk 2012
Erlang in Industry• Amazon
▫SimpleDB for Amazon Elastic Compute Cloud (EC2)
• Yahoo! ▫Delicious social bookmarking (50 million users)
• Facebook ▫Chat service (100 million users)
• T-Mobile ▫SMS and authentication systems
• Ericsson▫Support nodes in GPRS & 3G mobile networks
Open Source Erlang
•RabbitMQ▫AMQP based messaging
•CouchDB▫Document-oriented database
•Riak▫Distributed database
•Ejabberd ▫XMPP based instant messaging (IM)
Why Erlang? Wooga Case StudyBefore After
• Social Games• Millions of daily users• 80 – 200 App Servers• 5000 – 7000 RPS
• 1 App Server*
* Actually 2 for redundancy
Blackjack functionC# Erlang
public static bool IsBlackjack(int[] ranks){ return ranks.Length == 2 && ranks[0] + ranks[1] == 21;}
isBlackjack([A,B]) when A+B==21 -> true;
isBlackjack(_) -> false.
Coding Erlang
Text Editor REPL Winning
Card Shuffle in Erlang REPL
Ranks=["A","1","2","3","10","J","Q","K"].Suits=[clubs,diamonds,hearts,spades].Deck=[{Rank,Suit}||Rank<-Ranks,Suit<-
Suits].Tuples=[{random:uniform(),Card}||Card<-
Deck].[Card||{_,Card}<-lists:keysort(1,Tuples)].
Why learn Erlang?
•Money▫Erlang will instantly net you a $100,000
salary•Power
▫99.9999999% Reliability•Respect
▫Scala Akka▫F# Agents▫TPL DataFlow (TDF)
Erlang Book Stack
Next Steps
•Read ▫Learn You Some Erlang For Great Good!
•Watch▫Erlang: The Movie
•Try▫Coding Katas
•Get the T-Shirt▫#Erlang