SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Erlang for Five Nines bar camp Cork III Tamas Nagy [email_address] © 1999 – 2009 Erlang Training and Consulting Ltd
Contents ,[object Object],[object Object],[object Object],[object Object]
Erlang History: The Telecom Industry ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Access transport and switching networks Cellular PLMN PSTN/ ISDN Data/ IP Networks CATV Services Past  Single-service networks Clients/applications Present Multiservice networks/client server Backbone Network Access Access Access Content Content Control Communication applications Media Gateways
Erlang History 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 “ Find the right methods -  design by prototyping.” Mike Willliams, CS LAB Make mistakes on a small scale, not in a  production project. Mike Willliams It’s not good enough to have ideas – you must also be able to implement them to know  that they work Mike Willliams And the rest is history... Prototypes of Telecom applications First projects launched First products launched Major projects started OTP R1  released Released as Open Source Experiments started at the Computer Science Lab First Erlang Book Published First C-Based Virtual Machine
Erlang History And this is  just the beginning... “ Erlang is going to be a very important language. It could be the next Java.” Ralph Johnson Co-author, “Design Patterns” (the “Gang-of-Four book”) To build a large scale message handling system that really had to be up all the time, I would unhesitatingly choose Erlang…. Tim Bray Sun Microsystems … if we had to start again we  would probably use Erlang… Mike Shaver Mozilla Foundation 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 The Future January, 36,000 hits on erlang.org Bluetail AB  acquired for 152M USD August, 1 million hits on erlang.org Erlang R11 goes  multicore  The first  Erlang Factory Major new projects started within Ericsson ETC is  founded
Requests to erlang.org
Contents ,[object Object],[object Object],[object Object],[object Object]
Erlang Highlights ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Functional programming  language High abstraction level Pattern matching Concise readable programs
Erlang Highlights: Factorial Factorial using Recursion n! = 1 n*(n-1)! n = 0 n   1 Definition -module(ex1). -export([factorial/1]). factorial(0) -> 1; factorial(N) when N >= 1 -> N * factorial(N-1). Implementation Eshell V5.0.1  (abort with ^G) 1> c(ex1). {ok,ex1} 2> ex1:factorial(6). 720
Erlang Highlights: High-level Constructs -define(IP_VERSION, 4). -define(IP_MIN_HDR_LEN, 5).  …… DgramSize = size(Dgram),  <<?IP_VERSION:4, HLen:4, SrvcType:8, TotLen:16, ID:16,    Flgs:3, FragOff:13, TTL:8, Proto:8,  HdrChkSum:16,    SrcIP:32, DestIP:32, Body/binary>> = Dgram, if (HLen >= 5) and (4*HLen =< DgramSize) -> OptsLen = 4*(HLen - ?IP_MIN_HDR_LEN), <<Opts:OptsLen/binary, Data/binary>> = Body, … ..  end. Parsing an IP Datagram using the Bit Syntax
Erlang Highlights ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Either transparent or  explicit concurrency Light-weight processes Highly scalable
Erlang Highlights: Concurrency Creating a new process using spawn -module(ex3). -export([activity/3]). activity(Name,Pos,Size) -> ………… Pid = spawn(ex3,activity,[Joe,75,1024]) activity(Joe,75,1024)
Erlang Highlights: Concurrency 10 100 1,000 10,000 100,000 Number of processes 1 10 100 1,000 Microseconds/process erlang java C# Source: Joe Armstrong SICS Process creation time
Erlang Highlights: Concurrency Processes communicate by asynchronous  message passing Pid ! {data,12,13} receive {start} -> ……… {stop} -> ……… {data,X,Y} -> ……… end receive {start} -> ……… {stop} -> ……… {data,X,Y} -> ……… end
Erlang Highlights: Concurrency 10 100 1,000 10,000 100,000 Number of processes 1 10 1,000 100,000 Microseconds/message erlang java C# 10,000 100 1 Source: Joe Armstrong SICS Message passing times
Erlang Highlights ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Response times in the order of milliseconds Per-process garbage collection
Erlang Highlights ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Simple and consistent error recovery Supervision hierarchies &quot;Program for the correct case&quot;
Erlang Highlights: Robustness Robust systems can be built by layering “ Supervisors” “ Workers”
Erlang Highlights ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Explicit or transparent  distribution Network-aware runtime system
Erlang Highlights: Distribution Erlang Run-Time System Erlang Run-Time System B ! Msg network C ! Msg
Erlang Highlights: Distribution loop() -> receive {From, {apply, M, F, A}} -> Answer = apply(M, F, A), From ! {rex, node(), Answer} loop(); _Other -> loop() end. {rex, Node} ! {self(), {apply, M, F, A}}, receive {rex, Node, What} -> What end {rex, Node} ! {self(), {apply, M, F, A}}, receive {rex, Node, What} -> What end {rex, Node} ! {self(), {apply, M, F, A}}, receive {rex, Node, What} -> What end loop() -> receive {From, {apply, M, F, A}} -> Answer = apply(M, F, A), From ! {rex, node(), Answer} loop(); _Other -> loop() end. loop() -> receive {From, {apply, M, F, A}} -> Answer = apply(M, F, A), From ! {rex, node(), Answer} loop(); _Other -> loop() end. loop() -> receive {From, {apply, M, F, A}} -> Answer = apply(M, F, A), From ! {rex, node(), Answer} loop(); _Other -> loop() end. Simple Remote Procedure Call
Erlang Highlights ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Easily change code in a  running system Enables non-stop operation Simplifies testing
Erlang Highlights ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],&quot;Ports&quot; to the outside world behave as Erlang processes
Erlang Highlights ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Erlang runs on a Virtual  Machine ported to UNIX, Windows, VxWorks, OS X, … Supports heterogeneous networks.
Erlang Highlights ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Symmetric multiprocessing  support. Takes full advantage  of multiple CPU  architectures.
Erlang SMP Erlang VM Scheduler run queue non-SMP VM Erlang VM Scheduler #2 run queue run queue run queue SMP VM Scheduler #1 Scheduler #N migration logic
Contents ,[object Object],[object Object],[object Object],[object Object]
Products: Ericsson AXD301 Switch ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Products: Ericsson AXD301 Switch ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Erlang: It’s Happening! Amazon  Simple DB Yahoo!  Delicious T-Mobile  WAP, SMS, IN services Facebook  Chat channel servers   Powerset/Microsoft  Key/Value store 37 Signals Backend servers
Erlang: It’s Happening! CouchDB   Distributed Robust  document database Wings 3D   3D modeller based on Nendo  YAWS   Yet Another Web Server RabbitMQ   High performance enterprise messaging Ejabberd   XMPP  instant messaging server
Questions
www.planeterlang.org www.trapexit.org www.erlang-factory.com www.erlang-consulting.com www.erlang.org

