erlang - trifork · founded in 1999 soon after erlang was released as open source experts at...

303
Erlang The Driver behind WhatsApp’s Success Torben Hoffmann CTO, Erlang Solutions [email protected] @LeHoff

Upload: others

Post on 13-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang The Driver behind WhatsApp’s Success

Torben Hoffmann CTO, Erlang Solutions

[email protected] @LeHoff

Page 2: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Background

Page 3: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Background

Erlanger since 2006

Page 4: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Background

Erlanger since 2006

Happyness

Page 5: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Background

Erlanger since 2006

Happyness

Mission critical gateway for Tetra

Page 6: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Background

Erlanger since 2006

Happyness

Mission critical gateway for Tetra

Hard work

Page 7: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Background

Erlanger since 2006

Happyness

Mission critical gateway for Tetra

Hard work

Major learnings

Page 8: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Background

Erlanger since 2006

Happyness

Mission critical gateway for Tetra

Hard work

Major learnings

Page 9: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Why this talk?

Page 10: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Why this talk?

Explain the tech foundation for WhatsApp’s succes

Page 11: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Why this talk?

Explain the tech foundation for WhatsApp’s succes

Understand the design decisions that makes Erlang unique

Page 12: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Why this talk?

Explain the tech foundation for WhatsApp’s succes

Understand the design decisions that makes Erlang unique

Show how Erlang’s features delivers business value

Page 13: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Why this talk?

Explain the tech foundation for WhatsApp’s succes

Understand the design decisions that makes Erlang unique

Show how Erlang’s features delivers business value

Spread the Erlang love

Page 14: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Religious Connection

source:http://www.taoistsecret.com/taoistgod.html

Er Lang Shen - Chinese God w/!a 3rd truth seeing eye

source: http://www.tripadvisor.com/Attraction_Review-g1152320-d1799218-Reviews-Erlang_Temple-Zunhua_Hebei.html

Erlang Temple in Zunhua

Page 15: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Dealing with disbelievers…

Source: http://2.bp.blogspot.com/-qNM3LGTtUYM/UIFLJGd_MLI/AAAAAAAAAnU/GCtI5SYfbCs/s320/orc-army.jpg

source: http://asset3.cbsistatic.com/cnwk.1d/i/tim2/2013/08/12/Larry_Ellison_Oracle_Open_World_2009_610x407.jpg

source: http://images1.wikia.nocookie.net/__cb20110119125642/villains/images/e/ef/Saruman.jpg

Page 16: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Dealing with disbelievers…

Source: http://2.bp.blogspot.com/-qNM3LGTtUYM/UIFLJGd_MLI/AAAAAAAAAnU/GCtI5SYfbCs/s320/orc-army.jpg

source: http://asset3.cbsistatic.com/cnwk.1d/i/tim2/2013/08/12/Larry_Ellison_Oracle_Open_World_2009_610x407.jpg

source: http://images1.wikia.nocookie.net/__cb20110119125642/villains/images/e/ef/Saruman.jpg

Page 17: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Dealing with disbelievers…

Source: http://2.bp.blogspot.com/-qNM3LGTtUYM/UIFLJGd_MLI/AAAAAAAAAnU/GCtI5SYfbCs/s320/orc-army.jpg

source: http://www.rottentomatoes.com/m/1014027-mission/

source: http://asset3.cbsistatic.com/cnwk.1d/i/tim2/2013/08/12/Larry_Ellison_Oracle_Open_World_2009_610x407.jpg

source: http://images1.wikia.nocookie.net/__cb20110119125642/villains/images/e/ef/Saruman.jpg

Page 18: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of
Page 19: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Founded in 1999 soon after Erlang was released as open source

Page 20: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Founded in 1999 soon after Erlang was released as open source

Experts at building bespoke scalable, high availability, high performance systems

Page 21: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Founded in 1999 soon after Erlang was released as open source

Experts at building bespoke scalable, high availability, high performance systems

Only company of its kind totally focused on Erlang and Erlang community

Page 22: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Founded in 1999 soon after Erlang was released as open source

Experts at building bespoke scalable, high availability, high performance systems

Only company of its kind totally focused on Erlang and Erlang community

Over 300 clients.

Page 23: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Founded in 1999 soon after Erlang was released as open source

Experts at building bespoke scalable, high availability, high performance systems

Only company of its kind totally focused on Erlang and Erlang community

Over 300 clients.

Headquartered in London, U.K.

Page 24: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Founded in 1999 soon after Erlang was released as open source

Experts at building bespoke scalable, high availability, high performance systems

Only company of its kind totally focused on Erlang and Erlang community

Over 300 clients.

Headquartered in London, U.K.

Offices: Stockholm, Krakow, Copenhagen, Aarhus, Budapest, Seattle and Zurich

Page 25: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Founded in 1999 soon after Erlang was released as open source

Experts at building bespoke scalable, high availability, high performance systems

Only company of its kind totally focused on Erlang and Erlang community

Over 300 clients.

Headquartered in London, U.K.

Offices: Stockholm, Krakow, Copenhagen, Aarhus, Budapest, Seattle and Zurich

Organically growing and continually investing in R & D

Page 26: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Founded in 1999 soon after Erlang was released as open source

Experts at building bespoke scalable, high availability, high performance systems

Only company of its kind totally focused on Erlang and Erlang community

