Alta disponibilidad con Erlang/Elixir - Norberto Ortigoza

Post on 11-May-2015

326 views 4 download

Tags:

description

Norberto Ortigoza es instructor para América Latina por parte de Big Nerd Ranch, la empresa de cursos para iOS más importante del mundo. Es Director de Desarrollo en Diverza y co-fundador del grupo Cocoaheads en el Distrito Federal dirigido a desarrolladores en OSX y iOS. También es instructor oficial de Rubymotion. Ha sido programador por más de 20 años, donde ha empleado Sistemas operativos y lenguajes como NeXT, OSX, Solaris, Windows, Smalltalk, Objective-C, C, Java, C#, Ruby, PHP, Python, Perl y en los últimos días Elixir y Go. Ha impartido cursos de desarrollo en India, USA, Colombia, Bélgica y México. Es Ingeniero en Computación por parte de la Facultad de Ingeniería de la UNAM. Tiene estudios de Maestría en Ciencias de la Computación por la UNAM. Diplomado en Procesos y Arquitectura de Software por parte del SEI - Carnegie Mellon University.

Transcript of Alta disponibilidad con Erlang/Elixir - Norberto Ortigoza

High Availability with Erlang/Elixir

Norberto Ortigoza @hiphoox

Availability: state of being possible to get or use

Server Server Server

Cluster

Server

App Server App Server App Server

Operating System

Process A Process B Process C

System

Micro service Micro Service Micro Service

Isolation

–Alan Kay on the Meaning of “Object-Oriented Programming”

“OOP to me means only messaging, local retention and protection and

hiding of state-process, and extreme late-binding of all things..”

Erlang has lightweight processes

Process

Erlang has messaging

Erlang has live code upgrade

An Operating System on its own

So, What do we do when we detect an error?

Let it crash!

How?

Detect and know why it crashed

Process A Process BMonitor

Process A Process BLink

Supervision Trees

Application

App

Supervisor

Worker Worker Worker

Application

App

Supervisor

Worker Worker Worker

Application

App

Supervisor

Worker Worker Worker

Client

App

Supervisor

Worker Worker Worker

Server

App

Supervisor

Worker Worker Worker

Server

App

Supervisor

Worker Worker Worker

BEAM

BEAM

Client Client Client Client

Client Client Client Client

262,144 process default limite, scales to

millions

Open Telecom Platform (OTP)

GenServer GenEvent Supervisor Application Agent Task Elixir

Fault tolerance implies scalability

To make things fault-tolerant we have to make sure they are

made from isolated components

If the components are isolated they can run in

parallel

Things that are isolated and can run in parallel

are scalable!

Elixir

defmodule Hello do IO.puts "Defining the function world"

def world do IO.puts "Hello World" end

IO.puts "Function world defined"end

Hello.world

References

• http://www.infoq.com/presentations/Building-Highly-Available-Systems-in-Erlang

• http://www.infoq.com/presentations/self-heal-scalable-system

• http://www.infoq.com/presentations/fault-tolerance-101-qcon-london

39