I’ve been working with Ecto for a little bit now and I keep finding that it can be really helpful to make my queries composable. By that, I mean creating functions that take in a query and return a query so that I can pipe multiple of these query functions together.

Recently, I ran into an issue that I hadn’t seen before and took me some time to get through. The issue was having multiple parts of my query join to different tables (or even join through the same table!). …


How to forward traffic to a dynamic target destination

We are creating Docker containers for students to run a Jupyter Notebook and then embedding that notebook on Learn.co in an iframe. Because Learn.co is using SSL, the connection with the Jupyter Notebook must use SSL as well otherwise…


How to be sure tasks are executing once (and only once) across multiple servers

A Problem

So before I go into database locking (what is it?) and implementing it, I want to first start off with a problem and how I came to learn about this myself.

We have an app that is in charge of sending out invoices when a set of criteria are met (X days before some date…). There is a task we developed that checks daily for pending invoices that need to be sent. The issue we found was that when we ran this process in production, we risked billing customers multiple times because we have multiple production servers running this task…


A cross-post collaboration with Elixir School

This blog post was originally published on Elixir School as a lesson on Plug. I added the section on Plug.ErrorHandler and Sophie DeBenedetto brought the lesson up to date to use Cowboy2 protocol. This lesson is, of course, a collaboration with many other open source contributors over at Elixir School. Please check out the source of the lesson for the full list of contributors, and feel free to put in a pull request to help us keep improving Elixir School for others! And without further interruption, on to the lesson…

If you’re familiar with Ruby, you can think of Plug…


Understanding code reuse in Elixir

I’ve been working mostly with Ruby and Rails since I started web development a few years ago and it’s been great, but I keep hearing about Elixir and Phoenix and how fantastic they are. I am finally getting the chance to dip my toe in, and I’ve found a couple of things to be a bit confusing right from the start. If you’ve been working in the Ruby/Rails land, you may have gotten tripped up understanding import, use, quote do as well. …

Avi Turkewitz

Former student and Software Engineer @ The Flatiron School. Learning Ruby / Rails / JS / Elixir / Phoenix

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store