cloutiy

cloutiy

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 .

Showing Posts 1 to 10

ruslandoga

ruslandoga

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.

cloutiy

cloutiy OP

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

ruslandoga

ruslandoga

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
adrianbarbic

adrianbarbic

They actually discussed in this podcast the other day (https://thinkingelixir.com/podcast-episodes/073-elixir-at-supabase-with-paul-copplestone/) 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: Thinking Elixir Podcast

Sebb

Sebb

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.

tadasajon

tadasajon

It seems to me like Supabase might be worth using from Phoenix just because it provides an authentication system Auth | Supabase Docs

cpgo

cpgo

So, pg replication can be used like notify/listen?

krasenyp

krasenyp

It’s better because LISTEN/NOTIFY messages have a size limit. Of course, you can chunk messages, attach an identifier to each chunk, buffer and reassemble them in your application.

chasers

chasers

What @ruslandoga said is the answer.

I’m using Cainophile to listen to the Postgres wal and bust caches, as an example. It’s awesome. Today you’d probably want to use Postgrex.Replication and then decode the messages with Cainophile.

Almost everything that Supabase is doing you can do with just Postgres. Although, as of last week realtime supports row level security. walrus is what does that. But yeah even though realtime is powered by Elixir and Phoenix the dev story for Elixir folks is not there.

They are definitely targeting front-end devs who typically don’t have the ability to easily connect directly to the database. So instead of writing your API in Node you just spin up a Supabase instance and automatically have an API generated for you based on your Postgres schema. Auth is another difficult thing for most people so providing an easy solution for people is important for adoption (it’s one of the reasons Firebase became so popular).

Yeah you wouldn’t want to use the HTTP interface they expose to access Postgres when we have direct connections.

There is I think a max of 10 replication slots for Postgres so if you have a larger cluster it might make sense to use Supabase to listen to the wal over Pubsub.

It’s fully open source too so if you do want to play with it you can spin it up yourself.

Yep!!

cpursley

cpursley

@chasers, it looks like logflare.app is joining forces with Supabase (according to their blog)?

I’ve actually extracted out the WAL listening stuff from Supabase Realtime (which is based on Cainophile) into a package: GitHub - agoodway/walex: Postgres change events (CDC) in Elixir [WAL] · GitHub

I’ve been using this along with Hasura (Supabase wasn’t around when I started) so that I can handle business logic right in Elixir. The main differences are that I’ve added a supervisor to process Events and I’m casting to Elixir types instead of Json.

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
mnkhod
So i have been using ash framework for a while and i love it. However currently the issue im having with ash framework is the error handl...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews