SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
Erlang From Behing the Trenches
Francesco Cesarini
Founder, Technical Director
@FrancescoC
francesco@erlang-solutions.com
Or Whats App’s Secret Sauce
Erlang & Elixir Factory Lite
Bangalore, India
November 17th 2017
© 2017 – Erlang Solutions Ltd.
WhatsApp Acquisition by Facebook
© 2017 – Erlang Solutions Ltd.
Who Uses Erlang?
© 2017 – Erlang Solutions Ltd.
Telecom Applications: Issues
Complex
No down time
Scalable
Maintainable
Distributed
vs
Time to Market
Access transport and switching networks
Cellular
PLMN
PSTN/
ISDN
Data/ IP
Networks
CATV
Services
Past
Single-service networks
Clients/applications
Present
Multiservice networks/client server
Backbone
Network
Access Access Access
Content Content
Control
Communication
applications
Media
Gateways
© 2017 – Erlang Solutions Ltd.
The Ancestors
© 2017 – Erlang Solutions Ltd.
The Ancestors
© 2017 – Erlang Solutions Ltd.
Erlang Highlights
Declarative
Concurrent
Robust
Distributed
Hot code loading
Multicore Support
OTP
Functional programming
language
High abstraction level
Pattern matching
Concise readable programs
© 2017 – Erlang Solutions Ltd.
Erlang Highlights: Factorial
n! =
1
n*(n-1)!
n = 0
n≥ 1
Definition
-module(ex1).
-export([factorial/1]).
factorial(0) ->
1;
factorial(N) when N >= 1 ->
N * factorial(N-1).
Implementation
Eshell V5.0.1 (abort with ^G)
1> c(ex1).
{ok,ex1}
2> ex1:factorial(6).
720
Factorial using Recursion
© 2017 – Erlang Solutions Ltd.
Erlang Highlights: High-level Constructs
QuickSort using List Comprehensions
-module(ex2).
-export([qsort/1]).
qsort([Head|Tail]) ->
First = qsort([X || X <- Tail, X =< Head]),
Last = qsort([Y || Y <- Tail, Y > Head]),
First ++ [Head] ++ Last;
qsort([]) ->
[].
Eshell V5.0.1 (abort with ^G)
1> c(ex2).
{ok,ex2}
2> ex2:qsort([7,5,3,8,1]).
[1,3,5,7,8]
"all objects Y
taken from the list
Tail, where
Y > Head"
© 2017 – Erlang Solutions Ltd.
Erlang Highlights: High-level Constructs
<< SourcePort:16, DestinationPort:16, SequenceNumber:32,
AckNumber:32, DataOffset:4, _Reserved:4, Flags:8,
WindowSize:16, Checksum:16, UrgentPointer:16,
Payload/binary>> = Segment,
OptSize = (DataOffset - 5)*32,
<< Options:OptSize, Message/binary >> = Payload,
<< CWR:1, ECE:1, URG:1, ACK:1, PSH:1,
RST:1, SYN:1, FIN:1>> = <<Flags:8>>,
%% Can now process the Message according to the
%% Options (if any) and the flags CWR, ..., FIN
etc…
Parsing a TCP packet using the Bit Syntax
© 2017 – Erlang Solutions Ltd.
Erlang Highlights
Declarative
Concurrent
Robust
Distributed
Hot code loading
Multicore Support
OTP
Either transparent or
explicit concurrency
Light-weight processes
Highly scalable
© 2017 – Erlang Solutions Ltd.
activity(Joe,75,1024)
Erlang Highlights: Concurrency
Creating a new process using spawn
-module(ex3).
-export([activity/3]).
activity(Name,Pos,Size) ->
…………
Pid = spawn(ex3,activity,[Joe,75,1024])
© 2017 – Erlang Solutions Ltd.
Erlang Highlights: Concurrency
Processes communicate by asynchronous
message passing
Pid ! {data,12,13}
receive
{start} -> ………
{stop} -> ………
{data,X,Y} -> ………
end
receive
{start} -> ………
{stop} -> ………
{data,X,Y} -> ………
end
© 2017 – Erlang Solutions Ltd.
Erlang Highlights
Declarative
Concurrent
Robust
Distributed
Hot code loading
Multicore Support
OTP
Simple and consistent
error recovery
Supervision hierarchies
"Program for the correct case"
© 2017 – Erlang Solutions Ltd.
Erlang Highlights: Robustness
Cooperating processes may be linked together
using
spawn_link(…,…,…)
or
link(Pid)
© 2017 – Erlang Solutions Ltd.
Erlang Highlights: Robustness
When a process terminates, an exit signal is sent to all linked processes
… and the termination is propagated
© 2017 – Erlang Solutions Ltd.
Erlang Highlights: Robustness
Exit signals can be trapped and received as messages
receive
{‘EXIT’,Pid,...} -> ...
end
© 2017 – Erlang Solutions Ltd.
Erlang Highlights: Robustness
Robust systems can be built by layering
“Supervisors”
“Workers”
© 2017 – Erlang Solutions Ltd.
Erlang Highlights
Declarative
Concurrent
Robust
Distributed
Hot code loading
Multicore Support
OTP
Explicit or transparent
distribution
Network-aware
runtime system
© 2017 – Erlang Solutions Ltd.
Erlang Highlights: Distribution
Erlang Run-Time System Erlang Run-Time System
B ! Msg
network
C ! Msg
© 2017 – Erlang Solutions Ltd.
Erlang Highlights
Declarative
Concurrent
Robust
Distributed
Hot code loading
Multicore Support
OTP
Easily change code in a
running system
Enables non-stop operation
Simplifies testing
© 2017 – Erlang Solutions Ltd.
Erlang Highlights: Hot Code Swap
Version 1 Version 2
© 2017 – Erlang Solutions Ltd.
Erlang Highlights
SMP support provides linear
scalability out of the box
thanks to its no shared
memory approach to concurrency.
Declarative
Concurrent
Robust
Distributed
Hot code loading
Multicore Support
OTP
© 2017 – Erlang Solutions Ltd.
Multicore Erlang
Erlang VM
Scheduler #1
Scheduler #2
run queue
Scheduler #2
Scheduler #N
run queue
run queue
migration
logic
migration
logic
© 2017 – Erlang Solutions Ltd.
Erlang Highlights
OTP hides the complexity of
concurrent systems into reusable
libraries, making scalability and
reliability easy to deal with.
Declarative
Concurrent
Robust
Distributed
Hot code loading
Multicore Support
OTP
© 2017 – Erlang Solutions Ltd.
© 2017 – Erlang Solutions Ltd.
The Myths of Erlang….
Is it Documented?
Is the developer supporting it?
What visibility does support staff have into what is going on?
!  SNMP
!  Live Tracing
!  Audit Trails
!  Statistics
!  CLI / HTTP Interface
How much new code was actually written?
© 2017 – Erlang Solutions Ltd.
© 2017 – Erlang Solutions Ltd.
The Myths of Erlang….
Yes, it is easy for
!  Simple patches
!  Adding functionality without changing the state
Non backwards compatible changes need time time
!  Database schema changes
!  State changes in your processes
!  Upgrades in distributed environments
Test, Test, Test
!  A great feature when you have the manpower!
© 2017 – Erlang Solutions Ltd.
© 2017 – Erlang Solutions Ltd.
The Myths of Erlang….
© 2017 – Erlang Solutions Ltd.
The Myths of Erlang….
99,999 (Five Nines) is a more like it!
!  Achieved at a fraction of the effort of Java & C++
Upgrades are risky!
Reliability and Resilience need to be in your initial
design!
Non Software related issues
!  Power Outages
!  Network Failures, Firewall Configurations
!  Hardware Faults
© 2017 – Erlang Solutions Ltd.
CouchDB
Distributed Robust document database
Riak
Distributed, partition tolerant and
scalable database
Disco Project
100% Map Reduce, 0% Java
RabbitMQ
High performance enterprise messaging
MongooseIM
Scalable XMPP instant messaging server
based on ejabberd.
Erlang: It’s Happening!
© 2017 – Erlang Solutions Ltd.
Elixir: It’s Happening!
© 2017 – Erlang Solutions Ltd.
Erlang: It’s Happening!
© 2017 – Erlang Solutions Ltd.
More Information
Programming Erlang – Second Edition
!  Software for a Concurrent World
!  by Joe Armstrong
Erlang Programming
!  A Concurrent Approach to Software Development
!  by Francesco Cesarini & Simon Thompson
Designing for Scalability with Erlang/OTP
!  Reliability and Scalability with OTP
!  by Francesco Cesarini & Steve Vinoski
© 2017 – Erlang Solutions Ltd.
Online Resources
Erlang Master Classes – University of Kent
!  https://www.cs.kent.ac.uk/ErlangMasterClasses/
Erlang MOOC – Online Classes – Future Learn
!  https://www.futurelearn.com/courses/functional-programming-erlang
Adopting Non Mainstream Technologies
!  http://bit.ly/AdoptingErlang
!  http://bit.ly/LearningErlang
Websites
!  http://www.erlang.org
!  https://elixir-lang.org
!  https://erlangcentral.org
Any Questions?
Francesco Cesarini
Founder, Technical Director
@FrancescoC
francesco@erlang-solutions.com
Erlang & Elixir Factory Lite
Bangalore, India
November 17th 2017

Contenu connexe

Similaire à Erlang from behing the trenches by Francesco Cesarini

Chandan's_Resume
Chandan's_ResumeChandan's_Resume
Chandan's_ResumeChandan Das
 
Ramkumar_python_perl_unix shell script developer
Ramkumar_python_perl_unix shell script developerRamkumar_python_perl_unix shell script developer
Ramkumar_python_perl_unix shell script developerRamkumar Shankar
 
The Cloud Journey in an Enterprise - CoDe-Conf - Copenhagen October 11, 2018
The Cloud Journey in an Enterprise - CoDe-Conf - Copenhagen October 11, 2018 The Cloud Journey in an Enterprise - CoDe-Conf - Copenhagen October 11, 2018
The Cloud Journey in an Enterprise - CoDe-Conf - Copenhagen October 11, 2018 Anders Lundsgård
 
Apache Spark and Apache Ignite: Where Fast Data Meets IoT
Apache Spark and Apache Ignite: Where Fast Data Meets IoTApache Spark and Apache Ignite: Where Fast Data Meets IoT
Apache Spark and Apache Ignite: Where Fast Data Meets IoTDenis Magda
 
Resume_Appaji
Resume_AppajiResume_Appaji
Resume_AppajiAppaji K
 
Database as code in Devops - DBを10分間で1000個構築するDB仮想化テクノロジーとは?(Adam)
Database as code in Devops - DBを10分間で1000個構築するDB仮想化テクノロジーとは?(Adam)Database as code in Devops - DBを10分間で1000個構築するDB仮想化テクノロジーとは?(Adam)
Database as code in Devops - DBを10分間で1000個構築するDB仮想化テクノロジーとは?(Adam)Insight Technology, Inc.
 
