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
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSkills Matter
 
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
 
[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
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
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
 
[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

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Kürzlich hochgeladen (20)

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

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