Comparing Dynamic Supervision Strategies in Elixir 1.5 and 1.6

By on in Development, Elixir


Let’s say you’re managing complex process state in your Elixir application and you need a way to spin up and down new processes as your app runs. This requirement is known as dynamic supervision, the ability for a supervisor to add processes to its supervision tree at runtime.

This post will explain how to implement a process under dynamic supervision with Elixir 1.5, and discuss how Elixir 1.6’s new DynamicSupervisor is easier to configure and is more flexible.

Continue reading …

Razor: Hit the Ground Running With Your Next Phoenix Project

By on in Development, Elixir, Open Source

As the popularity of Elixir and Phoenix continues to grow, we find ourselves spinning up more and more Phoenix apps for our clients and side projects. At Carbon Five, we have a pretty good consensus on our favorite practices and tools. With each new app, we find ourselves repeating the same steps to bring in many of the same resources and processes.

We created Razor, an opinionated app generator, to save ourselves this time and trouble. Razor isn’t the only one out there, but it captures our common needs and preferences at Carbon Five pretty comprehensively. It also provides a great platform for discussion; we hope to watch Razor evolve as the Elixir ecosystem grows and we continue to learn.

Continue reading …

Elixir in the Trenches

By on in Development, Elixir

At Carbon Five, we’ve been getting excited about Elixir and Phoenix – with its promise of the productivity of Ruby and Rails without the performance penalty. We’ve used it for a few of our internal projects with great success, but we’re always wary of any new technology’s hype cycle. We wanted a bit more experience working with Elixir on a real project.

We recently had the opportunity to do so. The project was an iOS application that made heavy use of the device’s location services; users can share where they are and what they’re doing. We needed a backend for an API, and to keep all connected clients up-to-date. From the start, Phoenix and its channels seemed like a great fit. Today, we’d like to share some of what we learned.

Continue reading …

Rails, meet Phoenix: add Phoenix to your Rails ecosystem with session sharing

By on in Elixir, Microservices, Rails

You’ve resolved to build your company’s Next Big Thing in Phoenix and Elixir. That’s great! You’re facing a problem though – all user authentication and access concerns are performed on your Rails system, and the work to reimplement this in Phoenix is significant.

Fortunately for you, there is a great Phoenix plug to share session data between Rails and Phoenix. If you pull this off, you’ll be able to build your new API on your Phoenix app, all while letting Rails handle user authentication and session management. Let’s get started!

Continue reading …

Special Processes in OTP

By on in Development, Elixir

On a recent Elixir project, I needed to test some asynchronous behaviour. Doing so led me to learn about the basics of special processes in OTP.

Our project was using Phoenix Channels and had a need to keep track of all connected socket processes. We could have used the upcoming Phoenix presence feature, but we didn’t quite need all of its features. We settled on using a simple GenServer process that would monitor each connected socket.

Continue reading …

Elixir and Phoenix: The Future of Web APIs and Apps?

By on in Development, Elixir

Buzz has been building up around Elixir (and Phoenix) in the development community over the last year. We’re pretty excited about them too and want to share the reasons why they’ve piqued our interest and what we’ve learned so far.

We decided to kick the tires by rewriting one of our in-house web applications using Elixir and Phoenix so that we could answer the questions that are most front of mind:

  • How productive is the stack?
  • Are there any emergent benefits?
  • Are there any significant gotchas?
  • What are the performance characteristics?
  • What’s the community like?

Continue reading …

Introducing Wallaby – Concurrent Feature Tests for Elixir and Phoenix

By on in Elixir

Feature tests are one of the best ways to ensure reliability and consistency for web applications. But, as we’ve discussed previously feature tests can become a performance bottleneck for a large test suite.

With the fast approaching release of Ecto 2.0, Elixirists will be able to run feature tests for Phoenix applications concurrently. To take advantage of these performance benefits we wanted a testing tool that supported concurrent tests out of the box and provided a flexible api for querying and interacting with webpages.

Thats why we built Wallaby.

Continue reading …