Phoenix + Supabase

Hello,

I’m wondering if anyone has made a project using supabase.io for the database layer.

Supabase is a backend as a service which provides storage, user management, authentication and more.

I recall it’s built with Elixir, or at least some pieces of it.

However oddly enough looking at the examples page and available client APIs, Elixir doesn’t seem to be on the list .

1 Like

I think it’s targeted at frontend devs as a replacement for some of backend functionality, hence the firebase mention.

You can utilise the same tech-stack in your phoenix app as the supabase server, I think there were some recent commits that make it possible to subscribe for logical replication using postgrex.

What i’d like to do is use supabase as my database.

It seems a bit roundabout to use supabase from an Elixir application, but you can issue requests to postgrest with http and listen to supabase realtime notifications with a phx channel client.

Basically you’d do

elixir -http-> postgrest -sql-> postgres -wal-> supabase/realtime -phx-> elixir

instead of

elixir -sql-> postgres -wal-> elixir

They actually discussed in this podcast the other day (#073 Elixir at Supabase with Paul Copplestone - Thinking Elixir) about not having example for elixir. But as mentioned here, since you already use elixir/phoenix you get a similar offering, where as, their main market is frontend (ie. react) so competing against Firebase.

Also, thinking elixir does some great podcasts: Podcast - Thinking Elixir

1 Like

They could have digged a little deeper there in the podcast.
As I understand it, it may still be valuable to use supabase from Elixir because you get easy and robust multi tenancy. On the other hand it may not be be worth it because supabase has to charge you for all the great features that are only interesting for Jamstackers. Supabase is (obviously) more expensive than a postgres instance on AWS for example.