proper edge-to-edge setup (i.e. CF workers, regions, and edge auth (with supabase))

What's the proper architecture/setup for an edge function calling another edge function? -------- i'm currently playing around with CF workers and they've been really nice so far. I've been wondering tho, if i'm right, i think CF workers are deployed globally by default and the functions pop up as close to the user as possible right? I was wondering if it's possible to set them to regional, similar to vercel's edge (it prob is possible but i haven't found much info, prob because this is vercel's trade secret or something). On the other hand, it might not even be necessary to replicate vercel's regional edge functions. Afaik (correct me if i'm wrong), regional edge is only necessary if the DB is only constrained to one location. If i use supabase edge for auth and DB calls (e.g. checking that the user is signed in on every call, checking their payment status, etc), my intuition tells me that i'll have nothing to worry about because the app flow would prob be something like this:
-> frontend makes request to edge CF worker
-> a CF worker spins up closest to the user
-> CF worker calls a supabase edge function
-> Supabase edge function spins up closest to where the CF worker was
-> frontend makes request to edge CF worker
-> a CF worker spins up closest to the user
-> CF worker calls a supabase edge function
-> Supabase edge function spins up closest to where the CF worker was
Therefore i'll have nothing to worry about if an edge function calls another edge function because they'll always be close to each other? I'm pretty new to edge so i'm not sure if this is right, do i have something i should keep in mind when working with edge?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server