TranKienHao_SeniorDeveloper_CV
TranKienHao_SeniorDeveloper_CVTranKienHao_SeniorDeveloper_CV
TranKienHao_SeniorDeveloper_CVHao Tran Kien
 
Securing Search Index with Searchable Encryption
Securing Search Index with Searchable EncryptionSecuring Search Index with Searchable Encryption
Securing Search Index with Searchable EncryptionHarry Ochiai
 
Thinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - CesariniThinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - CesariniCodemotion
 
Internet of manufacturing and Open Source
Internet of manufacturing and Open SourceInternet of manufacturing and Open Source
Internet of manufacturing and Open SourceIan Skerrett
 
Your Self-Driving Car - How Did it Get So Smart?
Your Self-Driving Car - How Did it Get So Smart?Your Self-Driving Car - How Did it Get So Smart?
Your Self-Driving Car - How Did it Get So Smart?Hortonworks
 
A framework used to bridge between the language of business and PLCS
A framework used to bridge between the language of business and PLCSA framework used to bridge between the language of business and PLCS
A framework used to bridge between the language of business and PLCSMagnus Färneland
 
DevOps Underground - DevOps Higher Maturity Levels
DevOps Underground - DevOps Higher Maturity LevelsDevOps Underground - DevOps Higher Maturity Levels
DevOps Underground - DevOps Higher Maturity Levelskloia
 

Similaire à Erlang from behing the trenches by Francesco Cesarini (20)

Chandan's_Resume
Chandan's_ResumeChandan's_Resume
Chandan's_Resume
 
Resume-RDn-Detailed
Resume-RDn-DetailedResume-RDn-Detailed
Resume-RDn-Detailed
 
Ramkumar_python_perl_unix shell script developer
Ramkumar_python_perl_unix shell script developerRamkumar_python_perl_unix shell script developer
Ramkumar_python_perl_unix shell script developer
 
jgj-cv-eng-201601
jgj-cv-eng-201601jgj-cv-eng-201601
jgj-cv-eng-201601
 
Agcv
AgcvAgcv
Agcv
 
Aman Sharma
Aman SharmaAman Sharma
Aman Sharma
 
The Cloud Journey in an Enterprise - CoDe-Conf - Copenhagen October 11, 2018
The Cloud Journey in an Enterprise - CoDe-Conf - Copenhagen October 11, 2018 The Cloud Journey in an Enterprise - CoDe-Conf - Copenhagen October 11, 2018
The Cloud Journey in an Enterprise - CoDe-Conf - Copenhagen October 11, 2018
 
CV_Alex_Mazur_SPD
CV_Alex_Mazur_SPDCV_Alex_Mazur_SPD
CV_Alex_Mazur_SPD
 
Apache Spark and Apache Ignite: Where Fast Data Meets IoT
Apache Spark and Apache Ignite: Where Fast Data Meets IoTApache Spark and Apache Ignite: Where Fast Data Meets IoT
Apache Spark and Apache Ignite: Where Fast Data Meets IoT
 
Resume_Appaji
Resume_AppajiResume_Appaji
Resume_Appaji
 
Database as code in Devops - DBを10分間で1000個構築するDB仮想化テクノロジーとは?(Adam)
Database as code in Devops - DBを10分間で1000個構築するDB仮想化テクノロジーとは?(Adam)Database as code in Devops - DBを10分間で1000個構築するDB仮想化テクノロジーとは?(Adam)
Database as code in Devops - DBを10分間で1000個構築するDB仮想化テクノロジーとは?(Adam)
 
TranKienHao_SeniorDeveloper_CV
TranKienHao_SeniorDeveloper_CVTranKienHao_SeniorDeveloper_CV
TranKienHao_SeniorDeveloper_CV
 
Bkl_12_9_T_0515
Bkl_12_9_T_0515Bkl_12_9_T_0515
Bkl_12_9_T_0515
 
Securing Search Index with Searchable Encryption
Securing Search Index with Searchable EncryptionSecuring Search Index with Searchable Encryption
Securing Search Index with Searchable Encryption
 
Thinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - CesariniThinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - Cesarini
 
CV (eng) Thomas Lindström
CV (eng) Thomas LindströmCV (eng) Thomas Lindström
CV (eng) Thomas Lindström
 
Internet of manufacturing and Open Source
Internet of manufacturing and Open SourceInternet of manufacturing and Open Source
Internet of manufacturing and Open Source
 
Your Self-Driving Car - How Did it Get So Smart?
Your Self-Driving Car - How Did it Get So Smart?Your Self-Driving Car - How Did it Get So Smart?
Your Self-Driving Car - How Did it Get So Smart?
 
A framework used to bridge between the language of business and PLCS
A framework used to bridge between the language of business and PLCSA framework used to bridge between the language of business and PLCS
A framework used to bridge between the language of business and PLCS
 
DevOps Underground - DevOps Higher Maturity Levels
DevOps Underground - DevOps Higher Maturity LevelsDevOps Underground - DevOps Higher Maturity Levels
DevOps Underground - DevOps Higher Maturity Levels
 

Plus de Naresh Jain

Problem Solving Techniques For Evolutionary Design
Problem Solving Techniques For Evolutionary DesignProblem Solving Techniques For Evolutionary Design
Problem Solving Techniques For Evolutionary DesignNaresh Jain
 
Agile India 2019 Conference Welcome Note
Agile India 2019 Conference Welcome NoteAgile India 2019 Conference Welcome Note
Agile India 2019 Conference Welcome NoteNaresh Jain
 
Organizational Resilience
Organizational ResilienceOrganizational Resilience
Organizational ResilienceNaresh Jain
 
Improving the Quality of Incoming Code
Improving the Quality of Incoming CodeImproving the Quality of Incoming Code
Improving the Quality of Incoming CodeNaresh Jain
 