Over 300 clients.

Headquartered in London, U.K.

Offices: Stockholm, Krakow, Copenhagen, Aarhus, Budapest, Seattle and Zurich

Organically growing and continually investing in R & D

Page 27: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Core focus

Page 28: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Core focus

Speed to market

Page 29: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Core focus

Speed to market

Low lifetime cost

Page 30: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Core focus

Speed to market

Low lifetime cost

Extreme reliability

Page 31: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Core focus

Speed to market

Low lifetime cost

Extreme reliability

True scalability

Page 32: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Core focus

Speed to market

Low lifetime cost

Extreme reliability

True scalability

Page 33: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

University Relations

Page 34: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

CustomersSome

Page 35: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

CustomersSome

19,000,000,000 reasons to use Erlang

Page 36: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

WhatsApp

Real-time Messaging

Text and Pictures

Group chat

Page 37: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

WhatsApp Numbers

Page 38: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

WhatsApp Numbers

10 Erlang engineers

Page 39: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

WhatsApp Numbers

10 Erlang engineers

~500M monthly users

Page 40: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

WhatsApp Numbers

10 Erlang engineers

~500M monthly users

19B msg/day in / 40B msg/day out

Page 41: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

WhatsApp Numbers

10 Erlang engineers

~500M monthly users

19B msg/day in / 40B msg/day out

147M concurrent connections

Page 42: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

WhatsApp Numbers

10 Erlang engineers

~500M monthly users

19B msg/day in / 40B msg/day out

147M concurrent connections

peak: 324K msg/s in / 712K msg/s out

Page 43: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

WhatsApp Numbers

10 Erlang engineers

~500M monthly users

19B msg/day in / 40B msg/day out

147M concurrent connections

peak: 324K msg/s in / 712K msg/s out

Page 44: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

WhatsApp Hardware

~550 servers

2x2690v2 Ivy Bridge 10-core (40 threads total)

64-512 GB RAM

SSD

>11,000 cores

Page 45: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

WhatsApp Software

FreeBSD 9.2

Erlang R16B01 (with patches)

Page 46: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Users of Erlang

Page 47: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365

Page 48: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365

Resarch team Re-did a Java system in Erlang as a POC

Page 49: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365

Resarch team Re-did a Java system in Erlang as a POC

Results:

5x connected users in load test

4x rate of data change

Better utilisation of CPU resources

Page 50: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365

Resarch team Re-did a Java system in Erlang as a POC

Results:

5x connected users in load test

4x rate of data change

Better utilisation of CPU resources

How to convince the developers to switch?

Page 51: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365 showed that Erlang…

https://www.erlang-solutions.com/resources/webinars/webinar-recording-erlang-gamblingonline-betting

Page 52: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365 showed that Erlang…

makes programming fun

https://www.erlang-solutions.com/resources/webinars/webinar-recording-erlang-gamblingonline-betting

Page 53: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365 showed that Erlang…

makes programming fun

scales and is reliable

https://www.erlang-solutions.com/resources/webinars/webinar-recording-erlang-gamblingonline-betting

Page 54: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365 showed that Erlang…

makes programming fun

scales and is reliable

has enough depth to be interesting

https://www.erlang-solutions.com/resources/webinars/webinar-recording-erlang-gamblingonline-betting

Page 55: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365 showed that Erlang…

makes programming fun

scales and is reliable

has enough depth to be interesting

solves difficult problems with simple code

https://www.erlang-solutions.com/resources/webinars/webinar-recording-erlang-gamblingonline-betting

Page 56: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365 showed that Erlang…

makes programming fun

scales and is reliable

has enough depth to be interesting

solves difficult problems with simple code

Results:

https://www.erlang-solutions.com/resources/webinars/webinar-recording-erlang-gamblingonline-betting

Page 57: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365 showed that Erlang…

makes programming fun

scales and is reliable

has enough depth to be interesting

solves difficult problems with simple code

Results:

production teams quickly started to appreciate the benefits of Erlang

https://www.erlang-solutions.com/resources/webinars/webinar-recording-erlang-gamblingonline-betting

Page 58: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365 showed that Erlang…

makes programming fun

scales and is reliable

has enough depth to be interesting

solves difficult problems with simple code

Results:

production teams quickly started to appreciate the benefits of Erlang

did not want to go back to Javahttps://www.erlang-solutions.com/resources/webinars/webinar-recording-erlang-gamblingonline-betting

Page 59: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Bet365 showed that Erlang…

makes programming fun

scales and is reliable

has enough depth to be interesting

solves difficult problems with simple code

Results:

production teams quickly started to appreciate the benefits of Erlang

did not want to go back to Javahttps://www.erlang-solutions.com/resources/webinars/webinar-recording-erlang-gamblingonline-betting

Page 60: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Riak from Basho

Distributed NoSQL database

Dynamo inspired key/value store

Erlang & C/C++

Powers Rovio, Danish Health Services and many more

Page 61: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang History

Page 62: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

There are two ways of constructing a software design:

Page 63: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

One way is to make it so simple that there are obviously no deficiencies

There are two ways of constructing a software design:

Page 64: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.

There are two ways of constructing a software design:

Page 65: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.

- C.A.R. Hoare

There are two ways of constructing a software design:

Page 66: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang’s Original Requirements

Page 67: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang’s Original Requirements

Large scale concurrency

Page 68: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang’s Original Requirements

Large scale concurrency

Soft real-time

Page 69: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang’s Original Requirements

Large scale concurrency

Soft real-time

Distributed systems

Page 70: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang’s Original Requirements

Large scale concurrency

Soft real-time

Distributed systems

Hardware interaction

Page 71: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang’s Original Requirements

Large scale concurrency

Soft real-time

Distributed systems

Hardware interaction

Very large software systems

Page 72: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang’s Original Requirements

Large scale concurrency

Soft real-time

Distributed systems

Hardware interaction

Very large software systems

Complex functionality

Page 73: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang’s Original Requirements

Large scale concurrency

Soft real-time

Distributed systems

Hardware interaction

Very large software systems

Complex functionality

Continuous operation for many years

Page 74: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang’s Original Requirements

Large scale concurrency

Soft real-time

Distributed systems

Hardware interaction

Very large software systems

Complex functionality

Continuous operation for many years

Software maintenance on-the-fly

Page 75: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang’s Original Requirements

Large scale concurrency

Soft real-time

Distributed systems

Hardware interaction

Very large software systems

Complex functionality

Continuous operation for many years

Software maintenance on-the-fly

High quality and reliability

Page 76: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang’s Original Requirements

Large scale concurrency

Soft real-time

Distributed systems

Hardware interaction

Very large software systems

Complex functionality

Continuous operation for many years

Software maintenance on-the-fly

High quality and reliability

Fault tolerance Bjarne Däcker’s Licentiate Thesis: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.88.1957

Page 77: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

wanted

Page 78: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

wantedproductivity

Page 79: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

wantedproductivity

no down-time

Page 80: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

wantedproductivity

no down-time

something that always works

Page 81: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

wanted

Page 82: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

wanted

money

Page 83: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

wanted

money

money

Page 84: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

wanted

money

money

money

Page 85: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

wanted

money

money

money

it’s a rich man’s world!

Page 86: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

wanted

money

money

money

it’s a rich man’s world!

Page 87: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

General vs Domain Specific

Telecom

Page 88: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

General vs Domain Specific

Telecom

C++/Java

Page 89: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

General vs Domain Specific

Telecom

C++/Java

Page 90: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

General vs Domain Specific

Telecom

Erlang

C++/Java

Page 91: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

General vs Domain Specific

Telecom

Erlang

C++/Java

Page 92: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

General vs Domain Specific

Telecom

Erlang

C++/Java

Smaller gap =

money!

Page 93: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The Sweet SpotGUI

Drivers

Middleware Coordination

Control

Page 94: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

If the glove fits...

drivers coordination GUI

needs/fit

Page 95: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

If the glove fits...

drivers coordination GUI

needs/fitTelecom

Page 96: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

If the glove fits...

drivers coordination GUI

needs/fit

C

Telecom

Page 97: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

If the glove fits...

drivers coordination GUI

needs/fit

C

Erlang

Telecom

Page 98: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather than part of its solution. !

- C.A.R. Hoare

Page 99: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Good Erlang Domains

Page 100: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Good Erlang Domains

Low latency over throughput

Page 101: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Good Erlang Domains

Low latency over throughput

Stateful (in contrast to being stateless)

Page 102: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Good Erlang Domains

Low latency over throughput

Stateful (in contrast to being stateless)

Massively concurrent

Page 103: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Good Erlang Domains

Low latency over throughput

Stateful (in contrast to being stateless)

Massively concurrent

Distributed

Page 104: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Good Erlang Domains

Low latency over throughput

Stateful (in contrast to being stateless)

Massively concurrent

Distributed

Fault tolerant

Page 105: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Good Erlang Domains

Low latency over throughput

Stateful (in contrast to being stateless)

Massively concurrent

Distributed

Fault tolerant

Uses OTP

Page 106: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Good Erlang Domains

Low latency over throughput

Stateful (in contrast to being stateless)

Massively concurrent

Distributed

Fault tolerant

Uses OTP

Non-stop operation

Page 107: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Good Erlang Domains

Low latency over throughput

Stateful (in contrast to being stateless)

Massively concurrent

Distributed

Fault tolerant

Uses OTP

Non-stop operation

Under load, Erlang programs usually performs as well as programs in other languages, often way better.

Jesper Louis Andersen

Page 108: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Erlang Domains

Page 109: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Erlang Domains

Messaging - XMPP et al

Page 110: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Erlang Domains

Messaging - XMPP et al

ejabberd, MongooseIM

Page 111: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Erlang Domains

Messaging - XMPP et al

ejabberd, MongooseIM

Webservers

Page 112: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Erlang Domains

Messaging - XMPP et al

ejabberd, MongooseIM

Webservers

Yaws, Chicago Boss, Cowboy

Page 113: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Erlang Domains

Messaging - XMPP et al

ejabberd, MongooseIM

Webservers

Yaws, Chicago Boss, Cowboy

Payment switches & soft switches

Page 114: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Erlang Domains

Messaging - XMPP et al

ejabberd, MongooseIM

Webservers

Yaws, Chicago Boss, Cowboy

Payment switches & soft switches

Vocalink, OpenFlow/LINC

Page 115: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Erlang Domains

Messaging - XMPP et al

ejabberd, MongooseIM

Webservers

Yaws, Chicago Boss, Cowboy

Payment switches & soft switches

Vocalink, OpenFlow/LINC

Distributed Databases

Page 116: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Erlang Domains

Messaging - XMPP et al

ejabberd, MongooseIM

Webservers

Yaws, Chicago Boss, Cowboy

Payment switches & soft switches

Vocalink, OpenFlow/LINC

Distributed Databases

Riak, CouchDB, Scalaris

Page 117: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Erlang Domains

Messaging - XMPP et al

ejabberd, MongooseIM

Webservers

Yaws, Chicago Boss, Cowboy

Payment switches & soft switches

Vocalink, OpenFlow/LINC

Distributed Databases

Riak, CouchDB, Scalaris

Queueing systems

Page 118: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Other Erlang Domains

Messaging - XMPP et al

ejabberd, MongooseIM

Webservers

Yaws, Chicago Boss, Cowboy

Payment switches & soft switches

Vocalink, OpenFlow/LINC

Distributed Databases

Riak, CouchDB, Scalaris

Queueing systems

RabbitMQ (AMQP)

Page 119: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The glove fits!

Low latency Stateful Massively

concurrent Distributed Fault tolerant

Messaging

Webservers

Soft switches

Distributed DBs

Queueing systems

Page 120: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The Golden Trinity Of Erlang

Page 121: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

Page 122: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

Memory

Page 123: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

Memory

P1

Page 124: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

Memory

P1 P2

Page 125: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

Memory

P2

Corrupt

Page 126: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

MemoryCorrupt

Page 127: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

Memory MemoryCorrupt

Page 128: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

Memory Memory

P1

Corrupt

Page 129: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

Memory Memory Memory

P1

Corrupt

Page 130: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

Memory Memory Memory

P1 P2

Corrupt

Page 131: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

Memory Memory

P2

Corrupt Corrupt

Page 132: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

To Share Or Not To Share

Memory Memory

P2

Corrupt

Page 133: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Message Passing

P1 P2M

P1 sends M to P2.

Page 134: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Message Passing

P1 P2M

P1 sends M to P2.

Every process has a mailbox

Page 135: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Message Passing

P1 P2M

P1 sends M to P2.

Every process has a mailbox

Messages are received:receive {tag, Value} -> Value; N when is_integer(N) -> N + 42

end

Page 136: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

FailuresAnything that can go wrong, will go wrong

Murphy

Page 137: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

FailuresAnything that can go wrong, will go wrong

MurphyProgramming errors

Page 138: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

FailuresAnything that can go wrong, will go wrong

MurphyProgramming errorsDisk failures

Page 139: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

FailuresAnything that can go wrong, will go wrong

MurphyProgramming errorsDisk failuresNetwork failures

Page 140: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Failures

Most programming paradigmes are fault in-tolerant

Anything that can go wrong, will go wrong

MurphyProgramming errorsDisk failuresNetwork failures

Page 141: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Failures

Most programming paradigmes are fault in-tolerant ⇒ must deal with all errors or die

Anything that can go wrong, will go wrong

MurphyProgramming errorsDisk failuresNetwork failures

Page 142: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Failures

Most programming paradigmes are fault in-tolerant ⇒ must deal with all errors or die

Anything that can go wrong, will go wrong

MurphyProgramming errorsDisk failuresNetwork failures

Page 143: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Failures

Most programming paradigmes are fault in-tolerant ⇒ must deal with all errors or die

Anything that can go wrong, will go wrong

MurphyProgramming errorsDisk failuresNetwork failures

Erlang is fault tolerant by design

Page 144: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Failures

Most programming paradigmes are fault in-tolerant ⇒ must deal with all errors or die

Anything that can go wrong, will go wrong

MurphyProgramming errorsDisk failuresNetwork failures

Erlang is fault tolerant by design ⇒ failures are embraced and

managed

Page 145: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Failures

Most programming paradigmes are fault in-tolerant ⇒ must deal with all errors or die

Anything that can go wrong, will go wrong

MurphyProgramming errorsDisk failuresNetwork failures

Erlang is fault tolerant by design ⇒ failures are embraced and

managed

source: http://johnkreng.wordpress.com/tag/jean-claude-van-damme/source: http://www.thelmagazine.com/BrooklynAbridged/archives/2013/05/14/should-we-be-worried-about-this-brooklyn-measles-outbreak

Page 146: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Let It Failconvert(monday) -> 1;!convert(tuesday) -> 2;!convert(wednesday) -> 3;!convert(thursday) -> 4;!convert(friday) -> 5; !convert(saturday) -> 6;!convert(sunday) -> 7! ;!convert(_) ->! {error, unknown_day}.!

Page 147: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Let It Failconvert(monday) -> 1;!convert(tuesday) -> 2;!convert(wednesday) -> 3;!convert(thursday) -> 4;!convert(friday) -> 5; !convert(saturday) -> 6;!convert(sunday) -> 7! .!!

Page 148: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Let It Failconvert(monday) -> 1;!convert(tuesday) -> 2;!convert(wednesday) -> 3;!convert(thursday) -> 4;!convert(friday) -> 5; !convert(saturday) -> 6;!convert(sunday) -> 7!

Erlang encourages offensive programming

.!!

Page 149: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Handling Failure

P1 P2

P1 monitors P2.

P1 P2

P1 and P2 are linked.

