Skip to content

Instantly share code, notes, and snippets.

View colinbankier's full-sized avatar

Colin Bankier colinbankier

  • Brisbane, Australia
View GitHub Profile

#The Winds of Change

Here at Everyday Hero we’re a Ruby shop. We love Ruby. Ruby is great. We are however, starting to experiment with introducing other programming languages and technologies for our backend services into our repertoire. One of our new micro-services has been started in Elixir. In this post I’ll discuss our reasons for looking beyond Ruby at another programming language and technology.

Being a Ruby shop, nearly all our applications are written in Ruby - our oldest apps were started way back on Ruby 1.8 and Rails 1.0, and we now have a fleet of apps that keep up with the latest Ruby and Rails versions, as well as smaller services that use other frameworks like Sinatra or Napa. We have a long history (in Ruby terms) with this technology set. ###Why Ruby is Great I still remember the excitement I felt when I discovered Ruby (and Rails) in about 2006, and I’m pretty sure the reason Ruby gained such popularity is because so many developers felt the same thing. Ruby brought the joy back into prog

  • Deployment Pipeline (re-instate)
    • CI (shippable or semaphore) triggers pipeline on successful master build
      • Probably 'Go' - has misgivings but does the job for now
    • builds and pushes docker container artifact
    • deploy to staging
      • smoke test
      • acceptance test
    • Deploy to prod (auto-deploy can be optional e.g. supporter)
      • smoke test
  • Rollback on failure
  • Deployment Pipeline (re-instate)
    • CI (shippable or semaphore) triggers pipeline on successful master build
      • Probably 'Go' - has misgivings but does the job for now
    • builds and pushes docker container artifact
    • deploy to staging
      • smoke test
      • acceptance test
    • Deploy to prod (auto-deploy can be optional e.g. supporter)
      • smoke test
  • Rollback on failure

Brisbane Elixir elixir

July 23, 2015

General

Welcome newcomers!

Introducing Card Shark card shark

Last meetup Mark walked us through creating a RESTful database application in Phoenix, from scratch. We played with the HTML and JSON generators that ship with Phoenix to create a simple CRUD app. We want to keep building

Concurrency: the reason we're here

A bit of background

In Elixir, all code runs inside processes. Processes are isolated from each other, run concurrent to one another and communicate via message passing. Processes are not only the basis for concurrency in Elixir, but they also provide the means for building distributed and fault-tolerant programs.

Elixir’s processes should not be confused with operating system processes. Processes in Elixir are extremely lightweight in terms of memory and CPU (unlike threads in many other programming languages). Because of this, it is not uncommon to have tens or even hundreds of thousands of processes running simultaneously.

Processes

The most basic mechanism for creating processes is using the spawn/1 function:

Put a plug in it!

Plug

Elixir News

Latest release v1.2.2. 1.2.x brought us: Erlang 18 support

  • Faster compile times
  • Maps now support millions of keys efficiently - Dict/HashDict/Set/HashSet deprecated.
@colinbankier
colinbankier / index.erl
Created March 8, 2017 12:45
Indexing a file - Erlang
-module(index).
-export([get_index/1]).
% Used to read a file into a list of lines.
% Example files available in:
% gettysburg-address.txt (short)
% dickens-christmas.txt (long)
% Get the contents of a text file into a list of lines.
@colinbankier
colinbankier / frequency.erl
Created April 21, 2017 13:43
Frequency Server
%% Based on code from
%% Erlang Programming
%% Francecso Cesarini and Simon Thompson
%% O'Reilly, 2008
%% http://oreilly.com/catalog/9780596518189/
%% http://www.erlangprogramming.org/
%% (c) Francesco Cesarini and Simon Thompson
-module(frequency).
-export([start/0, init/0, allocate/0, deallocate/1]).