Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Let it Crash! 
The Erlang Approach 
to Building Reliable 
Services
Hi, folks.
This talk is not about convincing 
Facebook to pay you 19$ billion.
This is a talk about doing good, 
careful work…
…on systems that might kill 
people or ruin companies, 
which is totally rad.
many 
processors
in a network
inside an even 
bigger network
and none of it’s 
reliable
and also it’s 
spread across 
the globe
Sometimes we don’t care 
to make the illusion of 
whole-system reliability.
Sometimes we do.
In this talk, we do.
Erlang
A handful simple pieces.
An old-fashioned, explicit 
functional language.
All data is immutable, 
without exception.
Processes are the smallest 
unit of control flow.
Processes are sequential 
internally.
Processes are concurrent 
to one another.
Processes can 
communicate only 
through message 
passing.
Messages are copied 
between processes.
Processes can “link” and 
receive messages about 
linked pair deaths.
This is called 
“trapping exits”.
OR
Processes can “link” and 
die when linked pairs die.
This is the 
default 
behaviour.
That’s basically it.
The implications are 
really fun.
Supervision
Well known process traps exits, 
restart other processes that fail.
The failed process is restarted 
from a static specification.
The failed process state 
is not preserved.
The failed process state 
is not preserved. 
(intentionally)
Registered 
Names
These are decoupled 
from the underlying 
process.
You can change processes 
without consumers getting 
wise to it.
Protocols
You can’t manipulate another 
process’ state.
You have to convince 
it to change itself.
Network 
Transparency
Network 
Transparency 
(kinda)
Messages may be addressed 
to explicit pid, process name. 
Node may be specified, too.
Erlang hides the network 
details, leaving just the 
abstraction.
Hot Code 
Reloading
Code updates can be 
inserted at runtime.
New functions and new 
processes get inserted 
under old names.
Tricky without VM support.
This is all driving to one end:
Fault 
Tolerance
Everything in Erlang (and 
everything not) is in the 
service of building fault-tolerant 
systems.
The short-hand for this is:
Let it crash!
Faulty subsystems are 
difficult to correct.
Don’t bother. 
Just restart.
What’s unique 
to Erlang?
VM support for 
swapping function 
implementations.
Cheap processes.
Cheap processes. 
(309 words of memory)
Strict process isolation.
It’s all small 
stuff really.
What can you 
do now?
Short of using Erlang, that is…
Immutable 
Data
This means 
embracing 
copying.
Rub some 
Queue on it.
Queue 
+ Async Execution 
= Erlang Process
Structure your 
system as 
loosely coupled 
sub-systems.
Sub-systems communicate 
through a well-known 
protocol.
They may be co-resident 
in memory or across 
machine boundaries.
Decoupling brings 
many secondary 
advantages.
Isolate.
Don’t manipulate 
memory that 
isn’t yours.
Critical components get 
their own machines.
Plan for 
failure.
If sub-system A depends 
on B and B fails, what 
does A need to do?
“Hey, who knew 
that system C 
relied on B too?”
Supervise.
Negotiate the restarts 
of failed sub-systems 
into well-known states.
Erlang implements all of 
this for you, but there’s 
nothing special about it.
Anything else?
Understand the 
Network.
0. The network is reliable. 
1. Latency is zero. 
2. Bandwidth is infinite. 
3. The network is secure. 
4. Topology doesn’...
P.S.
This is how the 
Internet works.
This is how hard 
real-time systems 
work.
This is how 
multi-processors 
work.
There’s decades 
of material to 
learn from.
Thanks! 
<3 
@bltroutwine
Nächste SlideShare
Wird geladen in …5
×

Let it crash! The Erlang Approach to Building Reliable Services

4.911 Aufrufe

Veröffentlicht am

In this talk, using the Erlang hacker's semi-official motto "Let it Crash!" as a lens, I'll speak to how radical simplicity of implementation, straight-forward runtime characteristics and discoverability of the running system lead to computer systems which have great success in networked, always-on deployments.

I will argue that while Erlang natively implements many features which aid the construction of such systems--functional programming language semantics, lack of global mutable state, first-class networking, for instance--these characteristics can be replicated in any computer system, as a part of initial design of new systems or the gradual evolution of an existing project. I'll discuss common design patterns and anti-patterns, using my own work at AdRoll and project experience reports from a variety of fields--both successes and failures--to advance my argument.

This will be a very practical talk and will be accessible to engineers of all backgrounds.

Veröffentlicht in: Ingenieurwesen, Software, Technologie
  • Phil Stanley, former director and manager of national record label Polydor Records says "You correctly named your new system "Demolisher" because that's exactly what it does: It demolishes the sportsbooks!" ◆◆◆ http://t.cn/A6zP24pL
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • I love you Ben you’ve literally saved my life! Lets just say I was in a lot of trouble financially until I found you.Now I’m in complete AWE every time I open my betting account it’s like the numbers aren’t real, that’s why I’m constantly withdrawing the cash lol.God bless you Ben! and thank you so much for allowing me access to this amazing service.  http://t.cn/A6vAMkWt
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • There is a REAL system that is helping thousands of people, just like you, earn REAL money right from the comfort of their own homes. The entire system is made up with PROVEN ways for regular people just like you to get started making money online... the RIGHT way... the REAL way. ●●● http://t.cn/AisJWUCf
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • Get paid to post comments on Facebook - $25 per hour ▲▲▲ http://t.cn/AieX6y8B
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier

Let it crash! The Erlang Approach to Building Reliable Services

  1. 1. Let it Crash! The Erlang Approach to Building Reliable Services
  2. 2. Hi, folks.
  3. 3. This talk is not about convincing Facebook to pay you 19$ billion.
  4. 4. This is a talk about doing good, careful work…
  5. 5. …on systems that might kill people or ruin companies, which is totally rad.
  6. 6. many processors
  7. 7. in a network
  8. 8. inside an even bigger network
  9. 9. and none of it’s reliable
  10. 10. and also it’s spread across the globe
  11. 11. Sometimes we don’t care to make the illusion of whole-system reliability.
  12. 12. Sometimes we do.
  13. 13. In this talk, we do.
  14. 14. Erlang
  15. 15. A handful simple pieces.
  16. 16. An old-fashioned, explicit functional language.
  17. 17. All data is immutable, without exception.
  18. 18. Processes are the smallest unit of control flow.
  19. 19. Processes are sequential internally.
  20. 20. Processes are concurrent to one another.
  21. 21. Processes can communicate only through message passing.
  22. 22. Messages are copied between processes.
  23. 23. Processes can “link” and receive messages about linked pair deaths.
  24. 24. This is called “trapping exits”.
  25. 25. OR
  26. 26. Processes can “link” and die when linked pairs die.
  27. 27. This is the default behaviour.
  28. 28. That’s basically it.
  29. 29. The implications are really fun.
  30. 30. Supervision
  31. 31. Well known process traps exits, restart other processes that fail.
  32. 32. The failed process is restarted from a static specification.
  33. 33. The failed process state is not preserved.
  34. 34. The failed process state is not preserved. (intentionally)
  35. 35. Registered Names
  36. 36. These are decoupled from the underlying process.
  37. 37. You can change processes without consumers getting wise to it.
  38. 38. Protocols
  39. 39. You can’t manipulate another process’ state.
  40. 40. You have to convince it to change itself.
  41. 41. Network Transparency
  42. 42. Network Transparency (kinda)
  43. 43. Messages may be addressed to explicit pid, process name. Node may be specified, too.
  44. 44. Erlang hides the network details, leaving just the abstraction.
  45. 45. Hot Code Reloading
  46. 46. Code updates can be inserted at runtime.
  47. 47. New functions and new processes get inserted under old names.
  48. 48. Tricky without VM support.
  49. 49. This is all driving to one end:
  50. 50. Fault Tolerance
  51. 51. Everything in Erlang (and everything not) is in the service of building fault-tolerant systems.
  52. 52. The short-hand for this is:
  53. 53. Let it crash!
  54. 54. Faulty subsystems are difficult to correct.
  55. 55. Don’t bother. Just restart.
  56. 56. What’s unique to Erlang?
  57. 57. VM support for swapping function implementations.
  58. 58. Cheap processes.
  59. 59. Cheap processes. (309 words of memory)
  60. 60. Strict process isolation.
  61. 61. It’s all small stuff really.
  62. 62. What can you do now?
  63. 63. Short of using Erlang, that is…
  64. 64. Immutable Data
  65. 65. This means embracing copying.
  66. 66. Rub some Queue on it.
  67. 67. Queue + Async Execution = Erlang Process
  68. 68. Structure your system as loosely coupled sub-systems.
  69. 69. Sub-systems communicate through a well-known protocol.
  70. 70. They may be co-resident in memory or across machine boundaries.
  71. 71. Decoupling brings many secondary advantages.
  72. 72. Isolate.
  73. 73. Don’t manipulate memory that isn’t yours.
  74. 74. Critical components get their own machines.
  75. 75. Plan for failure.
  76. 76. If sub-system A depends on B and B fails, what does A need to do?
  77. 77. “Hey, who knew that system C relied on B too?”
  78. 78. Supervise.
  79. 79. Negotiate the restarts of failed sub-systems into well-known states.
  80. 80. Erlang implements all of this for you, but there’s nothing special about it.
  81. 81. Anything else?
  82. 82. Understand the Network.
  83. 83. 0. The network is reliable. 1. Latency is zero. 2. Bandwidth is infinite. 3. The network is secure. 4. Topology doesn’t change. 5. There is one administrator. 6. Transport cost is zero. 7. The network is homogenous.
  84. 84. P.S.
  85. 85. This is how the Internet works.
  86. 86. This is how hard real-time systems work.
  87. 87. This is how multi-processors work.
  88. 88. There’s decades of material to learn from.
  89. 89. Thanks! <3 @bltroutwine

×