Page 150: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Intentional Programming

a style of programming where the reader of a program can easily see what the programmer intended by their code. [1]

[1] http://www.erlang.org/download/armstrong_thesis_2003.pdf

Page 151: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Intentional Dictionary data retrieval - dict:fetch(Key, Dict) = Val | EXIT

the programmer knows a specific key should be in the dictionary and it is an error if it is not.

search - dict:find(Key, Dict) = {ok, Val} | error.

it is unknown if the key is there or not and both cases must be dealt with.

test - dict:is_key(Key, Dict) = Boolean

knowing if a key is present is enough.

Page 152: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Benefits of let-it-fail

Source:  h*p://www.slideshare.net/JanHenryNystrom/produc;vity-­‐gains-­‐in-­‐erlang

Data  Mobility  component  breakdown

Page 153: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Benefits of let-it-fail

code  that  solves    the  problem

Source:  h*p://www.slideshare.net/JanHenryNystrom/produc;vity-­‐gains-­‐in-­‐erlang

Data  Mobility  component  breakdown

Page 154: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Benefits of let-it-fail

code  that  solves    the  problem

Source:  h*p://www.slideshare.net/JanHenryNystrom/produc;vity-­‐gains-­‐in-­‐erlang

Data  Mobility  component  breakdown

Page 155: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Benefits of let-it-fail

code  that  solves    the  problem

Source:  h*p://www.slideshare.net/JanHenryNystrom/produc;vity-­‐gains-­‐in-­‐erlang

Data  Mobility  component  breakdown

Page 156: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Benefits of let-it-fail

code  that  solves    the  problem

Source:  h*p://www.slideshare.net/JanHenryNystrom/produc;vity-­‐gains-­‐in-­‐erlang

Data  Mobility  component  breakdown

Page 157: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Benefits of let-it-fail

code  that  solves    the  problem

Source:  h*p://www.slideshare.net/JanHenryNystrom/produc;vity-­‐gains-­‐in-­‐erlang

Data  Mobility  component  breakdown

Page 158: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Benefits of let-it-fail

code  that  solves    the  problem

Source:  h*p://www.slideshare.net/JanHenryNystrom/produc;vity-­‐gains-­‐in-­‐erlang

Data  Mobility  component  breakdown

Page 159: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Benefits of let-it-fail

code  that  solves    the  problem

Erlang  @  3xSource:  h*p://www.slideshare.net/JanHenryNystrom/produc;vity-­‐gains-­‐in-­‐erlang

Data  Mobility  component  breakdown

Page 160: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Productivity with Erlang @ Motorola

Goal: Development of a mission-critical telecom gateway for TETRA

To be developed from scratch using Erlang and some drivers in C

The gateway translates between proprietary protocols and the ISI standard

Developed using a two – six man team over four year

A total of 72 staff months used on the work

Page 161: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Productivity with Erlang @ Motorola

Internal  storage

input

input

input

inputoutput

output

output

Function point analysis Language agnostic measurement of problem size

Page 162: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Show me the money!

Conservative estimation of the number of inputs, outputs and internal storage

Includes design, box test, system test, project management efforts

Function Point Analysis of the size of the problem

Page 163: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Isolate Errors

Page 164: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PROPAGATING EXIT SIGNALS

PidA PidB

PidC

Page 165: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PROPAGATING EXIT SIGNALS

PidA PidB

PidC

Page 166: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PROPAGATING EXIT SIGNALS

PidB

{'EXIT', PidA, Reason}

PidC

Page 167: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PROPAGATING EXIT SIGNALS

PidB

PidC

Page 168: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PROPAGATING EXIT SIGNALS

PidC

{'EXIT', PidB, Reason}

Page 169: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PROPAGATING EXIT SIGNALS

Page 170: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

TRAPPING AN EXIT SIGNAL

PidA

PidC

PidB

Page 171: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

TRAPPING AN EXIT SIGNAL

PidA

PidC

PidB

Page 172: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

TRAPPING AN EXIT SIGNAL

{'EXIT', PidA, Reason}

PidC

PidB

Page 173: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

TRAPPING AN EXIT SIGNAL

PidC

PidB

Page 174: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Supervision Trees

45

worker worker

worker workerworkerThe OTP library is

built on this principle

supervisor

supervisor

Page 175: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

The OTP Supervisor

46

worker workerworker

supervisor

Specifies a default restart strategyone_for_one one_for_all rest_for_one simple_one_for_one

Child spec for how a child is restartedpermanent | transient | temporary

Page 176: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Supervisors

Page 177: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Simple Manager/Worker Pattern

Page 178: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Realities of software development

Source: http://www.thejournal.ie/readme/lunch-atop-skyscraper-photo-men-irish-shanaglish-518110-Jul2012/

????

Page 179: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Realities of software development

Source: http://www.thejournal.ie/readme/lunch-atop-skyscraper-photo-men-irish-shanaglish-518110-Jul2012/

Product Owner

Page 180: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Business benefits of supervisors

Page 181: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Business benefits of supervisors

Only one process dies

Page 182: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Business benefits of supervisors

Only one process dies

isolation gives continuous service

Page 183: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Business benefits of supervisors

Only one process dies

isolation gives continuous service

Everything is logged

Page 184: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Business benefits of supervisors

Only one process dies

isolation gives continuous service

Everything is logged

you know what is wrong

Page 185: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Business benefits of supervisors

Only one process dies

isolation gives continuous service

Everything is logged

you know what is wrong

Corner cases can be fixed at leisure

Page 186: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Business benefits of supervisors

Only one process dies

isolation gives continuous service

Everything is logged

you know what is wrong

Corner cases can be fixed at leisure

Product owner in charge!

Page 187: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Business benefits of supervisors

Only one process dies

isolation gives continuous service

Everything is logged

you know what is wrong

Corner cases can be fixed at leisure

Product owner in charge!

Not the software!

Page 188: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Business benefits of supervisors

Only one process dies

isolation gives continuous service

Everything is logged

you know what is wrong

Corner cases can be fixed at leisure

Product owner in charge!

Not the software!

Software architecture that supports

iterative development

Page 189: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Preparing for battle

Source: http://www.finerareprints.com/print_detail.html?stock_no=17122

Page 190: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

When do I get my ROI?

Proto-typing Development Live

Speed

Page 191: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

When do I get my ROI?

Proto-typing Development Live

Speed

Some Cool Technology

Page 192: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

When do I get my ROI?

Proto-typing Development Live

Speed

Some Cool Technology

Erlang

Page 193: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

When do I get my ROI?

Live

Speed

Prot

o-typ

ing

Develo

pmen

t

Page 194: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

When do I get my ROI?

Live

Speed

Prot

o-typ

ing

Develo

pmen

t

Erlang

Page 195: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

When do I get my ROI?

Live

Speed

Prot

o-typ

ing

Develo

pmen

t

Erlang

Some Cool Technology

Page 196: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Erlang/OTP

Page 197: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Middleware

Page 198: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Middleware

Design Patterns

Page 199: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Middleware

Design Patterns

Fault Tolerance

Page 200: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Middleware

Design Patterns

Fault Tolerance

Distribution

Page 201: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Middleware

Design Patterns

Fault Tolerance

Distribution

Upgrades

Page 202: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Middleware

Design Patterns

Fault Tolerance

Distribution

Upgrades

Packaging

Page 203: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Middleware

Design Patterns

Fault Tolerance

Distribution

Upgrades

Packaging

Page 204: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Tools

Page 205: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Tools

Development

Page 206: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Tools

Development

Test Frameworks

Page 207: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Tools

Development

Test Frameworks

Release & Deployment

Page 208: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Tools

Development

Test Frameworks

Release & Deployment

Debugging & Monitoring

Page 209: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Benefits

Page 210: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Benefits

Less Code

Page 211: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Benefits

Less Code

Less Bugs

Page 212: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Benefits

Less Code

Less Bugs

More Solid Code

Page 213: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Benefits

Less Code

Less Bugs

More Solid Code

More Tested Code More Free Time

Page 214: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

SPECIFIC CALLBACK MODULE

GENERIC BEHAVIOUR

MODULE

Server

process

Behaviours

Page 215: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Behaviours

Page 216: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Behaviours

Servers

Page 217: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Behaviours

Servers

Finite State Machines

Page 218: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Behaviours

Servers

Finite State Machines

Event Handlers

Page 219: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Behaviours

Servers

Finite State Machines

Event Handlers

Supervisors

Page 220: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

OTP Behaviours

Servers

Finite State Machines

Event Handlers

Supervisors

Applications

Page 221: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Nasty Things Handled by OTP

Page 222: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Nasty Things Handled by OTP

Who are you gonna call?

Page 223: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Client Server

Page 224: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

call(Name, Message) ->! Name ! {request, self(), Message},! receive! {reply, Reply} -> Reply! end.

Client Server

{request, Pid, Message}

Page 225: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

call(Name, Message) ->! Name ! {request, self(), Message},! receive! {reply, Reply} -> Reply! end.

reply(Pid, Reply) ->! Pid ! {reply, Reply}.

Client Server

{request, Pid, Message}

{reply, Reply}

Page 226: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Client Server

{request, Pid, Message}

{reply, Reply}

Page 227: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Client Server

{request, Pid, Message}

{reply, Reply}

Server 2

Page 228: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Client Server

{request, Pid, Message}

{reply, Reply}

Server 2

{reply, Reply}

Page 229: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Client Server

{request, Pid, Message}

{reply, Reply}

Server 2

{reply, Reply}

call(Name, Msg) ->! Ref = make_ref(),! Name ! {request, {Ref, self()}, Msg},! receive {reply, Ref, Reply} -> Reply end.!!reply({Ref, Pid}, Reply) ->! Pid ! {reply, Ref, Reply}.

Page 230: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Client Server

Server 2

{reply, Reply}

call(Name, Msg) ->! Ref = make_ref(),! Name ! {request, {Ref, self()}, Msg},! receive {reply, Ref, Reply} -> Reply end.!!reply({Ref, Pid}, Reply) ->! Pid ! {reply, Ref, Reply}.

{request, {Ref, self()}, Message}

{reply, Ref, Reply}

Page 231: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Client Server

Server 2

call(Name, Msg) ->! Ref = make_ref(),! Name ! {request, {Ref, self()}, Msg},! receive {reply, Ref, Reply} -> Reply end.!!reply({Ref, Pid}, Reply) ->! Pid ! {reply, Ref, Reply}.

{request, {Ref, self()}, Message}

{reply, Ref, Reply}

