ELIXIR Tolerância a Falhas para Adultos @akitaonrails
ELIXIR Tolerância a Falhas para Adultos @akitaonrails
@akitaonrails
FIM DA LEI DE MOORE
THREADS! (NÃO USE)
THREADS! (NÃO USE)
EVENTOS! (NÃO USE)
EVENTOS! (NÃO USE)
BAIXA LATÊNCIA
CO-ROTINAS (SUBROTINAS, FIBRAS)
CASOS REAIS
“Since cut-over of the fj rst nodes in British Telecom's network in January 2002 only one minor fault has occurred, resulting in 99.9999999% availability .” “The network performance has been so reliable that there is almost a risk that our fj eld engineers do not learn maintenance skills.” Bernt Nilsson - director of Ericsson’s Next Generation Systems program
BÁSICO …
PEER-TO-PEER NETWORKING
[a, b, c] = [a, 2, 3] {:ok, message} = {:ok, “world"} {:ok, [hello: message]} = {:ok, [hello: “world”]} [hello: message, world: message2] #=> [{:hello, message}, {:world, message2}]
[a, b, c] = [a, 2, 3] {:ok, message} = {:ok, “world"} {:ok, [hello: message]} = {:ok, [hello: “world”]} [hello: message, world: message2] #=> [{:hello, message}, {:world, message2}]
[a, b, c] = [a, 2, 3] {:ok, message} = {:ok, “world"} {:ok, [hello: message]} = {:ok, [hello: “world”]} [hello: message, world: message2] #=> [{:hello, message}, {:world, message2}]
[a, b, c] = [a, 2, 3] {:ok, message} = {:ok, “world"} {:ok, [hello: message]} = {:ok, [hello: “world”]} [hello: message, world: message2] #=> [{:hello, message}, {:world, message2}]
PATTERN MATCHING
CALL BY PATTERN
Spawn, Send, Receive
"PID" (Process ID)
PROCESSOS (GREEN THREADS)
List/Kill
ASYNCHRONOUS EXCEPTIONS
ASYNCHRONOUS EXCEPTIONS
Link, Flag
ACTORS!
GenServer
[h, t] = [1, 2, 3] #=> h = 1, t = [2,3] Process.list |> Enum.reverse #=> Enum.reverse(Process.list())
[h, t] = [1, 2, 3] #=> h = 1, t = [2,3] Process.list |> Enum.reverse #=> Enum.reverse(Process.list())
SUPERVISOR TREE (supervisor - supervisees/workers)
OTP (Open Telecom Platform)
MICRO “YOCTO” SERVICES (Micro > Nano > Pico > Femto > Atto > Zepto > Yocto)
MICRO “YOCTO” SERVICES (Micro > Nano > Pico > Femto > Atto > Zepto > Yocto)
MICRO “YOCTO” SERVICES (Micro > Nano > Pico > Femto > Atto > Zepto > Yocto)
• Keywords, Maps, Comprehensions
• Keywords, Maps, Comprehensions • Documentação testável/executável
• Keywords, Maps, Comprehensions • Documentação testável/executável • TypeSpecs, Behaviors
• Keywords, Maps, Comprehensions • Documentação testável/executável • TypeSpecs, Behaviors • Agents, Tasks, GenEvent
• Keywords, Maps, Comprehensions • Documentação testável/executável • TypeSpecs, Behaviors • Agents, Tasks, GenEvent • Macros, Sigils
• Keywords, Maps, Comprehensions • Documentação testável/executável • TypeSpecs, Behaviors • Agents, Tasks, GenEvent • Macros, Sigils • Armazenamento: ETS, DETS, Mnesia
shared mutable global state Javascript - Blocking Event Loop Low Level Rust - Async in progress No coroutines goroutines sem ID Suture Go shared mutable state (OTP Clone) static signatures Akka shared mutable state Scala (OTP Clone) static signatures Almost Erlang-like Process Clojure Pulsar / Quasar JVM limitations
“quase” …
Erlang: PRONTO! (30 anos)
APRENDENDO
Recommend
More recommend