On Github shiroyasha / ruby_to_elixir
with some AWESOME people
a hosted CI service
often
we wrapped it into upstart scripts
hard to test
slow restarts
uses too much memory
if you want
you will have complicated upstart scripts
sidekiq can use up a lot of resources
Another issue
class Build < ActiveRecord::Base has_many :jobs end
build.jobs.map do |job| create_job_request(job) end
build.jobs.pmap do |job| create_job_request(job) end
it was time to change something
we need something that is
fun
fast
fault tolerant
has cheap threads
Erlang is an obvious choice
based on the
[1, 2, 3, 4, 5, 6] |> Enum.filter(&Integer.is_odd/1) |> Enum.map(&(&1 * &1))
@log_levels [ :info, :trace, :error, :warning ] @log_levels |> Enum.map fn level -> def unquote(level)(string) do IO.puts "[#{level}] #{message}" end end
defmodule Stack do def start_link do Agent.start_link fn -> [] end end def push(pid, item) do Agent.update pid, fn(stack) -> [item | stack] end end def pop(pid) do Agent.get_and_update pid, fn [item | last] -> {item, last} end end end
every new microservice
we used to measure response time
now we measure
the most awesome thing, ever
the basis of fault tolerance
replaced our upstart scripts
supervisors are easily testable
is trivial
Ruby projects can be Dockerized
but the images are gigantic
on the other hand
are a dream team
there are a few
pagination, metrics, logs...
you sometimes need to fork & improve
is static, weird, and sometimes feels broken
we want configuration via
If you have troubles with
replacement for your Ruby based services
also, try out
a.k.a Rails in the Elixir world
follow @igor_sarcevic & check out semaphoreci.com