u/mattbrown7531

Supabase + Python backend: call Python directly or through Edge Functions?

Want to get some perspective on using a Python (FastAPI, Flask, etc) backend with Supabase.

I'm comparing two options:

Option 1: Python backend only:

Frontend -> FastAPI -> Supabase

Pros:

  • Python ecosystem
  • No Supabase runtime constraints (400s, 256mb memory, etc.)
  • Single backend deployment

Cons:

  • Verify Supabase JWT in Python
  • Frontend talks to separate API instead of Supabase Edge Functions

Option 2: Edge Function as a gateway to Python:

Frontend -> Supabase Edge Function -> Python -> Supabase

Pros:

  • Supabase Edge Functions are the public API layer
  • Built-in JWT verification
  • Python ecosystem

Cons:

  • Multiple deployments
  • Additional network hop
  • Edge Function still has runtime limits for the gateway request
  • Distributed debugging / observability. Errors, logs, and tracing now span two runtimes.

I'm leaning towards not calling Python from an Edge Function. It seems cleaner to use Edge Functions until they become insufficient, then add separate Python services to handle relevant workflows.

Curious about others experience using a Python backend with Supabase. Has anyone adopted Edge Functions as the gateway layer, and if so, what benefits did it provide?

reddit.com
u/mattbrown7531 — 4 days ago

How I Got VS Code Breakpoints Working with Supabase Edge Functions

I couldn't find a good guide for debugging Supabase Edge Functions directly in VS Code, so I wrote one.

The trick is configuring sourceMapPathOverrides to point at the compiled Edge Function runtime so breakpoints map back to your TypeScript source files.

https://medium.com/@matt_84360/debug-supabase-edge-functions-in-vs-code-with-breakpoints-fabe8582fcf1

Let me know if you have questions!

reddit.com
u/mattbrown7531 — 18 days ago