Weitere ähnliche Inhalte

Was ist angesagt?

Virtual platform
Virtual platformVirtual platform
Virtual platform
sean chen
 
Os Worthington
Os WorthingtonOs Worthington
Os Worthington
oscon2007
 

Was ist angesagt? (20)

Parallel program design
Parallel program designParallel program design
Parallel program design
 
effective_r27
effective_r27effective_r27
effective_r27
 
Dive into ROP - a quick introduction to Return Oriented Programming
Dive into ROP - a quick introduction to Return Oriented ProgrammingDive into ROP - a quick introduction to Return Oriented Programming
Dive into ROP - a quick introduction to Return Oriented Programming
 
Klee introduction
Klee  introductionKlee  introduction
Klee introduction
 
GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5
GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5
GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Good news, everybody! Guile 2.2 performance notes (FOSDEM 2016)
Good news, everybody! Guile 2.2 performance notes (FOSDEM 2016)Good news, everybody! Guile 2.2 performance notes (FOSDEM 2016)
Good news, everybody! Guile 2.2 performance notes (FOSDEM 2016)
 
A closure ekon16
A closure ekon16A closure ekon16
A closure ekon16
 
Metrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMetrics ekon 14_2_kleiner
Metrics ekon 14_2_kleiner
 
Return oriented programming
Return oriented programmingReturn oriented programming
Return oriented programming
 
Use of an Oscilloscope - maXbox Starter33
Use of an Oscilloscope - maXbox Starter33Use of an Oscilloscope - maXbox Starter33
Use of an Oscilloscope - maXbox Starter33
 
Return oriented programming (ROP)
Return oriented programming (ROP)Return oriented programming (ROP)
Return oriented programming (ROP)
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
 
An Introduction to Twisted
An Introduction to TwistedAn Introduction to Twisted
An Introduction to Twisted
 
Os Worthington
Os WorthingtonOs Worthington
Os Worthington
 
Recursion & Erlang, FunctionalConf 14, Bangalore
Recursion & Erlang, FunctionalConf 14, BangaloreRecursion & Erlang, FunctionalConf 14, Bangalore
Recursion & Erlang, FunctionalConf 14, Bangalore
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
 
Let it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable ServicesLet it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable Services
 
john-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types Later
john-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types Laterjohn-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types Later
john-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types Later
 
Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475
 

Andere mochten auch

Erlang vs. Java
Erlang vs. JavaErlang vs. Java
Erlang vs. Java
Artan Cami
 
The Erlang Programming Language
The Erlang Programming LanguageThe Erlang Programming Language
The Erlang Programming Language
Dennis Byrne
 
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере Nitrogen
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере NitrogenCodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере Nitrogen
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере Nitrogen
CodeFest
 
Lightning Talk: Erlang on Xen - Mikhail Bortnyk
Lightning Talk: Erlang on Xen - Mikhail BortnykLightning Talk: Erlang on Xen - Mikhail Bortnyk
Lightning Talk: Erlang on Xen - Mikhail Bortnyk
Elixir Club
 
The mystique of erlang
The mystique of erlangThe mystique of erlang
The mystique of erlang
Carob Cherub
 
TAEE2012-Putting Fundmentals of Electronic Circuits Practices online
TAEE2012-Putting Fundmentals of Electronic Circuits Practices onlineTAEE2012-Putting Fundmentals of Electronic Circuits Practices online
TAEE2012-Putting Fundmentals of Electronic Circuits Practices online
Mohamed Tawfik
 
3 1 impatto_ambientale_vezzoli_2013-14
3 1 impatto_ambientale_vezzoli_2013-143 1 impatto_ambientale_vezzoli_2013-14
3 1 impatto_ambientale_vezzoli_2013-14
LeNS_slide
 

Andere mochten auch (20)

Erlang vs. Java
Erlang vs. JavaErlang vs. Java
Erlang vs. Java
 
The Erlang Programming Language
The Erlang Programming LanguageThe Erlang Programming Language
The Erlang Programming Language
 
Thinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - CesariniThinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - Cesarini
 
Erlang&rails
Erlang&railsErlang&rails
Erlang&rails
 
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере Nitrogen
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере NitrogenCodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере Nitrogen
CodeFest 2012. Трескин М. — Разработка Web-приложений на Comet-сервере Nitrogen
 
C++ Actor Model - You’ve Got Mail ...
C++ Actor Model - You’ve Got Mail ...C++ Actor Model - You’ve Got Mail ...
C++ Actor Model - You’ve Got Mail ...
 
Http streaming
Http streamingHttp streaming
Http streaming
 
Erlang Concurrency
Erlang ConcurrencyErlang Concurrency
Erlang Concurrency
 
Lightning Talk: Erlang on Xen - Mikhail Bortnyk
Lightning Talk: Erlang on Xen - Mikhail BortnykLightning Talk: Erlang on Xen - Mikhail Bortnyk
Lightning Talk: Erlang on Xen - Mikhail Bortnyk
 
The mystique of erlang
The mystique of erlangThe mystique of erlang
The mystique of erlang
 
Introduction to Couchbase Server 2.0
Introduction to Couchbase Server 2.0Introduction to Couchbase Server 2.0
Introduction to Couchbase Server 2.0
 
Why erlang
Why erlangWhy erlang
Why erlang
 
Erlang on OSv
Erlang on OSvErlang on OSv
Erlang on OSv
 
Mydent -E health
Mydent -E healthMydent -E health
Mydent -E health
 
