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

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

klausbreyer
Every programmer ships a CMS once. Here is mine! Hello World. My wife and I have blogged about every trip since our honeymoon 10 years a...
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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews