SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
Why Erlang?

                          Brad Anderson
                         BarCamp Atlanta
                          Oct. 18, 2008

                      brad@sankatygroup.com
                         twitter: @boorad
                     http://boorad.weebly.com
blog url (for now)
Huh? Erlang?

                                Programming Language created at
                                Ericsson (20 yrs old now)
                                Designed for scalable, long-lived
                                systems
                                Compiled, Functional, Dynamically
                                Typed, Open Source

20 yrs old, open source since mid-90ʼs, iirc.

like a mobile telephone grid

compiled (but to bytecode for a VM)

open source, but no access to VCS, just tarballs
3 Biggies


                                     Massively Concurrent
                                     Seamlessly Distributed
                                     Fault Tolerant



Why Erlang?

Here are my three big ticket items
- massively concurrent
- seamlessly distributed into multi-machine clusters
- extremely fault tolerant

Great for my projects
 - data storage & retrieval
 - scalable web apps

Maybe not so hot for computationally intensive projects
- unless they lend themselves to parallelism
Big #1 - Concurrent

                               User space “green” threads
                               VM manages processes across
                               kernel threads to maximize CPU
                               utilization across all available cores
                               Quad core? Almost 4 times faster
                               No mutable data structures
userspace threads != OS threads, so we can have thousands or more of these little guys

32- and 64-core processors coming

Properly written Erlang code will run N times faster on an N core processor.

I have spawned 500,000 processes on my MBP - didnʼt sweat

no mutable data == no locks, mutexes, semaphores == easy to parallelize
Big #1 - Concurrent




                                              image: http://english.people.com.cn/200512/21/images/pop2.jpg

Processes are self-contained

Think of objects in Java, Python, etc.

Each process has its own stack

GC is per-process

If a process crashes, it does not affect any other processes

Message Passing Concurrency

No Shared Memory - I have mine, you have yours. Two separate brains.

To change your memory, I send you a message.

We understand concurrency Erlang-style, because the world outside of programming is parallel
Big #1 - Concurrent
                           -module(test).
                           -compile(export_all).

                           start() ->
                             spawn(fun() -> loop([]) end).

                           rpc(Pid, Query) ->
                             Pid ! {self(), Query},
                             receive
                               {Pid, Reply} ->
                                  Reply
                             end.

                           loop(X) ->
                             receive
                               Any ->
                                  io:format(“Received:~p~n”, [Any]),
                                  loop(X)
                             end.
                                                       Programming Erlang First Edition - Joe Armstrong
start/0 will spawn the new process, firing off loop/1

loop/1 is tail recursive and waits for a message

rpc/2 is how you send a message in
Big #2 - Distributed
                               Nodes are separate OS processes,
                               instances of the VM
                               They are completely separate from
                               each other, but connect to form a
                               cluster
                               Processes can be started on any
                               node in the cluster
So, start up two nodes on different servers, and you are distributed.
Big #2 - Distributed




here we have different nodes started on different machines that form clusters.

There are three clusters split across three machines, but I could reallocate if Red needed more horses

All of this is fairly seamless - if a new node shows up, itʼs added to the cluster and can begin to handle new processes for the cluster
Big #3 - Fault Tolerant

                                Links are formed between processes
                                If a process exits abnormally, all
                                linked processes exit too.
                                System processes trap exits.
                                Instead of exiting, they receive a
                                message with the Pid and exit
                                status of linked processes
Back to our real-world thinking, If someone dies, people will notice

The mobile telecom system of the UK is a PROD Erlang application.

9 nines of reliablility - 32ms of downtime per year
Big #3 - Fault Tolerant

                              Supervision Trees




Worker processes do the real work

Supervisor processes monitor workers and restart them as needed

Supervisors can also monitor other supervisors
Other Goodies
                     Lists &                                                                          Live Code
                     Comprehensions                                                                   reloading

                     Pattern Matching                                                                 ets & dets

                     Higher-Order                                                                     Mnesia
                     Functions
                                                                                                      OTP
                     bit syntax
                                                                                                      Dialyzer

Lisp or Python comprehensions - leads us to map/reduce goodness

Pattern Matching from Prolog, very cool for elegant coding

functions are first class, can be passed around, and maintain scope for closures

bit syntax is great for working w/ protocols

live code reloading helps with those 9 nines, no downtime

ets & dets are efficient term storage mechanisms

Mnesia - built in distributed database, no need for ORM, no impedence mismatch, stores Erlang terms

OTP - libraries!

Dialyzer - code coverage, type analysis
Erlang Hotness
                    Facebook Chat                                                              Scalaris

                    Meebo                                                                      github / Engine
                                                                                               Yard
                    RabbitMQ
                                                                                               Yaws
                    ejabberd
                                                                                               Mochiweb
                    OpenPoker
                                                                                               Yahoo! delicious2
                    CouchDB
Facebook Chat - already huge, new feature had to scale, chose Erlang

Meebo - web-based IM

RabbitMQ - super-scalable message broker

ejabberd - super scalable XMPP server

OpenPoker - high volume poker server

CouchDB - document database, stores JSON docs, not relational

Scalaris - Distributed Key Value System, colossal amounts of data, ACID, very fast retrieval

github / Engine Yard - project provisioning

Yaws - super scalable web server (ditto for mochiweb)

delicious2 used Erlang to port data to new system, role in PROD system now?
Yaws vs. Apache




                                                                  throughput (KB/s) vs load

                                                           http://www.sics.se/~joe/apachevsyaws.html
Apache (blue, green) dies when running load of 4000 parallel sessions

red curve is yaws on NFS, blue is Apache running on NFS, green is Apache on local file system
Credits

Joe Armstrong

   Programming Erlang - http://www.pragprog.com/titles/jaerlang

   http://www.pragprog.com/articles/erlang

Toby DiPasquale - http://cbcg.net/talks/erlang.pdf

Sam Tesla - http://www.alieniloquent.com/talks/ErlangConcepts.pdf

Weitere ähnliche Inhalte

Was ist angesagt?

What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & javaEugene Bogaart
 
Erlang For Five Nines
Erlang For Five NinesErlang For Five Nines
Erlang For Five NinesBarcamp Cork
 
Okbuy 李小红 好乐买自动化运维实践
Okbuy 李小红 好乐买自动化运维实践Okbuy 李小红 好乐买自动化运维实践
Okbuy 李小红 好乐买自动化运维实践guiyingshenxia
 
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例National Cheng Kung University
 
Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spacesluccastera
 
Async and parallel patterns and application design - TechDays2013 NL
Async and parallel patterns and application design - TechDays2013 NLAsync and parallel patterns and application design - TechDays2013 NL
Async and parallel patterns and application design - TechDays2013 NLArie Leeuwesteijn
 
Parallel Programming in .NET
Parallel Programming in .NETParallel Programming in .NET
Parallel Programming in .NETSANKARSAN BOSE
 
Concurrency in Python
Concurrency in PythonConcurrency in Python
Concurrency in Pythonkonryd
 
Doctrine 2: Enterprise Persistence Layer for PHP
Doctrine 2: Enterprise Persistence Layer for PHPDoctrine 2: Enterprise Persistence Layer for PHP
Doctrine 2: Enterprise Persistence Layer for PHPJonathan Wage
 
Workshop de Ruby on Rails
Workshop de Ruby on RailsWorkshop de Ruby on Rails
Workshop de Ruby on RailsFabio Akita
 

Was ist angesagt? (14)

What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & java
 
Simulating TUM Drone 2.0 by ROS
Simulating TUM Drone 2.0  by ROSSimulating TUM Drone 2.0  by ROS
Simulating TUM Drone 2.0 by ROS
 
Erlang For Five Nines
Erlang For Five NinesErlang For Five Nines
Erlang For Five Nines
 
Erlang OTP
Erlang OTPErlang OTP
Erlang OTP
 
Okbuy 李小红 好乐买自动化运维实践
Okbuy 李小红 好乐买自动化运维实践Okbuy 李小红 好乐买自动化运维实践
Okbuy 李小红 好乐买自动化运维实践
 
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
 
Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spaces
 
