Raw Syntax

The stuff programs are made of

Elixir From a Ruby Point of View

Permalink

There has been plenty already written about Elixir, but I'm not yet convinced it is a silver bullet. However, I do think it is a useful tool when used in conjuction with existing ruby applications. In particular it can be used when speed or scaling ability is of critical importance.

What follows are a few examples of where Elixir could be used in a pre-existing ruby codebase.

API

Given an existing application such as an API written in Ruby, an Elixir backend can be proxied in and used for certain routes where speed or scaling is critical. An easy way to get started would be to replace a simple read only Ruby endpoint with Elixir.

Over time the entire Ruby based API could be replaced entirely with Elixir.

Background Workers

It is arguable that Rails' strength lies in its easy use of gems and wrangling the web tier with relative ease. Background workers aren't necessarily a reason to pick Rails over another framework. In some codebases background workers are separated entirely from the web tier application code.

One way to try out Elixir is having background jobs that get queued in Ruby, but then get executed by Elixir based workers. In fact, Elixir has a sidekiq compatible worker library, which would allow each worker to be ported over to Elixir one by one, while existing Ruby workers peacefully coexist along side Elixir workers.

Slides

These two use cases allow for a trial of Elixir without having to build an entire application in it. I recently gave a talk on using Elixir from a Ruby point of view. The slides are below.

Elixir with Ruby

Comments