Erlang FTW!

download Erlang FTW!

of 49

  • date post

    03-Jul-2015
  • Category

    Documents

  • view

    845
  • download

    1

Embed Size (px)

description

In the Brave New World of cloud computing, fault tolerance is king. Fault tolerance at all levels - the platform, how and where the data is stored, the services and APIs that are used, and even the ability to recover from bugs ("features"?) in the code. This emphasis has resulted in the growing use of actor programming over object-oriented programming, and in particular, the growing influence of Erlang wherever Reliability and Scalability are prized. This talk will explore the reason why Erlang is particularly suited for Cloud Applications and Services, and why it should be the basis for your App's infrastructure

Transcript of Erlang FTW!

  • 1. Erlang FTW!{ Mahesh Paolini-Subramanya (@dieswaytoofast)V.P. Ubiquiti NetworksJames Aimonetti (@jamesaimonetti)

2. Erlang Everywhere 3. Why Erlang? 4. HorizontalScalability 5. HorizontalScalability 6. Horizontal VerticalScalability 7. Horizontal VerticalScalability 8. Live!Hot Swapping 9. Live!Hot Swapping 10. Asynchronous Processing 11. Asynchronous Processing 12. Asynchronous Processing 13. Supervision 14. Live Debugging 15. Stack Traces 16. Predictability 17. Why Erlang? 18. 4x 10x less code 19. Faster to create4x 10x less code 20. Faster to create Easier to reason about4x 10x less code 21. Faster to create Easier to reason about Fewer bugs4x 10x less code 22. Faster to create Easier to reason about Fewer bugs Speedy refactoring4x 10x less code 23. vsScalability 24. Speed 25. Reliability 26. Concurrency by default Error encapsulation Fault detection Fault identification Code upgrade Stable StorageFrom http://www.erlang.org/download/armstrong_thesis_2003.pdfConcurrency Oriented 27. My Blue Heaven My Blue HeavenConcurrency HellConcurrency Oriented 28. My Blue Heaven My Blue Heaven Deep Problem s Concurrency HellDeep Problem sConcurrency Oriented 29. Cheap Actors 30. Shared vs shared-nothingOO vs Actors 31. Shared vs shared-nothing Inheritance vs BehaviorOO vs Actors 32. Shared vs shared-nothing Inheritance vs Behavior Sync vs AsyncOO vs Actors 33. Why Not Java? (Ruby/) 34. Why not assembler? 35. Trivial thread management (hint: none)Erlang Architecture 36. Trivial thread management (hint: none) Trivial monitoring / load-balancingErlang Architecture 37. Trivial thread management (hint: none) Trivial monitoring / load-balancing One process per sessionErlang Architecture 38. X = 1.Immutable Variables 39. X = 1. X = 2. Huh?Immutable Variables 40. X = 1. X = 2. X = X + 1. Huh?Immutable Variables 41. [ do_something_with(X) || X print_out( Hello Mr. , Name );greet( female, Name ) ->print_out( Greetings Mrs. , Name );greet( _, Name ) ->print_out( Wotcher , Name ). Functions From http://learnyousomeerlang.com/ 43. Module:code_change( OldVersion, OldState, Stuff ) ->NewState = whatever_you_need_to_do( OldVersion, OldState, Stuff ),{ ok, NewState }. vsMonkey Patching?Really?You sure?Functions 44. >.Bit Syntax 45. [ process_payload(Payload) || do_stuff( X ) end ),do_stuff( OnePerson ) -> change_the_world( OnePerson ).Processes 47. if ( X instanceof Integer ) { try {change_position( X ); } catch ( ArithmeticException a ) {// cant happen. ignore } catch ( PositionException p ) {// why would this happen? } catch ( Exception e ) {// The other code has this here } catch ( Throwable t ) {// Dunno why this was in the other code vs}} proc:spawn( fun( X ) -> change_position( X ) end ), Defensive Programming 48. mahesh#dieswaytoofast.com / @dieswaytoofast james#2600hz.com / @jamesaimonettiQuestions