Kubernetes (kidding) — Photo credit Jp Valery on Unsplash

Another way to deploy Elixir apps

There are A LOT of different ways to deploy Elixir/Phoenix applications. I want to fill a gap in the current literature: how do you deploy a Phoenix web app to a single Linux server optimizing for cost effectiveness, control, and simplicity, while using modern Elixir tools like releases to achieve zero-downtime deploys without hot code upgrading?

This setup is completely free, and when you have more traffic the cost of scaling…


Kubernetes (kidding) — Photo credit Jp Valery on Unsplash

Another way to deploy Elixir apps

UPDATE: This article now uses an all-Elixir deployment strategy, instead of the Nginx reverse proxy strategy it had originally.

There are A LOT of different ways to deploy Elixir/Phoenix applications. I want to fill a gap in the current literature: how do you deploy a Phoenix web app to a single Linux server optimizing for cost effectiveness, control, and simplicity, while using modern Elixir tools like releases to achieve zero-downtime deploys without hot code upgrading?


Photo by Florian Krumm on Unsplash

I want to share some thoughts and opinions about Elixir GenServers for developers writing web applications (probably with Phoenix).

This isn’t a technical deep dive on GenServers, it’s just some of my thoughts about them from writing web apps in Elixir / Phoenix over the last couple years.

There’s really just one type of GenServer that’s ever been a great fit for a problem I’m facing, and I come across the problem in almost every app I build: the need for recurring background tasks.

For example, in an app I worked on recently I needed to run a job every…


Are not as difficult as they seem

Photo by Jude Beck on Unsplash
Photo by Jude Beck on Unsplash
Photo by Jude Beck on Unsplash

When I’m working with a new Phoenix app (written in Elixir), I often come across the following situation. I happened to run into it last night on a side-project I’m building called Remind Me (which you should definitely check out, it’s free and it will help you stay on top of a whole class of to-do’s that often fall through the cracks), so I decided to write up my thoughts on the subject. Here’s the issue (with fake resource names for illustration):

  • I have a few associated resources in my database, like a…


I want to take some of the intimidation out of recursive functions.

The word “recursive” used to make my mind shut off the way that math terms in highschool did like “quadradic functions” or “polynomials”.

Any time I was reading something that involved recursion, I went looking somewhere else for an easier solution.

Now, I look at them as a tool that is sometimes easier to wrap my head around than digging into some of the reduce functions in the Enum module.

Ok so how can I convince you that recursive functions aren’t scary?

Let’s look at a normal function:


Cleaning up messy controller actions

Photo by Marcel Massa on Unsplash

I build a lot of apps with Phoenix, and I sometimes run into a problem where I need to pass a lot of variables from a controller down to the view / template.

When you only have one or two variables, here’s what the controller action looks like:

def index(conn, _params) do
users = Accounts.list_users()
render(conn, "index.html", users: users)
end

The relevant part is users: users in the render/3 function, which is a keyword list of of key/value pairs that will be available in the template. …


This is a continuation of Learning to Code the Easy Way (Part 1).

We ended by talking about a program that comes with your Mac called “Terminal”. It’s basically a little white box that pops up that you can write words in, and it does stuff on your computer like install programs and run code.

Developers use Terminal to connect to computers in remote locations, to install programming languages, and to run commands that start and stop programs. …


Photo by NESA by Makers on Unsplash

Learning to write software can be hard. One of the things that can be the most challenging for a beginner is the mounds of free information online, because most of it assumes that you already know a bunch of fundamentals and you get lost if you don’t. I will show you how to get from no coding experience at all to having a working website that can receive, store, and display information. We’re going to use a programming language called Elixir, and a website framework that uses Elixir called Phoenix.

Elixir is a beautiful programming language, and will allow you…


Photo by Chris Liverani on Unsplash

Today I discovered an awesome property of Elixir maps that let me reduce the time of a matching operation on large datasets from about 30+ minutes to less than a second.

I was working on a project to take about 10,000 “leads” records with basic info like First Name, Last Name, and Email and compare them to an existing set of about 10,000 “contacts” records with a more expansive data set, trying to find any “leads” that match a “contact” by email address. When a match is found, the “lead” is merged into the existing “contact”.

I’ll recreate the situation…


Learning to write software can be hard. One of the things that can be the most challenging for a beginner is the mounds of free information online, because most of it assumes that you already know a bunch of fundamentals and you get lost if you don’t. I will show you how to get from no coding experience at all to having a working website that can receive, store, and display information. We’re going to use a programming language called Elixir, and a website framework that uses Elixir called Phoenix.

Elixir is a beautiful programming language, and will allow you…

Damon Janis

Elixir dev building for the web with 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