Can Supabase be the backend for Phoenix LiveView

Hello, https://supabase.com is a big success in the Javascript world as a Firebase alternative. For whatever reasons, Supabase is completely focused with integrations with JS frameworks.
What caught my attention is the global CDN nature of Supabase hosting. Though, we can do a single click deploy of phoenix applications on https://fly.io, database hosting is still an issue. Though, Fly supports for easy deployment of Postgres, it is not managed hosting. Database backups, recovery etc. are our headache.
Considering all this scenarios, is Supabase a good alternative for database operations in our LiveView application? Ofcourse, Supabase provides even File Storage as well - which Fly does not give.
So, Fly Hosting for Phoenix Application - Supabase for Database and File Storage - can it be a good stack for production apps?
I had this doubt for sometime - but - zoedsoupe/supabase: A complete Toolkit to interact with Supabase APIs from Elixir (github.com) - triggered those thoughts again.
I request you to offer your views- pros and cons.

2 Likes

Doesnt supabase expose a postgres interface you can talk to from the server directly?

2 Likes

Yes, the standard Ecto Postgres support should work as Superbase provides a Postgres interface, meaning anything that talks to Postgres can talk to Superbase.

2 Likes

that’s a good question tough! i mean, i started supabase-potion because i would like to use the storage and go true services exactly on phoenix/live view.

that said, the library aims to provide a good interface for supabase APIs, so in my opinion, as others already said, you can connect directly to the database on supabase and use ecto!

i’m thinking if it would make sense to provide a postgrest interface, you can also check the discussion in this thread: Would it be possible to implement an Ecto adapter for PostgREST?

but supabase in general fits greatly with phoenix, specially if you want file storage and if you don’t need/don’t want to handle server authentication in your side!

3 Likes