Supabase as Backend

My team and I use Supabase across a few Bubble applications, where WU usage and performance (mostly due to groupings/joins, or a non-normalised DB) become a major issue.

A few thoughts:

  1. No need to fetch data using the API connector (unless, ofc, it’s needed to be that way). If RLS is set up correctly, fetching client-side is simpler and cheaper (no WUs for data fetching). For this, I’ve built this plugin that uses their JS SDK

  2. Never fetch full tables - always paginate
    Use limit + offset or keyset pagination (.gt(), .lt()) on indexed columns.

  3. Don’t expand foreign relations in the same query

  4. Select only the fields Bubble actually uses
    One of the main reasons I like SB is that you can specify columns you wish to return instead of the entire schema. That way, you can ensure your DB is normalised without needing workarounds typical in Bubble’s built-in DB

  5. Add proper indexes on Supabase
    If you filter by user_id, status, created_at, etc, create indexes on those columns.