Async and parallel patterns and application design - TechDays2013 NL
Async and parallel patterns and application design - TechDays2013 NLAsync and parallel patterns and application design - TechDays2013 NL
Async and parallel patterns and application design - TechDays2013 NL
 
Parallel Programming in .NET
Parallel Programming in .NETParallel Programming in .NET
Parallel Programming in .NET
 
Concurrency in Python
Concurrency in PythonConcurrency in Python
Concurrency in Python
 
Doctrine 2: Enterprise Persistence Layer for PHP
Doctrine 2: Enterprise Persistence Layer for PHPDoctrine 2: Enterprise Persistence Layer for PHP
Doctrine 2: Enterprise Persistence Layer for PHP
 
Go Course Day1
Go Course Day1Go Course Day1
Go Course Day1
 
Dvm
DvmDvm
Dvm
 
Workshop de Ruby on Rails
Workshop de Ruby on RailsWorkshop de Ruby on Rails
Workshop de Ruby on Rails
 

Andere mochten auch

Push Protesting
Push ProtestingPush Protesting
Push ProtestingTim Farley
 
Erlang Quick Start
Erlang Quick StartErlang Quick Start
Erlang Quick Startcrackcell
 
Causes of the American Revolution
Causes of the American RevolutionCauses of the American Revolution
Causes of the American RevolutionAshten
 
分散ストレージに使えるかもしれないアルゴリズム
分散ストレージに使えるかもしれないアルゴリズム分散ストレージに使えるかもしれないアルゴリズム
分散ストレージに使えるかもしれないアルゴリズムTakeru INOUE
 
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearch
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearchBigData Faceted Search Comparison between Apache Solr vs. ElasticSearch
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearchNetConstructor, Inc.
 
Screen Scraping with Ruby
Screen Scraping with RubyScreen Scraping with Ruby
Screen Scraping with Rubyjeremyraines
 
Technique: Adventures in Social Media
Technique: Adventures in Social MediaTechnique: Adventures in Social Media
Technique: Adventures in Social MediaElepsis
 
Big Data Analysis Patterns - TriHUG 6/27/2013
Big Data Analysis Patterns - TriHUG 6/27/2013Big Data Analysis Patterns - TriHUG 6/27/2013
Big Data Analysis Patterns - TriHUG 6/27/2013boorad
 

Andere mochten auch (9)

Push Protesting
Push ProtestingPush Protesting
Push Protesting
 
Erlang Quick Start
Erlang Quick StartErlang Quick Start
Erlang Quick Start
 
Causes of the American Revolution
Causes of the American RevolutionCauses of the American Revolution
Causes of the American Revolution
 
分散ストレージに使えるかもしれないアルゴリズム
分散ストレージに使えるかもしれないアルゴリズム分散ストレージに使えるかもしれないアルゴリズム
分散ストレージに使えるかもしれないアルゴリズム
 
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearch
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearchBigData Faceted Search Comparison between Apache Solr vs. ElasticSearch
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearch
 
Screen Scraping with Ruby
Screen Scraping with RubyScreen Scraping with Ruby
Screen Scraping with Ruby
 
Technique: Adventures in Social Media
Technique: Adventures in Social MediaTechnique: Adventures in Social Media
Technique: Adventures in Social Media
 
COPPA and YOU
COPPA and YOUCOPPA and YOU
COPPA and YOU
 
Big Data Analysis Patterns - TriHUG 6/27/2013
Big Data Analysis Patterns - TriHUG 6/27/2013Big Data Analysis Patterns - TriHUG 6/27/2013
Big Data Analysis Patterns - TriHUG 6/27/2013
 

Ähnlich wie Why Erlang? - Bar Camp Atlanta 2008

An introduction to erlang
An introduction to erlangAn introduction to erlang
An introduction to erlangMirko Bonadei
 
Peyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_futurePeyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_futureTakayuki Muranushi
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSkills Matter
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory AnalysisMoabi.com
 
Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018
Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018
Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018Codemotion
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory AnalysisMoabi.com
 