Don L. Rondeau - Federal Air Marshall Letter of Appreciation
Don L. Rondeau - Federal Air Marshall Letter of Appreciation Don L. Rondeau - Federal Air Marshall Letter of Appreciation
Don L. Rondeau - Federal Air Marshall Letter of Appreciation
 
TAEE2012-Putting Fundmentals of Electronic Circuits Practices online
TAEE2012-Putting Fundmentals of Electronic Circuits Practices onlineTAEE2012-Putting Fundmentals of Electronic Circuits Practices online
TAEE2012-Putting Fundmentals of Electronic Circuits Practices online
 
3 1 impatto_ambientale_vezzoli_2013-14
3 1 impatto_ambientale_vezzoli_2013-143 1 impatto_ambientale_vezzoli_2013-14
3 1 impatto_ambientale_vezzoli_2013-14
 
Contratos y presupuestos en proyectos Drupal - Drupal Camp Spain 2014
Contratos y presupuestos en proyectos Drupal - Drupal Camp Spain 2014Contratos y presupuestos en proyectos Drupal - Drupal Camp Spain 2014
Contratos y presupuestos en proyectos Drupal - Drupal Camp Spain 2014
 
Adecuación. Berta.
Adecuación. Berta.Adecuación. Berta.
Adecuación. Berta.
 
Ss instruments & diagnostic sets (pdf)
Ss instruments & diagnostic sets (pdf)Ss instruments & diagnostic sets (pdf)
Ss instruments & diagnostic sets (pdf)
 

Ähnlich wie Erlang For Five Nines

Introduction To Erlang Final
Introduction To Erlang   FinalIntroduction To Erlang   Final
Introduction To Erlang Final
SinarShebl
 
Keynote joearmstrong
Keynote joearmstrongKeynote joearmstrong
Keynote joearmstrong
Sentifi
 
EMF-IncQuery: Blazing-fast reaction time even for very large diagrams (Sirius...
EMF-IncQuery: Blazing-fast reaction time even for very large diagrams (Sirius...EMF-IncQuery: Blazing-fast reaction time even for very large diagrams (Sirius...
EMF-IncQuery: Blazing-fast reaction time even for very large diagrams (Sirius...
Ákos Horváth
 
MX Sample Mounting – SPEL+ Presentation
MX Sample Mounting – SPEL+ PresentationMX Sample Mounting – SPEL+ Presentation
MX Sample Mounting – SPEL+ Presentation
Gautam Manoharan
 

Ähnlich wie Erlang For Five Nines (20)

Introduction To Erlang Final
Introduction To Erlang   FinalIntroduction To Erlang   Final
Introduction To Erlang Final
 
Erlang real time
Erlang real timeErlang real time
Erlang real time
 
Spark Summit EU talk by Sameer Agarwal
Spark Summit EU talk by Sameer AgarwalSpark Summit EU talk by Sameer Agarwal
Spark Summit EU talk by Sameer Agarwal
 
Erlang
ErlangErlang
Erlang
 
Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...
Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...
Fast Insights to Optimized Vectorization and Memory Using Cache-aware Rooflin...
 
Actor Concurrency
Actor ConcurrencyActor Concurrency
Actor Concurrency
 
Keynote joearmstrong
Keynote joearmstrongKeynote joearmstrong
Keynote joearmstrong
 
CV (eng) Thomas Lindström
CV (eng) Thomas LindströmCV (eng) Thomas Lindström
CV (eng) Thomas Lindström
 
Optimization in Programming languages
Optimization in Programming languagesOptimization in Programming languages
Optimization in Programming languages
 
CV Espen Halsaa Albrektsen
CV Espen Halsaa AlbrektsenCV Espen Halsaa Albrektsen
CV Espen Halsaa Albrektsen
 
notesnet.dk - Eclipse Modelling Tools
notesnet.dk - Eclipse Modelling Toolsnotesnet.dk - Eclipse Modelling Tools
notesnet.dk - Eclipse Modelling Tools
 
Encrypted Traffic Mining
Encrypted Traffic MiningEncrypted Traffic Mining
Encrypted Traffic Mining
 
EMF-IncQuery: Blazing-fast reaction time even for very large diagrams (Sirius...
EMF-IncQuery: Blazing-fast reaction time even for very large diagrams (Sirius...EMF-IncQuery: Blazing-fast reaction time even for very large diagrams (Sirius...
EMF-IncQuery: Blazing-fast reaction time even for very large diagrams (Sirius...
 
Resume (1)
Resume (1)Resume (1)
Resume (1)
 
Erlang os
Erlang osErlang os
Erlang os
 
Deep Dive into Futures and the Parallel Programming Library
Deep Dive into Futures and the Parallel Programming LibraryDeep Dive into Futures and the Parallel Programming Library
Deep Dive into Futures and the Parallel Programming Library
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
 
MX Sample Mounting – SPEL+ Presentation
MX Sample Mounting – SPEL+ PresentationMX Sample Mounting – SPEL+ Presentation
MX Sample Mounting – SPEL+ Presentation
 
PrasadResume
PrasadResumePrasadResume
PrasadResume
 
byteLAKE's Alveo FPGA Solutions
byteLAKE's Alveo FPGA SolutionsbyteLAKE's Alveo FPGA Solutions
byteLAKE's Alveo FPGA Solutions
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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...
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Erlang For Five Nines

  • 1. Erlang for Five Nines bar camp Cork III Tamas Nagy [email_address] © 1999 – 2009 Erlang Training and Consulting Ltd
  • 2.
  • 3.
  • 4. Erlang History 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 “ Find the right methods - design by prototyping.” Mike Willliams, CS LAB Make mistakes on a small scale, not in a production project. Mike Willliams It’s not good enough to have ideas – you must also be able to implement them to know that they work Mike Willliams And the rest is history... Prototypes of Telecom applications First projects launched First products launched Major projects started OTP R1 released Released as Open Source Experiments started at the Computer Science Lab First Erlang Book Published First C-Based Virtual Machine
  • 5. Erlang History And this is just the beginning... “ Erlang is going to be a very important language. It could be the next Java.” Ralph Johnson Co-author, “Design Patterns” (the “Gang-of-Four book”) To build a large scale message handling system that really had to be up all the time, I would unhesitatingly choose Erlang…. Tim Bray Sun Microsystems … if we had to start again we would probably use Erlang… Mike Shaver Mozilla Foundation 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 The Future January, 36,000 hits on erlang.org Bluetail AB acquired for 152M USD August, 1 million hits on erlang.org Erlang R11 goes multicore The first Erlang Factory Major new projects started within Ericsson ETC is founded
  • 7.
  • 8.
  • 9. Erlang Highlights: Factorial Factorial using Recursion n! = 1 n*(n-1)! n = 0 n  1 Definition -module(ex1). -export([factorial/1]). factorial(0) -> 1; factorial(N) when N >= 1 -> N * factorial(N-1). Implementation Eshell V5.0.1 (abort with ^G) 1> c(ex1). {ok,ex1} 2> ex1:factorial(6). 720
  • 10. Erlang Highlights: High-level Constructs -define(IP_VERSION, 4). -define(IP_MIN_HDR_LEN, 5). …… DgramSize = size(Dgram), <<?IP_VERSION:4, HLen:4, SrvcType:8, TotLen:16, ID:16, Flgs:3, FragOff:13, TTL:8, Proto:8, HdrChkSum:16, SrcIP:32, DestIP:32, Body/binary>> = Dgram, if (HLen >= 5) and (4*HLen =< DgramSize) -> OptsLen = 4*(HLen - ?IP_MIN_HDR_LEN), <<Opts:OptsLen/binary, Data/binary>> = Body, … .. end. Parsing an IP Datagram using the Bit Syntax
  • 11.
  • 12. Erlang Highlights: Concurrency Creating a new process using spawn -module(ex3). -export([activity/3]). activity(Name,Pos,Size) -> ………… Pid = spawn(ex3,activity,[Joe,75,1024]) activity(Joe,75,1024)
  • 13. Erlang Highlights: Concurrency 10 100 1,000 10,000 100,000 Number of processes 1 10 100 1,000 Microseconds/process erlang java C# Source: Joe Armstrong SICS Process creation time
  • 14. Erlang Highlights: Concurrency Processes communicate by asynchronous message passing Pid ! {data,12,13} receive {start} -> ……… {stop} -> ……… {data,X,Y} -> ……… end receive {start} -> ……… {stop} -> ……… {data,X,Y} -> ……… end
  • 15. Erlang Highlights: Concurrency 10 100 1,000 10,000 100,000 Number of processes 1 10 1,000 100,000 Microseconds/message erlang java C# 10,000 100 1 Source: Joe Armstrong SICS Message passing times
  • 16.
  • 17.
  • 18. Erlang Highlights: Robustness Robust systems can be built by layering “ Supervisors” “ Workers”
  • 19.
  • 20. Erlang Highlights: Distribution Erlang Run-Time System Erlang Run-Time System B ! Msg network C ! Msg
  • 21. Erlang Highlights: Distribution loop() -> receive {From, {apply, M, F, A}} -> Answer = apply(M, F, A), From ! {rex, node(), Answer} loop(); _Other -> loop() end. {rex, Node} ! {self(), {apply, M, F, A}}, receive {rex, Node, What} -> What end {rex, Node} ! {self(), {apply, M, F, A}}, receive {rex, Node, What} -> What end {rex, Node} ! {self(), {apply, M, F, A}}, receive {rex, Node, What} -> What end loop() -> receive {From, {apply, M, F, A}} -> Answer = apply(M, F, A), From ! {rex, node(), Answer} loop(); _Other -> loop() end. loop() -> receive {From, {apply, M, F, A}} -> Answer = apply(M, F, A), From ! {rex, node(), Answer} loop(); _Other -> loop() end. loop() -> receive {From, {apply, M, F, A}} -> Answer = apply(M, F, A), From ! {rex, node(), Answer} loop(); _Other -> loop() end. Simple Remote Procedure Call
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Erlang SMP Erlang VM Scheduler run queue non-SMP VM Erlang VM Scheduler #2 run queue run queue run queue SMP VM Scheduler #1 Scheduler #N migration logic
  • 27.
  • 28.
  • 29.
  • 30. Erlang: It’s Happening! Amazon Simple DB Yahoo! Delicious T-Mobile WAP, SMS, IN services Facebook Chat channel servers Powerset/Microsoft Key/Value store 37 Signals Backend servers
  • 31. Erlang: It’s Happening! CouchDB Distributed Robust document database Wings 3D 3D modeller based on Nendo YAWS Yet Another Web Server RabbitMQ High performance enterprise messaging Ejabberd XMPP instant messaging server
  • 33. www.planeterlang.org www.trapexit.org www.erlang-factory.com www.erlang-consulting.com www.erlang.org

Hinweis der Redaktion

  1. This is the essential loop needed for an RPC server. The server receives requests from clients, uses apply to evaluate the requests and then returns the answer to the originator. This is a simplified solution where no error handling is done. The BIF node/0 returns the node name.
  2. Ulf Wiger, Ericsson AB 2009-01-16 ProTest - Property-Based Testing The non-SMP version of the Erlang virtual machine uses a cooperative reduction-counting scheduler with a single run queue (the run queue itself is partitioned according to priorities – ’low’, ’normal’, ’high’ and ’max’). Each runnable process gets a ”time slice” of 1000 reductions (1 reduction is basically one function call), but the time slice can be cut short if the process pauses to wait for a message (i.e. whenever a receive statement would block). There is also a yield() function, allowing processes to deliberately end the time slice. From an Erlang programmer’s perspective, the scheduling is preemptive, since it cannot be certain that it won’t be scheduled out at any given moment. In practice, it has been possible to stack the deck by calling yield() and then performing a sequence of calls that one wants to be ”atomic”. This is obviously questionable, and the practice has always been discouraged. Still, some programs have relied on the fact that the non-SMP scheduler was highly predictable – it was possible to ”know” that preemption wouldn’t occur at certain points in the code. (Another ”feature” was that the priorities ’high’ and ’max’ were strict – as long as there were runnable jobs on these priority levels, ’normal’ and ’low’ priority jobs would never get to execute. Partly for this reason, use of priorities is discourages in Erlang.)