SlideShare a Scribd company logo
 
 
Erlang + EDTK + BDB: Disrupting the Web Margo Seltzer Architect
What kind  of talk is this? Evangelism FUD Fun
Erlang  + EDTK + BDB: Huh? General purpose programming language Runtime system Developed by Ericsson Open source Key feature: designed for ease of developing highly-reliable, highly-concurrent systems Enables highly robust applications: The AXD 301 includes 2 million  lines of Erlang Reliability: NINE 9’s
Erlang +  EDTK  + BDB: Huh? Erlang Driver Toolkit Declarative APIs to external library Automatic wrapper generation Tracks library resources and cleans up Enhanced for BDB support: Supports Erlang’s “crash early” error-handling model (supervisors) Meshes Erlang-style concurrency with BDB concurrency (private thread pools) Adds significant convenience layers for configration and replication Minimal overhead
Erlang + EDTK +  BDB : Huh? Berkeley Database Database functionality … Transactions Recovery Replication …  in a different package Library linked directly into an application Programmatic APIs Schemaless: key/data pairs
Disruptive Technology “ a technological innovation, product, or service that eventually overturns the existing dominant technology or status quo product in the market.” -- Wikipedia
Outline Interpreting the Title Disecting an Internet Service Erlang, it’s philosophy and runtime Putting it all together Q&A
An Internet Service Clients Load  Balancer .NET Java The Internet App Servers Database Servers
An Internet Service Clients Load  Balancer .NET Java CGI PHP LISP Perl The Internet Database Servers
An Internet Service Clients Load  Balancer BDB CGI Perl Application Code The Internet Servers
The Software Architecture In any case, your software is a mess Gazillion Active Ports Fraction of a gazillion threads A relatively small number of disks
Outline Interpreting the Title Disecting an Internet Service Erlang, it’s philosophy and runtime Putting it all together Q&A
The Erlang Approach Don’t fight the problem Don’t fight the medium (the network) Don’t fight the medium (distributed software)
Don’t Fight the Problem 1:1 concurrency with the problem/solution domain Explicit lightweight stateful conversations (addressable processes) Arbitrarily rich messages
Don’t Fight the the Network Asynchronous send (location-agnostic send and pray) Ordered inbox per process Blocking receive with timeout (message-selection via pattern-matching)
Don’t Fight Distributed Software No shared memory: no mutexes, no mutation True loose-coupling: processes are free to migrate Safe to kill any process any time Recovery-oriented computing (before it was fashionable) Let it crash Propagate exceptions Know how to recover
Erlang Tricks: Processes Belong to the language (runtime), not OS Very lightweight Immutable data  Asynchronous message passing Upgrade application on live, running system Implication: No big deal if a process dies
Erlang Tricks: Links Links connect processes On process crash, all linked processes get message. Notified processes can clean up, takeover, do whatever is necessary. Easy to create supervisors No recovery: just crash, cleanup and restart
Erlang Tricks: Concurrency Use concurrency to structure the application “ My first message is that concurrency is best regarded as a program structuring principle” Tony Hoare, 2001 Concurrency-oriented programming Share nothing Pure message passing Let it crash
Erlang Nuts and Bolts Hello World -module(hello). -export(hello_world/0). hello_world() -> io:format(“Hello world.~n”, []). Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] Eshell V5.5.5  (abort with ^G) 1> c(hello). {ok,hello} 2> hello:hello_world(). Hello world. ok 3>
Spawning Processes Pid = spawn(module, function, args). For example: Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] Eshell V5.5.5  (abort with ^G) 1> spawn(hello, hello_world, []). <0.32.0>Hello world. 2>
Message send and receive Send: Pid ! message. Receive: receive Pattern1 [when Guard1] -> Expression1; Pattern2 [when Guard2] -> Expression2; … end
Send/Receive Example -module(food). -export([dinner/0]). dinner() -> receive sunday -> io:format(&quot;Sunday is fish.~n&quot;, []), dinner(); monday -> io:format(&quot;Monday is chicken.~n&quot;, []), dinner(); tuesday -> io:format(&quot;Tuesday is beef.~n&quot;, []), dinner(); Other -> io:format(&quot;Time to go home.~n&quot;, []) end.
Send/Receive Execution Eshell V5.5.5  (abort with ^G) 1> Pid = spawn(food, dinner, []). <0.32.0> 2> Pid ! tuesday. tuesdayTuesday is beef. 3> Pid ! sunday. sundaySunday is fish. 4> Pid ! wednesday. wednesdayTime to go home. 5> Pid ! monday. monday 6>
BDB in Erlang Erlang: Is Functional (not procedural) Communicates via messages Communicates asynchronously BDB: Is Procedural Communicates via shared memory Blocks on locks/IO/etc
EDTK fixes mismatch Erlang interfaces to outside world via ports. EDTK automatically generates code that wraps library API, making library look like Erlang process(es). Provides framework to: Clean up BDB resources after a crash Manage threadpools to deal with BDB blocking Manage administrative processes Manage replication groups
And the code looks like BDB DB = ?BDB:db_create(Port, []). ?BDB:db_open(Port, DB, void, “database”, “”, bdb_DB_BTREE, [bdb_DB_CREATE, 8#644). ?BDB:db_put(Port, DB, void “foo”, “foodata”, []). {Key, Data} = ?BDB:db_get(Port,  DB, void, “foo”, <<>>, []). ?BDB:db_close(Port, DB, []).
Outline Interpreting the Title Disecting an Internet Service Erlang, it’s philosophy and runtime Putting it all together Q&A
An Internet Service Clients Load  Balancer Servers The Internet
How does it Perform? From: http://www.sics.se/~joe/apachevsyaws.html
Acknowledgements Joe Armstrong (Erlang) Scott Lystig Fritchie (EDTK) Chris Newcombe (EDTK extensions for BDB)
A Q &
 

More Related Content

PDF
Intro to elixir and phoenix
Jared Smith
 
PPTX
Repeating History...On Purpose...with Elixir
Barry Jones
 
PPTX
The Actor Model - Towards Better Concurrency
Dror Bereznitsky
 
PPT
ApacheCon NA 2011 report
Koji Kawamura
 
PPTX
How to Write the Fastest JSON Parser/Writer in the World
Milo Yip
 
PDF
Elixir intro
Anton Mishchuk
 
PDF
Rethinking the debugger
Iulian Dragos
 
PDF
Process injection - Malware style
Sander Demeester
 
Intro to elixir and phoenix
Jared Smith
 
Repeating History...On Purpose...with Elixir
Barry Jones
 
The Actor Model - Towards Better Concurrency
Dror Bereznitsky
 
ApacheCon NA 2011 report
Koji Kawamura
 
How to Write the Fastest JSON Parser/Writer in the World
Milo Yip
 
Elixir intro
Anton Mishchuk
 
Rethinking the debugger
Iulian Dragos
 
Process injection - Malware style
Sander Demeester
 

What's hot (20)

PPTX
Steelcon 2014 - Process Injection with Python
infodox
 
PPTX
Building Your Own DSL with Xtext
GlobalLogic Ukraine
 
PDF
Stackato v6
Jonas Brømsø
 
PDF
Perl-Critic
Jonas Brømsø
 
PDF
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 
PDF
Practical Malware Analysis Ch13
Sam Bowne
 
PDF
Phoenix for Rubyists
Doug Goldie
 
PDF
Packers
Ange Albertini
 
PDF
Microservices are ‘easy’ dependencies are hard
Itiel Shwartz
 
PDF
Reactive Web 101: WebFlux, WebClient, and Reactor Netty
VMware Tanzu
 
PDF
Onion Architecture and the Blog
barryosull
 
PDF
CNIT 126 7: Analyzing Malicious Windows Programs
Sam Bowne
 
ODP
rsyslog meets docker
Rainer Gerhards
 
PDF
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Sam Bowne
 
PDF
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
enSilo
 
PDF
CNIT 126 12: Covert Malware Launching
Sam Bowne
 
PDF
Lock-free algorithms for Kotlin Coroutines
Roman Elizarov
 
PDF
Reactive applications with Akka.Net - DDD East Anglia 2015
Anthony Brown
 
PPTX
Scripting robot
Chonlasith Jucksriporn
 
PPTX
What's the "right" PHP Framework?
Barry Jones
 
Steelcon 2014 - Process Injection with Python
infodox
 
Building Your Own DSL with Xtext
GlobalLogic Ukraine
 
Stackato v6
Jonas Brømsø
 
Perl-Critic
Jonas Brømsø
 
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 
Practical Malware Analysis Ch13
Sam Bowne
 
Phoenix for Rubyists
Doug Goldie
 
Microservices are ‘easy’ dependencies are hard
Itiel Shwartz
 
Reactive Web 101: WebFlux, WebClient, and Reactor Netty
VMware Tanzu
 
Onion Architecture and the Blog
barryosull
 
CNIT 126 7: Analyzing Malicious Windows Programs
Sam Bowne
 
rsyslog meets docker
Rainer Gerhards
 
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Sam Bowne
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
enSilo
 
CNIT 126 12: Covert Malware Launching
Sam Bowne
 
Lock-free algorithms for Kotlin Coroutines
Roman Elizarov
 
Reactive applications with Akka.Net - DDD East Anglia 2015
Anthony Brown
 
Scripting robot
Chonlasith Jucksriporn
 
What's the "right" PHP Framework?
Barry Jones
 
Ad

Viewers also liked (9)

PDF
Sentencia TS Asturias EpC
Andalucia Liberal
 
PPT
Kynning 1.Stig 21.02
ingi
 
PPS
Escocia
nimiaazucena
 
PPT
香港六合彩让赚钱更容易
ksjcs
 
PPT
Kynning 1
ingi
 
PDF
AUTO_EPC1
Andalucia Liberal
 
PPT
Het Rijke Verleden Van Turkije Ppt[1]
Flopp1988
 
PPT
Web 2.0 for Educators
Fleep Tuque
 
PDF
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
Barry Feldman
 
Sentencia TS Asturias EpC
Andalucia Liberal
 
Kynning 1.Stig 21.02
ingi
 
Escocia
nimiaazucena
 
香港六合彩让赚钱更容易
ksjcs
 
Kynning 1
ingi
 
Het Rijke Verleden Van Turkije Ppt[1]
Flopp1988
 
Web 2.0 for Educators
Fleep Tuque
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
Barry Feldman
 
Ad

Similar to Disrupt (20)

PPT
Erlang OTP
Zvi Avraham
 
PDF
Why Erlang? - Bar Camp Atlanta 2008
boorad
 
PPT
Erlang For Five Nines
Barcamp Cork
 
PDF
FunctionalConf '16 Robert Virding Erlang Ecosystem
Robert Virding
 
PDF
Let it crash! The Erlang Approach to Building Reliable Services
Brian Troutwine
 
KEY
Osdc 2011 michael_neale
Michael Neale
 
PPT
The Erlang Programming Language
Dennis Byrne
 
ODP
An introduction to erlang
Mirko Bonadei
 
KEY
Erlang bootstrap course
Martin Logan
 
PDF
Introduction To Erlang Final
SinarShebl
 
PDF
Introduction to Erlang Part 2
Dmitry Zinoviev
 
PDF
Erlang factory SF 2011 "Erlang and the big switch in social games"
Paolo Negri
 
PDF
Erlang, the big switch in social games
Wooga
 
PDF
Programming Erlang Software for a Concurrent World Second Edition Joe Armstrong
gjurtqeqq771
 
PDF
Introduction To Distributed Erlang
David Dossot
 
PPTX
Erlang real time
Akshar Desai
 
PDF
Erlang Message Passing Concurrency, For The Win
l xf
 
PDF
Erlang from behing the trenches by Francesco Cesarini
Naresh Jain
 
PDF
Erlang
ESUG
 
PDF
Choosing the Erlang Ecosystem for Developing the Applications of the Future!
aronisstav
 
Erlang OTP
Zvi Avraham
 
Why Erlang? - Bar Camp Atlanta 2008
boorad
 
Erlang For Five Nines
Barcamp Cork
 
FunctionalConf '16 Robert Virding Erlang Ecosystem
Robert Virding
 
Let it crash! The Erlang Approach to Building Reliable Services
Brian Troutwine
 
Osdc 2011 michael_neale
Michael Neale
 
The Erlang Programming Language
Dennis Byrne
 
An introduction to erlang
Mirko Bonadei
 
Erlang bootstrap course
Martin Logan
 
Introduction To Erlang Final
SinarShebl
 
Introduction to Erlang Part 2
Dmitry Zinoviev
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Paolo Negri
 
Erlang, the big switch in social games
Wooga
 
Programming Erlang Software for a Concurrent World Second Edition Joe Armstrong
gjurtqeqq771
 
Introduction To Distributed Erlang
David Dossot
 
Erlang real time
Akshar Desai
 
Erlang Message Passing Concurrency, For The Win
l xf
 
Erlang from behing the trenches by Francesco Cesarini
Naresh Jain
 
Erlang
ESUG
 
Choosing the Erlang Ecosystem for Developing the Applications of the Future!
aronisstav
 

Recently uploaded (20)

PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 

Disrupt

  • 1.  
  • 2.  
  • 3. Erlang + EDTK + BDB: Disrupting the Web Margo Seltzer Architect
  • 4. What kind of talk is this? Evangelism FUD Fun
  • 5. Erlang + EDTK + BDB: Huh? General purpose programming language Runtime system Developed by Ericsson Open source Key feature: designed for ease of developing highly-reliable, highly-concurrent systems Enables highly robust applications: The AXD 301 includes 2 million lines of Erlang Reliability: NINE 9’s
  • 6. Erlang + EDTK + BDB: Huh? Erlang Driver Toolkit Declarative APIs to external library Automatic wrapper generation Tracks library resources and cleans up Enhanced for BDB support: Supports Erlang’s “crash early” error-handling model (supervisors) Meshes Erlang-style concurrency with BDB concurrency (private thread pools) Adds significant convenience layers for configration and replication Minimal overhead
  • 7. Erlang + EDTK + BDB : Huh? Berkeley Database Database functionality … Transactions Recovery Replication … in a different package Library linked directly into an application Programmatic APIs Schemaless: key/data pairs
  • 8. Disruptive Technology “ a technological innovation, product, or service that eventually overturns the existing dominant technology or status quo product in the market.” -- Wikipedia
  • 9. Outline Interpreting the Title Disecting an Internet Service Erlang, it’s philosophy and runtime Putting it all together Q&A
  • 10. An Internet Service Clients Load Balancer .NET Java The Internet App Servers Database Servers
  • 11. An Internet Service Clients Load Balancer .NET Java CGI PHP LISP Perl The Internet Database Servers
  • 12. An Internet Service Clients Load Balancer BDB CGI Perl Application Code The Internet Servers
  • 13. The Software Architecture In any case, your software is a mess Gazillion Active Ports Fraction of a gazillion threads A relatively small number of disks
  • 14. Outline Interpreting the Title Disecting an Internet Service Erlang, it’s philosophy and runtime Putting it all together Q&A
  • 15. The Erlang Approach Don’t fight the problem Don’t fight the medium (the network) Don’t fight the medium (distributed software)
  • 16. Don’t Fight the Problem 1:1 concurrency with the problem/solution domain Explicit lightweight stateful conversations (addressable processes) Arbitrarily rich messages
  • 17. Don’t Fight the the Network Asynchronous send (location-agnostic send and pray) Ordered inbox per process Blocking receive with timeout (message-selection via pattern-matching)
  • 18. Don’t Fight Distributed Software No shared memory: no mutexes, no mutation True loose-coupling: processes are free to migrate Safe to kill any process any time Recovery-oriented computing (before it was fashionable) Let it crash Propagate exceptions Know how to recover
  • 19. Erlang Tricks: Processes Belong to the language (runtime), not OS Very lightweight Immutable data Asynchronous message passing Upgrade application on live, running system Implication: No big deal if a process dies
  • 20. Erlang Tricks: Links Links connect processes On process crash, all linked processes get message. Notified processes can clean up, takeover, do whatever is necessary. Easy to create supervisors No recovery: just crash, cleanup and restart
  • 21. Erlang Tricks: Concurrency Use concurrency to structure the application “ My first message is that concurrency is best regarded as a program structuring principle” Tony Hoare, 2001 Concurrency-oriented programming Share nothing Pure message passing Let it crash
  • 22. Erlang Nuts and Bolts Hello World -module(hello). -export(hello_world/0). hello_world() -> io:format(“Hello world.~n”, []). Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> c(hello). {ok,hello} 2> hello:hello_world(). Hello world. ok 3>
  • 23. Spawning Processes Pid = spawn(module, function, args). For example: Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> spawn(hello, hello_world, []). <0.32.0>Hello world. 2>
  • 24. Message send and receive Send: Pid ! message. Receive: receive Pattern1 [when Guard1] -> Expression1; Pattern2 [when Guard2] -> Expression2; … end
  • 25. Send/Receive Example -module(food). -export([dinner/0]). dinner() -> receive sunday -> io:format(&quot;Sunday is fish.~n&quot;, []), dinner(); monday -> io:format(&quot;Monday is chicken.~n&quot;, []), dinner(); tuesday -> io:format(&quot;Tuesday is beef.~n&quot;, []), dinner(); Other -> io:format(&quot;Time to go home.~n&quot;, []) end.
  • 26. Send/Receive Execution Eshell V5.5.5 (abort with ^G) 1> Pid = spawn(food, dinner, []). <0.32.0> 2> Pid ! tuesday. tuesdayTuesday is beef. 3> Pid ! sunday. sundaySunday is fish. 4> Pid ! wednesday. wednesdayTime to go home. 5> Pid ! monday. monday 6>
  • 27. BDB in Erlang Erlang: Is Functional (not procedural) Communicates via messages Communicates asynchronously BDB: Is Procedural Communicates via shared memory Blocks on locks/IO/etc
  • 28. EDTK fixes mismatch Erlang interfaces to outside world via ports. EDTK automatically generates code that wraps library API, making library look like Erlang process(es). Provides framework to: Clean up BDB resources after a crash Manage threadpools to deal with BDB blocking Manage administrative processes Manage replication groups
  • 29. And the code looks like BDB DB = ?BDB:db_create(Port, []). ?BDB:db_open(Port, DB, void, “database”, “”, bdb_DB_BTREE, [bdb_DB_CREATE, 8#644). ?BDB:db_put(Port, DB, void “foo”, “foodata”, []). {Key, Data} = ?BDB:db_get(Port, DB, void, “foo”, <<>>, []). ?BDB:db_close(Port, DB, []).
  • 30. Outline Interpreting the Title Disecting an Internet Service Erlang, it’s philosophy and runtime Putting it all together Q&A
  • 31. An Internet Service Clients Load Balancer Servers The Internet
  • 32. How does it Perform? From: http://www.sics.se/~joe/apachevsyaws.html
  • 33. Acknowledgements Joe Armstrong (Erlang) Scott Lystig Fritchie (EDTK) Chris Newcombe (EDTK extensions for BDB)
  • 34. A Q &
  • 35.