{reply, ???, Reply}

Page 232: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PidA PidB

Page 233: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PidA PidB

{request, {Ref, PidA}, Msg}

Page 234: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PidA

Page 235: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PidA

call(Name, Msg) ->! Ref = erlang:monitor(process, Name),! Name ! {request, {Ref, self()}, Msg},! receive!! {reply, Ref, Reply} ->!! erlang:demonitor(Ref),!! Reply;!! {'DOWN', Ref, process, _Name, _Reason} ->!! {error, no_proc}! end.

Page 236: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PidA PidB

Page 237: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PidA PidB

{request, {Ref, PidA}, Msg}

Page 238: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PidA PidB{reply, Ref, Reply}

Page 239: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PidA

{'DOWN', Ref, process, PidB, Reason}

Page 240: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

PidA

call(Name, Msg) ->! Ref = erlang:monitor(process, Name),! Name ! {request, {Ref, self()}, Msg},! receive!! {reply, Ref, Reply} ->!! erlang:demonitor(Ref, [flush]),!! Reply;!! {'DOWN', Ref, process, _Name, _Reason} ->!! {error, no_proc}! end.

{'DOWN', Ref, process, PidB, Reason}

Page 241: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Dealing with deadlocks

Page 242: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Dealing with deadlocks

7 years of coding Erlang

Page 243: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Dealing with deadlocks

7 years of coding Erlang

Time spent on deadlock issues….

Page 244: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Dealing with deadlocks

7 years of coding Erlang

Time spent on deadlock issues….

1 hour (due to lack of experience with OTP)

Page 245: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Selling Others on Erlang

Page 246: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

In Theory...You conquer the TALC group by group in one smooth motion

66

Page 247: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

In Theory...You conquer the TALC group by group in one smooth motion

66

1

Page 248: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

In Theory...You conquer the TALC group by group in one smooth motion

66

12

Page 249: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

In Theory...You conquer the TALC group by group in one smooth motion

66

12

3

Page 250: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

In Theory...You conquer the TALC group by group in one smooth motion

66

12

3 4

Page 251: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

In Theory...You conquer the TALC group by group in one smooth motion

66

12

3 4

5

Page 252: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

In Theory...You conquer the TALC group by group in one smooth motion

66

12

3 4

5

but it’s just an illusion :-(

Page 253: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Cracks and a Chasm

67

Page 254: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Cracks and a Chasm

67

Technology enthusiasts

Page 255: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Cracks and a Chasm

67

Technology enthusiasts

Visionaries

Page 256: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Cracks and a Chasm

67

Technology enthusiasts

Visionaries

Pragmatists

Page 257: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Cracks and a Chasm

67

Technology enthusiasts

Visionaries

PragmatistsConservatives

Page 258: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Cracks and a Chasm

67

Technology enthusiasts

Visionaries

PragmatistsConservatives

Laggards

Page 259: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Cracks and a Chasm

67

Technology enthusiasts

Visionaries

PragmatistsConservatives

Laggards

Crack

Page 260: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Cracks and a Chasm

67

Technology enthusiasts

Visionaries

PragmatistsConservatives

Laggards

Crack

Crack

Page 261: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Cracks and a Chasm

67

Technology enthusiasts

Visionaries

PragmatistsConservatives

Laggards

Crack

CrackChasm

Page 262: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The Chasm

Page 263: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The ChasmFrom Visionaries to Pragmatists

Page 264: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The ChasmFrom Visionaries to Pragmatists

Visionaries buy a change agent to get a radical discontinuity

Page 265: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The ChasmFrom Visionaries to Pragmatists

Visionaries buy a change agent to get a radical discontinuity

Pragmatists want a productivity improvement for existing operations

Page 266: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The ChasmFrom Visionaries to Pragmatists

Visionaries buy a change agent to get a radical discontinuity

Pragmatists want a productivity improvement for existing operations

Pragmatists want evolution, not revolution

Page 267: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The ChasmFrom Visionaries to Pragmatists

Visionaries buy a change agent to get a radical discontinuity

Pragmatists want a productivity improvement for existing operations

Pragmatists want evolution, not revolution

Pragmatists wants references

Page 268: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Visionaries vs Pragmatists

69

Visionaries have four characteristics that alienate Pragmatists:

Page 269: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Visionaries vs Pragmatists

Lack of respect for their colleagues’ experiences

69

Visionaries have four characteristics that alienate Pragmatists:

Page 270: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Visionaries vs Pragmatists

Lack of respect for their colleagues’ experiences

Takes greater interest in technology than in their industry

69

Visionaries have four characteristics that alienate Pragmatists:

Page 271: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Visionaries vs Pragmatists

Lack of respect for their colleagues’ experiences

Takes greater interest in technology than in their industry

Fail to recognise the importance of existing product infrastructure

69

Visionaries have four characteristics that alienate Pragmatists:

Page 272: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Visionaries vs Pragmatists

Lack of respect for their colleagues’ experiences

Takes greater interest in technology than in their industry

Fail to recognise the importance of existing product infrastructure

Overall disruptiveness

69

Visionaries have four characteristics that alienate Pragmatists:

Page 273: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Whole Product Planning

70

Generic Product

Standards &

Procedures Additional Software

System Integration

Training &

Support

Installation &

Debugging

Additional Hardware

Anything else to achieve your

compelling reason to buy

Simplified for chasm crossing

Page 274: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Whole Product Planning

70

Generic Product

Standards &

Procedures Additional Software

System Integration

Training &

Support

Installation &

Debugging

Additional Hardware

Anything else to achieve your

compelling reason to buy

Simplified for chasm crossing

= marketing promise to win the sale

Page 275: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Erlang Whole Product 1/2

Generic product:

Erlang compiler and runtime

Additional software:

rich library shipped with each release

many open source libraries

Training & support:

ESL provides many courses

ErlangCamp also provides training

71

Page 276: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

© 1999-2012 Erlang Solutions Ltd.

Erlang Whole Product 2/2

System integration:

mostly case-by-case

few public success stories

Installation & Debugging:

Adequate functionalities for installing applications

Wombat: ESL tool for Operations and Maintenance

Good debugging tools, but not well publicised

72

Page 277: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The EuroVision Link

source: http://sawyerspeaks.com/wp-content/uploads/2011/04/larry_ellison_oracle_ceo.jpgsource: http://cache1.asset-cache.net/gc/489477445-conchita-wurst-of-austria-performs-on-stage-gettyimages.jpg?v=1&c=IWSAsset&k=2&d=X7WJLa88Cweo9HktRLaNXrTYXDJ3BsApHeprRdCRbmiAEiSzJ73mXeJ82T5OvCcz

source: http://i1.cdnds.net/14/19/618x411/uktv-eurovision-song-contest-2014-25.jpg

Or why Java is used more than Erlang…

Page 278: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The EuroVision Link

source: http://sawyerspeaks.com/wp-content/uploads/2011/04/larry_ellison_oracle_ceo.jpgsource: http://cache1.asset-cache.net/gc/489477445-conchita-wurst-of-austria-performs-on-stage-gettyimages.jpg?v=1&c=IWSAsset&k=2&d=X7WJLa88Cweo9HktRLaNXrTYXDJ3BsApHeprRdCRbmiAEiSzJ73mXeJ82T5OvCcz

source: http://i1.cdnds.net/14/19/618x411/uktv-eurovision-song-contest-2014-25.jpg

Lots of wrapping

Or why Java is used more than Erlang…

Page 279: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

The EuroVision Link

source: http://sawyerspeaks.com/wp-content/uploads/2011/04/larry_ellison_oracle_ceo.jpgsource: http://cache1.asset-cache.net/gc/489477445-conchita-wurst-of-austria-performs-on-stage-gettyimages.jpg?v=1&c=IWSAsset&k=2&d=X7WJLa88Cweo9HktRLaNXrTYXDJ3BsApHeprRdCRbmiAEiSzJ73mXeJ82T5OvCcz

source: http://i1.cdnds.net/14/19/618x411/uktv-eurovision-song-contest-2014-25.jpg

Lots of wrapping The real McCoy

Or why Java is used more than Erlang…

Page 280: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Source: http://www.despair.com/mistakes.html

Page 281: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Learning Erlang

Page 283: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Learning Erlang

ESL training courses

Learn You Some Erlang

http://learnyousomeerlang.com/

Page 284: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Learning Erlang

ESL training courses

Learn You Some Erlang

http://learnyousomeerlang.com/

Use the erlang-questions mailing list

Page 285: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Learning Erlang

ESL training courses

Learn You Some Erlang

http://learnyousomeerlang.com/

Use the erlang-questions mailing list

Do it hands-on

Page 286: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Learning Erlang

ESL training courses

Learn You Some Erlang

http://learnyousomeerlang.com/

Use the erlang-questions mailing list

Do it hands-on

Give it time to sink in!!!

Page 287: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Elixir

Page 288: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Elixir

Built on top of the Erlang VM

Page 289: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Elixir

Built on top of the Erlang VM

More Ruby-like syntax

Page 290: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Elixir

Built on top of the Erlang VM

More Ruby-like syntax

Hygienic macros - easy to do DSLs

Page 291: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Elixir

Built on top of the Erlang VM

More Ruby-like syntax

Hygienic macros - easy to do DSLs

But… you still have to learn the Erlang programming model

Page 292: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Key building blocks

Page 293: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Key building blocks

Share nothing processes

Page 294: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Key building blocks

Share nothing processes

Message passing

Page 295: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Key building blocks

Share nothing processes

Message passing

Fail fast approach

Page 296: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Key building blocks

Share nothing processes

Message passing

Fail fast approach

Link/monitor concept

Page 297: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Key building blocks

Share nothing processes

Message passing

Fail fast approach

Link/monitor concept

You can deal with failures in a sensible manner because you have a language for them.

Page 298: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Cruising with Erlang

Page 299: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Cruising with Erlang

Understand the failure model

Page 300: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Cruising with Erlang

Understand the failure model

Embrace failure!

Page 301: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Cruising with Erlang

Understand the failure model

Embrace failure!

Use supervision patterns to deliver business value

Page 302: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Cruising with Erlang

Understand the failure model

Embrace failure!

Use supervision patterns to deliver business value

Stay in charge!

Page 303: Erlang - Trifork · Founded in 1999 soon after Erlang was released as open source Experts at building bespoke scalable, high availability, high performance systems Only company of

Cruising with Erlang

Understand the failure model

Embrace failure!

Use supervision patterns to deliver business value

Stay in charge!