I recently needed to deploy a side project written in Phoenix and Elixir. I went pretty far down the path with the free tiers on Gigalixir and Heroku before just doing everything myself on Digital Ocean for $5 per month. This is a brief recap of my experience. Gigalixir and Heroku were easy to use, but the requirements of my application — which I felt were relatively basic — disqualified me from their free tiers.

Gigalixir

If I end up deploying my project commercially (“for real”), I may return to Gigalixir, but the databases on the free tier do not support PostgreSQL extensions beyond citext. I’m using cube and earthdistance. I believe that using a paid Gigalixir database would have pushed me to $25-$35 per month.

The next cheapest option with Gigalixir would have been to bring my own database to the Gigalixir free tier. You could pay something like $10 per month for an Amazon RDS (or $8-$15 per month for a Google Cloud PostgreSQL database) and configure an app running on Gigalixir to use it without any charges directly from Gigalixir.

Heroku

After realizing Gigalixir wouldn’t work because of the Postgres extensions, I ran through a deploy on Heroku. On Gigalixir and Heroku, “running through a deploy” consists mostly of: creating an account on their platform, adjusting some configuration variables, running a command to set up a new remote branch via Git, pushing your repository, and watching build logs for at least several minutes hoping you don’t see an error. Elixir isn’t an officially supported language by Heroku, but there are community buildpacks for Elixir and Phoenix and I couldn’t tell a difference.

The cube and earthdistance extensions seemed to be compatible with Heroku, I didn’t realize that Heroku’s free tier wouldn’t work for me until I started seeding my database. My application performs a distance search for a user based on a given zip code and a radius in miles to search within. To implement this, I created a table with coordinates corresponding to the center of every zip code. My zip-code-to-coordinates table ends up being over 33,000 rows. In the Heroku free tier, only 10,000 rows are allowed. It looked like I’d have to bump to a $9 per month plan to deploy my project on Heroku with a “Hobby Basic” Heroku database, which would allow 10 million rows.

Digital Ocean

My cheapest option seemed to be setting everything up myself at $5 per month on Digital Ocean (I’ve documented that process here). In addition to taking more time, I’m missing some basic features provided by the Gigalixir dashboard, like some app health monitoring and convenient server log readouts. I’d probably have to implement something like Datadog to replicate the dashboards provided by Heroku and Gigalixir.

Conclusion

I probably wasted some time and effort by just assuming my application would qualify for the Gigalixir and Heroku free tiers. In particular, I should have noted the 10,000 row database and the PostgreSQL extension restriction — though Gigalixir doesn’t seem to make the PostgreSQL extension restriction prominent in their marketing site or documentation.

I went with setting everything up myself for $5 per month on a virtual Digital Ocean server, but my complete list of cheap options were to:

  1. pay somewhere between $8-$15 per month for an AWS or Google Cloud PostgreSQL database that I configured for use with Gigalixir on their free tier
  2. pay $9 per month for a Heroku Hobby Basic PostgreSQL database
  3. pay $5 per month to do everything myself on Digital Ocean
  4. pay ~$10 per month to do everything myself on AWS
  5. pay ~$25 per month to have Gigalixir set up a database for me on Google Cloud