Agile India 2018 Conference Summary
Agile India 2018 Conference SummaryAgile India 2018 Conference Summary
Agile India 2018 Conference SummaryNaresh Jain
 
Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 ConferenceNaresh Jain
 
Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 ConferenceNaresh Jain
 
Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 ConferenceNaresh Jain
 
Pilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert VirdingPilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert VirdingNaresh Jain
 
Anatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur DatarAnatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur DatarNaresh Jain
 
Setting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile AppSetting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile AppNaresh Jain
 
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to ProdTowards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to ProdNaresh Jain
 
Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas Naresh Jain
 
No Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKennaNo Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKennaNaresh Jain
 
Functional Programming Conference 2016
Functional Programming Conference 2016Functional Programming Conference 2016
Functional Programming Conference 2016Naresh Jain
 
Agile India 2017 Conference
Agile India 2017 ConferenceAgile India 2017 Conference
Agile India 2017 ConferenceNaresh Jain
 
Unleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTUnleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTNaresh Jain
 
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo KimGetting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo KimNaresh Jain
 
MVP Design Hacks
MVP Design HacksMVP Design Hacks
MVP Design HacksNaresh Jain
 

Plus de Naresh Jain (20)

Problem Solving Techniques For Evolutionary Design
Problem Solving Techniques For Evolutionary DesignProblem Solving Techniques For Evolutionary Design
Problem Solving Techniques For Evolutionary Design
 
Agile India 2019 Conference Welcome Note
Agile India 2019 Conference Welcome NoteAgile India 2019 Conference Welcome Note
Agile India 2019 Conference Welcome Note
 
Organizational Resilience
Organizational ResilienceOrganizational Resilience
Organizational Resilience
 
Improving the Quality of Incoming Code
Improving the Quality of Incoming CodeImproving the Quality of Incoming Code
Improving the Quality of Incoming Code
 
Agile India 2018 Conference Summary
Agile India 2018 Conference SummaryAgile India 2018 Conference Summary
Agile India 2018 Conference Summary
 
Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 Conference
 
Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 Conference
 
Agile India 2018 Conference
Agile India 2018 ConferenceAgile India 2018 Conference
Agile India 2018 Conference
 
Pilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert VirdingPilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert Virding
 
Anatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur DatarAnatomy of an eCommerce Search Engine by Mayur Datar
Anatomy of an eCommerce Search Engine by Mayur Datar
 
Setting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile AppSetting up Continuous Delivery Culture for a Large Scale Mobile App
Setting up Continuous Delivery Culture for a Large Scale Mobile App
 
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to ProdTowards FutureOps: Stable, Repeatable environments from Dev to Prod
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
 
Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas Value Driven Development by Dave Thomas
Value Driven Development by Dave Thomas
 
No Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKennaNo Silver Bullets in Functional Programming by Brian McKenna
No Silver Bullets in Functional Programming by Brian McKenna
 
Functional Programming Conference 2016
Functional Programming Conference 2016Functional Programming Conference 2016
Functional Programming Conference 2016
 
Agile India 2017 Conference
Agile India 2017 ConferenceAgile India 2017 Conference
Agile India 2017 Conference
 
The Eclipse Way
The Eclipse WayThe Eclipse Way
The Eclipse Way
 
Unleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTUnleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDT
 
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo KimGetting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
Getting2Alpha: Turbo-charge your product with Game Thinking by Amy Jo Kim
 
MVP Design Hacks
MVP Design HacksMVP Design Hacks
MVP Design Hacks
 

Dernier

Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 

