Upcoming SlideShare
Loading in...5
×
 

Erlang - Because S**t Happens

on

  • 3,636 views

Erlang begins and ends with Fault Tolerance. ...

Erlang begins and ends with Fault Tolerance.
Fault Tolerance is - formally! - baked into the very genes of Erlang/OTP - something that ends up being amazingly useful when you are building any kind of system.  Remember, your clients (and co-workers!) will find new ways to break things, ways that you could never have imagined in your wildest dreams.

This, this is the reason to use Erlang. Once you get it, it completely changes the way you approach development, and you will find yourself writing "erlang" in whatever language you happen to be using  (Mind you, writing tail-recursive code in java is a recipe for disaster, but thats another story…)

In this talk, I'll get into this buddha-nature of Erlang/OTP, pointing out how the various features of the language tie together into one seamless Fault Tolerant whole.  It'll probably run 45 minutes or so, not counting questions…

Statistics

Views

Total Views
3,636
Views on SlideShare
3,523
Embed Views
113

Actions

Likes
1
Downloads
12
Comments
0

3 Embeds 113

https://twitter.com 109
http://instacurate.com 2
http://www.linkedin.com 2

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • An overall approach to Preparedness
  • The Buddha nature of erlang – Fault Tolerance
  • This is a story about unexpectedness.The only constant is change
  • We’ve all been confronted by this
  • Some of us have been confronted by this
  • And you always get asked this
  • There is only so much planning you can do. At some point, the 1000 year flood hits
  • The point being – shit happens, how are you going to deal with it?
  • Do more than one thing at a time
  • Know when something breaks
  • Know what broke
  • Don’t let it spread
  • Fix it
  • ‘save game’ so you can do-over
  • Butwe know this.
  • Lets take this one at a time
  • The Six Essential Characteristics of a Fault Tolerant System
  • Do more than one thing at a time
  • Do more than one thing at a time
  • Do more than one thing at a time
  • Do more than one thing at a time
  • Do more than one thing at a time
  • The Six Essential Characteristics of a Fault Tolerant System
  • Only one success case here
  • Fail fast and fail stop
  • Only one success case here
  • The Six Essential Characteristics of a Fault Tolerant System
  • The process tells everyone what happenedStack traces are your friend.Its Not Java!
  • Only one success case here
  • The Six Essential Characteristics of a Fault Tolerant System
  • Let it Crash
  • Do more than one thing at a time
  • Do more than one thing at a time
  • Do more than one thing at a time
  • Do more than one thing at a time
  • The Six Essential Characteristics of a Fault Tolerant System
  • Go get catfood
  • Let it Crash
  • The Six Essential Characteristics of a Fault Tolerant System
  • The back up bag
  • Processes are units of error encapsulation(and good for GC too!)
  • Fault Tolerance and SystemsThink of this FORMALLY
  • The bottom line – can your organization deal with the above issues?
  • The Six Essential Characteristics of a Fault Tolerant System
  • The Six Essential Characteristics of a Fault Tolerant System
  • The Six Essential Characteristics of a Fault Tolerant System
  • Loose Coupling, of course, gives us all these benefits
  • Loose Coupling, of course, gives us all these benefits
  • Builds trust  Trust in the stupidity of people, trust that things will fail, trust that you will be affected
  • Loose Coupling, of course, gives us all these benefits
  • The amount of brainpower we have is limited.Reduce complexity by being able to focus on specific / limited areas
  • Loose Coupling, of course, gives us all these benefits
  • Andrew!
  • Isn’t Performance an issue w/ Loose Coupling?
  • remember the bit about failure? well, why optimize if you're going to fail anyhow? yeah yeah, you might fail because you don't perform, but that is rarely the problem
  • Work / Elegant / Fast;yes, that mine craft plugin you built might gt a million signupsit won’tseriously – it doesn't register statistically
  • Fault detection and identification?
  • Monitoring!
  • DashboardsOtherwise, how do you know whats going on?
  • Out of band access Don’t rely on the system to always tell you whats happening
  • Be PolyglotEverything fails – even erlang. (noooo)
  • Loose Coupling, of course, gives us all these benefits
  • Loose Coupling, of course, gives us all these benefits
  • Don’t cross the streams!
  • Fault Tolerance and OrganizationsThink of this FORMALLY
  • People fall ill
  • AWS will go down
  • CFOs run off to brazil
  • Tail Risk (Things that can never happen)This deserves its own section(financial crisis)
  • The bottom line – can your organization deal with the above issues?
  • The Six Essential Characteristics of a Fault Tolerant Organization
  • Easy right?Things can happen in parallel?
  • you'd be surprised at how poorly this gets done micromanagement (supervision gone bad) chaining (good for AR/AP, bad for decision making) e.g. – memos that get passed around for approval
  • “Bob is ill”  Ahrens Fox!
  • "Bob was working on the financial projections. He has the flu, so won't be able to get to it for another week. And that means that we won't know what to buy for two weeks…”
  • (Ahrens Fox) "Bob was working on the financial projections. He has the flu, so won't be able to get to it for another week. And that means that we won't know what to buy for two weeks…”
  • The Six Essential Characteristics of a Fault Tolerant Organization
  • If bob is ill, will you survive
  • The Six Essential Characteristics of a Fault Tolerant Organization
  • Onboarding people is importantThis is not what it should feel like for Bob’s replacement
  • The Six Essential Characteristics of a Fault Tolerant Organization
  • Documentation, policies, corporate knowledge, corporate culture methods, access codes, Try to have work/knowledge distributed so that if/when you need to let someone go, things can continue till you get someone new!)
  • Ask yourself this. Over and over again…
  • Loose Coupling, of course, gives us all these benefits