[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory Analysis[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory AnalysisMoabi.com
 
[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit Automation[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit AutomationMoabi.com
 
Intel’S Larrabee
Intel’S LarrabeeIntel’S Larrabee
Intel’S Larrabeevipinpnair
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsZvi Avraham
 
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft..."Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...Dataconomy Media
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeDmitri Nesteruk
 
compressed.tracemonkey-pldi-09.pdf
compressed.tracemonkey-pldi-09.pdfcompressed.tracemonkey-pldi-09.pdf
compressed.tracemonkey-pldi-09.pdfGinaMartinezTacuchi
 
compressed.tracemonkey-pldi-09.pdf
compressed.tracemonkey-pldi-09.pdfcompressed.tracemonkey-pldi-09.pdf
compressed.tracemonkey-pldi-09.pdfMaherEmad1
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceTim Ellison
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareMiro Samek
 
ParaForming - Patterns and Refactoring for Parallel Programming
ParaForming - Patterns and Refactoring for Parallel ProgrammingParaForming - Patterns and Refactoring for Parallel Programming
ParaForming - Patterns and Refactoring for Parallel Programmingkhstandrews
 
XPDS14: MirageOS 2.0: branch consistency for Xen Stub Domains - Anil Madhavap...
XPDS14: MirageOS 2.0: branch consistency for Xen Stub Domains - Anil Madhavap...XPDS14: MirageOS 2.0: branch consistency for Xen Stub Domains - Anil Madhavap...
XPDS14: MirageOS 2.0: branch consistency for Xen Stub Domains - Anil Madhavap...The Linux Foundation
 
java.util.concurrent for Distributed Coordination - Berlin Expert Days 2019
java.util.concurrent for Distributed Coordination - Berlin Expert Days 2019java.util.concurrent for Distributed Coordination - Berlin Expert Days 2019
java.util.concurrent for Distributed Coordination - Berlin Expert Days 2019Ensar Basri Kahveci
 
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Baruch Sadogursky
 

Ähnlich wie Why Erlang? - Bar Camp Atlanta 2008 (20)

An introduction to erlang
An introduction to erlangAn introduction to erlang
An introduction to erlang
 
Peyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_futurePeyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_future
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis
 
Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018
Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018
Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis
 
[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory Analysis[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory Analysis
 
[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit Automation[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit Automation
 
Intel’S Larrabee
Intel’S LarrabeeIntel’S Larrabee
Intel’S Larrabee
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming Models
 
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft..."Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/Invoke
 
compressed.tracemonkey-pldi-09.pdf
compressed.tracemonkey-pldi-09.pdfcompressed.tracemonkey-pldi-09.pdf
compressed.tracemonkey-pldi-09.pdf
 
compressed.tracemonkey-pldi-09.pdf
compressed.tracemonkey-pldi-09.pdfcompressed.tracemonkey-pldi-09.pdf
compressed.tracemonkey-pldi-09.pdf
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark Performance
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
 
ParaForming - Patterns and Refactoring for Parallel Programming
ParaForming - Patterns and Refactoring for Parallel ProgrammingParaForming - Patterns and Refactoring for Parallel Programming
ParaForming - Patterns and Refactoring for Parallel Programming
 
XPDS14: MirageOS 2.0: branch consistency for Xen Stub Domains - Anil Madhavap...
XPDS14: MirageOS 2.0: branch consistency for Xen Stub Domains - Anil Madhavap...XPDS14: MirageOS 2.0: branch consistency for Xen Stub Domains - Anil Madhavap...
XPDS14: MirageOS 2.0: branch consistency for Xen Stub Domains - Anil Madhavap...
 
java.util.concurrent for Distributed Coordination - Berlin Expert Days 2019
java.util.concurrent for Distributed Coordination - Berlin Expert Days 2019java.util.concurrent for Distributed Coordination - Berlin Expert Days 2019
java.util.concurrent for Distributed Coordination - Berlin Expert Days 2019
 
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
Breaking The Clustering Limits @ AlphaCSP JavaEdge 2007
 

Mehr von boorad

Big Data Analysis Patterns with Hadoop, Mahout and Solr
Big Data Analysis Patterns with Hadoop, Mahout and SolrBig Data Analysis Patterns with Hadoop, Mahout and Solr
Big Data Analysis Patterns with Hadoop, Mahout and Solrboorad
 
Hadoop and Storm - AJUG talk
Hadoop and Storm - AJUG talkHadoop and Storm - AJUG talk
Hadoop and Storm - AJUG talkboorad
 
Realtime Computation with Storm
Realtime Computation with StormRealtime Computation with Storm
Realtime Computation with Stormboorad
 
Big Data Use Cases
Big Data Use CasesBig Data Use Cases
Big Data Use Casesboorad
 
PhillyDB Talk - Beyond Batch
PhillyDB Talk - Beyond BatchPhillyDB Talk - Beyond Batch
PhillyDB Talk - Beyond Batchboorad
 
TriHUG - Beyond Batch
TriHUG - Beyond BatchTriHUG - Beyond Batch
TriHUG - Beyond Batchboorad
 
Realtime Computation with Storm
Realtime Computation with StormRealtime Computation with Storm
Realtime Computation with Stormboorad
 
Large Scale Data Analysis Tools
Large Scale Data Analysis ToolsLarge Scale Data Analysis Tools
Large Scale Data Analysis Toolsboorad
 
DevNexus 2011
DevNexus 2011DevNexus 2011
DevNexus 2011boorad
 
DevNation Atlanta
DevNation AtlantaDevNation Atlanta
DevNation Atlantaboorad
 
NOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the CloudNOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the Cloudboorad
 

Mehr von boorad (11)

Big Data Analysis Patterns with Hadoop, Mahout and Solr
Big Data Analysis Patterns with Hadoop, Mahout and SolrBig Data Analysis Patterns with Hadoop, Mahout and Solr
Big Data Analysis Patterns with Hadoop, Mahout and Solr
 
Hadoop and Storm - AJUG talk
Hadoop and Storm - AJUG talkHadoop and Storm - AJUG talk
Hadoop and Storm - AJUG talk
 
Realtime Computation with Storm
Realtime Computation with StormRealtime Computation with Storm
Realtime Computation with Storm
 
Big Data Use Cases
Big Data Use CasesBig Data Use Cases
Big Data Use Cases
 
PhillyDB Talk - Beyond Batch
PhillyDB Talk - Beyond BatchPhillyDB Talk - Beyond Batch
PhillyDB Talk - Beyond Batch
 
TriHUG - Beyond Batch
TriHUG - Beyond BatchTriHUG - Beyond Batch
TriHUG - Beyond Batch
 
Realtime Computation with Storm
Realtime Computation with StormRealtime Computation with Storm
Realtime Computation with Storm
 
Large Scale Data Analysis Tools
Large Scale Data Analysis ToolsLarge Scale Data Analysis Tools
Large Scale Data Analysis Tools
 
DevNexus 2011
DevNexus 2011DevNexus 2011
DevNexus 2011
 
DevNation Atlanta
DevNation AtlantaDevNation Atlanta
DevNation Atlanta
 
NOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the CloudNOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the Cloud
 

Kürzlich hochgeladen

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Why Erlang? - Bar Camp Atlanta 2008

  • 1. Why Erlang? Brad Anderson BarCamp Atlanta Oct. 18, 2008 brad@sankatygroup.com twitter: @boorad http://boorad.weebly.com blog url (for now)
  • 2. Huh? Erlang? Programming Language created at Ericsson (20 yrs old now) Designed for scalable, long-lived systems Compiled, Functional, Dynamically Typed, Open Source 20 yrs old, open source since mid-90ʼs, iirc. like a mobile telephone grid compiled (but to bytecode for a VM) open source, but no access to VCS, just tarballs
  • 3. 3 Biggies Massively Concurrent Seamlessly Distributed Fault Tolerant Why Erlang? Here are my three big ticket items - massively concurrent - seamlessly distributed into multi-machine clusters - extremely fault tolerant Great for my projects - data storage & retrieval - scalable web apps Maybe not so hot for computationally intensive projects - unless they lend themselves to parallelism
  • 4. Big #1 - Concurrent User space “green” threads VM manages processes across kernel threads to maximize CPU utilization across all available cores Quad core? Almost 4 times faster No mutable data structures userspace threads != OS threads, so we can have thousands or more of these little guys 32- and 64-core processors coming Properly written Erlang code will run N times faster on an N core processor. I have spawned 500,000 processes on my MBP - didnʼt sweat no mutable data == no locks, mutexes, semaphores == easy to parallelize
  • 5. Big #1 - Concurrent image: http://english.people.com.cn/200512/21/images/pop2.jpg Processes are self-contained Think of objects in Java, Python, etc. Each process has its own stack GC is per-process If a process crashes, it does not affect any other processes Message Passing Concurrency No Shared Memory - I have mine, you have yours. Two separate brains. To change your memory, I send you a message. We understand concurrency Erlang-style, because the world outside of programming is parallel
  • 6. Big #1 - Concurrent -module(test). -compile(export_all). start() -> spawn(fun() -> loop([]) end). rpc(Pid, Query) -> Pid ! {self(), Query}, receive {Pid, Reply} -> Reply end. loop(X) -> receive Any -> io:format(“Received:~p~n”, [Any]), loop(X) end. Programming Erlang First Edition - Joe Armstrong start/0 will spawn the new process, firing off loop/1 loop/1 is tail recursive and waits for a message rpc/2 is how you send a message in
  • 7. Big #2 - Distributed Nodes are separate OS processes, instances of the VM They are completely separate from each other, but connect to form a cluster Processes can be started on any node in the cluster So, start up two nodes on different servers, and you are distributed.
  • 8. Big #2 - Distributed here we have different nodes started on different machines that form clusters. There are three clusters split across three machines, but I could reallocate if Red needed more horses All of this is fairly seamless - if a new node shows up, itʼs added to the cluster and can begin to handle new processes for the cluster
  • 9. Big #3 - Fault Tolerant Links are formed between processes If a process exits abnormally, all linked processes exit too. System processes trap exits. Instead of exiting, they receive a message with the Pid and exit status of linked processes Back to our real-world thinking, If someone dies, people will notice The mobile telecom system of the UK is a PROD Erlang application. 9 nines of reliablility - 32ms of downtime per year
  • 10. Big #3 - Fault Tolerant Supervision Trees Worker processes do the real work Supervisor processes monitor workers and restart them as needed Supervisors can also monitor other supervisors
  • 11. Other Goodies Lists & Live Code Comprehensions reloading Pattern Matching ets & dets Higher-Order Mnesia Functions OTP bit syntax Dialyzer Lisp or Python comprehensions - leads us to map/reduce goodness Pattern Matching from Prolog, very cool for elegant coding functions are first class, can be passed around, and maintain scope for closures bit syntax is great for working w/ protocols live code reloading helps with those 9 nines, no downtime ets & dets are efficient term storage mechanisms Mnesia - built in distributed database, no need for ORM, no impedence mismatch, stores Erlang terms OTP - libraries! Dialyzer - code coverage, type analysis
  • 12. Erlang Hotness Facebook Chat Scalaris Meebo github / Engine Yard RabbitMQ Yaws ejabberd Mochiweb OpenPoker Yahoo! delicious2 CouchDB Facebook Chat - already huge, new feature had to scale, chose Erlang Meebo - web-based IM RabbitMQ - super-scalable message broker ejabberd - super scalable XMPP server OpenPoker - high volume poker server CouchDB - document database, stores JSON docs, not relational Scalaris - Distributed Key Value System, colossal amounts of data, ACID, very fast retrieval github / Engine Yard - project provisioning Yaws - super scalable web server (ditto for mochiweb) delicious2 used Erlang to port data to new system, role in PROD system now?
  • 13. Yaws vs. Apache throughput (KB/s) vs load http://www.sics.se/~joe/apachevsyaws.html Apache (blue, green) dies when running load of 4000 parallel sessions red curve is yaws on NFS, blue is Apache running on NFS, green is Apache on local file system
  • 14. Credits Joe Armstrong Programming Erlang - http://www.pragprog.com/titles/jaerlang http://www.pragprog.com/articles/erlang Toby DiPasquale - http://cbcg.net/talks/erlang.pdf Sam Tesla - http://www.alieniloquent.com/talks/ErlangConcepts.pdf