Dernier (20)

Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Erlang from behing the trenches by Francesco Cesarini

  • 1. Erlang From Behing the Trenches Francesco Cesarini Founder, Technical Director @FrancescoC francesco@erlang-solutions.com Or Whats App’s Secret Sauce Erlang & Elixir Factory Lite Bangalore, India November 17th 2017
  • 2. © 2017 – Erlang Solutions Ltd. WhatsApp Acquisition by Facebook
  • 3. © 2017 – Erlang Solutions Ltd. Who Uses Erlang?
  • 4. © 2017 – Erlang Solutions Ltd. Telecom Applications: Issues Complex No down time Scalable Maintainable Distributed vs Time to Market Access transport and switching networks Cellular PLMN PSTN/ ISDN Data/ IP Networks CATV Services Past Single-service networks Clients/applications Present Multiservice networks/client server Backbone Network Access Access Access Content Content Control Communication applications Media Gateways
  • 5. © 2017 – Erlang Solutions Ltd. The Ancestors
  • 6. © 2017 – Erlang Solutions Ltd. The Ancestors
  • 7. © 2017 – Erlang Solutions Ltd. Erlang Highlights Declarative Concurrent Robust Distributed Hot code loading Multicore Support OTP Functional programming language High abstraction level Pattern matching Concise readable programs
  • 8. © 2017 – Erlang Solutions Ltd. Erlang Highlights: Factorial n! = 1 n*(n-1)! n = 0 n≥ 1 Definition -module(ex1). -export([factorial/1]). factorial(0) -> 1; factorial(N) when N >= 1 -> N * factorial(N-1). Implementation Eshell V5.0.1 (abort with ^G) 1> c(ex1). {ok,ex1} 2> ex1:factorial(6). 720 Factorial using Recursion
  • 9. © 2017 – Erlang Solutions Ltd. Erlang Highlights: High-level Constructs QuickSort using List Comprehensions -module(ex2). -export([qsort/1]). qsort([Head|Tail]) -> First = qsort([X || X <- Tail, X =< Head]), Last = qsort([Y || Y <- Tail, Y > Head]), First ++ [Head] ++ Last; qsort([]) -> []. Eshell V5.0.1 (abort with ^G) 1> c(ex2). {ok,ex2} 2> ex2:qsort([7,5,3,8,1]). [1,3,5,7,8] "all objects Y taken from the list Tail, where Y > Head"
  • 10. © 2017 – Erlang Solutions Ltd. Erlang Highlights: High-level Constructs << SourcePort:16, DestinationPort:16, SequenceNumber:32, AckNumber:32, DataOffset:4, _Reserved:4, Flags:8, WindowSize:16, Checksum:16, UrgentPointer:16, Payload/binary>> = Segment, OptSize = (DataOffset - 5)*32, << Options:OptSize, Message/binary >> = Payload, << CWR:1, ECE:1, URG:1, ACK:1, PSH:1, RST:1, SYN:1, FIN:1>> = <<Flags:8>>, %% Can now process the Message according to the %% Options (if any) and the flags CWR, ..., FIN etc… Parsing a TCP packet using the Bit Syntax
  • 11. © 2017 – Erlang Solutions Ltd. Erlang Highlights Declarative Concurrent Robust Distributed Hot code loading Multicore Support OTP Either transparent or explicit concurrency Light-weight processes Highly scalable
  • 12. © 2017 – Erlang Solutions Ltd. activity(Joe,75,1024) Erlang Highlights: Concurrency Creating a new process using spawn -module(ex3). -export([activity/3]). activity(Name,Pos,Size) -> ………… Pid = spawn(ex3,activity,[Joe,75,1024])
  • 13. © 2017 – Erlang Solutions Ltd. Erlang Highlights: Concurrency Processes communicate by asynchronous message passing Pid ! {data,12,13} receive {start} -> ……… {stop} -> ……… {data,X,Y} -> ……… end receive {start} -> ……… {stop} -> ……… {data,X,Y} -> ……… end
  • 14. © 2017 – Erlang Solutions Ltd. Erlang Highlights Declarative Concurrent Robust Distributed Hot code loading Multicore Support OTP Simple and consistent error recovery Supervision hierarchies "Program for the correct case"
  • 15. © 2017 – Erlang Solutions Ltd. Erlang Highlights: Robustness Cooperating processes may be linked together using spawn_link(…,…,…) or link(Pid)
  • 16. © 2017 – Erlang Solutions Ltd. Erlang Highlights: Robustness When a process terminates, an exit signal is sent to all linked processes … and the termination is propagated
  • 17. © 2017 – Erlang Solutions Ltd. Erlang Highlights: Robustness Exit signals can be trapped and received as messages receive {‘EXIT’,Pid,...} -> ... end
  • 18. © 2017 – Erlang Solutions Ltd. Erlang Highlights: Robustness Robust systems can be built by layering “Supervisors” “Workers”
  • 19. © 2017 – Erlang Solutions Ltd. Erlang Highlights Declarative Concurrent Robust Distributed Hot code loading Multicore Support OTP Explicit or transparent distribution Network-aware runtime system
  • 20. © 2017 – Erlang Solutions Ltd. Erlang Highlights: Distribution Erlang Run-Time System Erlang Run-Time System B ! Msg network C ! Msg
  • 21. © 2017 – Erlang Solutions Ltd. Erlang Highlights Declarative Concurrent Robust Distributed Hot code loading Multicore Support OTP Easily change code in a running system Enables non-stop operation Simplifies testing
  • 22. © 2017 – Erlang Solutions Ltd. Erlang Highlights: Hot Code Swap Version 1 Version 2
  • 23. © 2017 – Erlang Solutions Ltd. Erlang Highlights SMP support provides linear scalability out of the box thanks to its no shared memory approach to concurrency. Declarative Concurrent Robust Distributed Hot code loading Multicore Support OTP
  • 24. © 2017 – Erlang Solutions Ltd. Multicore Erlang Erlang VM Scheduler #1 Scheduler #2 run queue Scheduler #2 Scheduler #N run queue run queue migration logic migration logic
  • 25. © 2017 – Erlang Solutions Ltd. Erlang Highlights OTP hides the complexity of concurrent systems into reusable libraries, making scalability and reliability easy to deal with. Declarative Concurrent Robust Distributed Hot code loading Multicore Support OTP
  • 26. © 2017 – Erlang Solutions Ltd.
  • 27. © 2017 – Erlang Solutions Ltd. The Myths of Erlang…. Is it Documented? Is the developer supporting it? What visibility does support staff have into what is going on? !  SNMP !  Live Tracing !  Audit Trails !  Statistics !  CLI / HTTP Interface How much new code was actually written?
  • 28. © 2017 – Erlang Solutions Ltd.
  • 29. © 2017 – Erlang Solutions Ltd. The Myths of Erlang…. Yes, it is easy for !  Simple patches !  Adding functionality without changing the state Non backwards compatible changes need time time !  Database schema changes !  State changes in your processes !  Upgrades in distributed environments Test, Test, Test !  A great feature when you have the manpower!
  • 30. © 2017 – Erlang Solutions Ltd.
  • 31. © 2017 – Erlang Solutions Ltd. The Myths of Erlang….
  • 32. © 2017 – Erlang Solutions Ltd. The Myths of Erlang…. 99,999 (Five Nines) is a more like it! !  Achieved at a fraction of the effort of Java & C++ Upgrades are risky! Reliability and Resilience need to be in your initial design! Non Software related issues !  Power Outages !  Network Failures, Firewall Configurations !  Hardware Faults
  • 33. © 2017 – Erlang Solutions Ltd. CouchDB Distributed Robust document database Riak Distributed, partition tolerant and scalable database Disco Project 100% Map Reduce, 0% Java RabbitMQ High performance enterprise messaging MongooseIM Scalable XMPP instant messaging server based on ejabberd. Erlang: It’s Happening!
  • 34. © 2017 – Erlang Solutions Ltd. Elixir: It’s Happening!
  • 35. © 2017 – Erlang Solutions Ltd. Erlang: It’s Happening!
  • 36. © 2017 – Erlang Solutions Ltd. More Information Programming Erlang – Second Edition !  Software for a Concurrent World !  by Joe Armstrong Erlang Programming !  A Concurrent Approach to Software Development !  by Francesco Cesarini & Simon Thompson Designing for Scalability with Erlang/OTP !  Reliability and Scalability with OTP !  by Francesco Cesarini & Steve Vinoski
  • 37. © 2017 – Erlang Solutions Ltd. Online Resources Erlang Master Classes – University of Kent !  https://www.cs.kent.ac.uk/ErlangMasterClasses/ Erlang MOOC – Online Classes – Future Learn !  https://www.futurelearn.com/courses/functional-programming-erlang Adopting Non Mainstream Technologies !  http://bit.ly/AdoptingErlang !  http://bit.ly/LearningErlang Websites !  http://www.erlang.org !  https://elixir-lang.org !  https://erlangcentral.org
  • 38. Any Questions? Francesco Cesarini Founder, Technical Director @FrancescoC francesco@erlang-solutions.com Erlang & Elixir Factory Lite Bangalore, India November 17th 2017