Alta disponibilidad con Erlang/Elixir - Norberto Ortigoza
-
Upload
software-guru -
Category
Software
-
view
326 -
download
4
description
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