Erlang - Because S**t Happens Erlang - Because S**t Happens Presentation Transcript

  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Erlang : Because S**t happensMahesh Paolini-Subramanya (@dieswaytoofast) V.P. R&D, Ubiquiti Networks
  • AGILITY
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Horror! The Horror!
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Dude! WTF?!?!
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Surely you Tested?
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Fault Tolerance From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens erlang…
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Processes! Parallel From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Processes! Parallel Independent From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Processes! Parallel Independent Asynchronous message passing From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Processes! Parallel Independent Asynchronous message passing No shared state From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Processes! Parallel Independent Asynchronous message passing No shared state Immutable data structures From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens ** exception error: no match of right hand side value {error,unhappy}
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens ** exception error: no match of right hand side value {error,unhappy}
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Processes! Let it crash From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Processes! Let it crash (all the co-operating ones , that is) From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Processes! Let it crash (all the co-operating ones , that is) Supervisors can restart them From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Processes! Let it crash (all the co-operating ones , that is) Supervisors can restart them (When necessary!) From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens mnesia ‘n stuff
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Fault Tolerant System
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf LOOSECOUPLING
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Loose Coupling
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Loose Coupling Breeds Trust
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Loose Coupling Breeds Trust Devotes Brainpower appropriately
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Loose Coupling Breeds Trust Devotes Brainpower appropriately Minimizes bugs
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Fault Tolerance 60 - 90% of all SW projects fail 10 – 25% of all SW projects get abandoned
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six - Systems Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six - Systems Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage M ONITORING
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Monitoring?
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Monitoring? Dashboards
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Monitoring? Dashboards Out of band systems
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Monitoring? Dashboards Out of band systems Polyglot safety
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six - Systems Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six - Systems Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage POLYGLOT PERSISTENCE
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens (The day it all changed) Friday, June 29th 2012
  • • People • Vendors • Fraud Fault Tolerance
  • The Business Beware the Black Swan
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Fault Tolerant Organization
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Concurrency The Big Six - Organizations
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Concurrency Error encapsulation Fault detection The Big Six - Organizations
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six Concurrency Fault detection Fault Identification Error Encapsulation From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six - Organizations Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Concurrency Error encapsulation Fault detection Fault identification Code upgrade The Big Six - Organizations
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens The Big Six - Organizations Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage From http://www.erlang.org/download/armstrong_thesis_2003.pdf
  • • Concurrency • Error encapsulation • Fault detection • Fault identification • Code upgrade • Stable Storage The Big Six - Organizations
  • Is It Safe?
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Concurrency Fault detection Fault Identification Error Encapsulation Code upgrade Stable Storage EVERYW HERE!!!
  • V 1.0 © Ubiquiti Networks, Inc. All Rights Reserved Erlang – because s**t happens Questions mahesh@dieswaytoofast.com @dieswaytoofast