How can I create more than 10 edge functions?
# help-and-questions
o
I dont know if i'm doing something wrong, but when I run supabase functions deploy my-function supabase client show a message that say that I reached the limit of edge functions, but I need more 😦 how can I do in this case?
g
Check the pricing page for pro which goes up to 100. Free is 10.
v
standard REST api convention is to use /api/v1 and /api/v2 etc and if we were to following standard convention then you dont even need 10 free functions. you would just need one. create one /api and use a middleware like oak and do a gazillion things within that function. i dont know what the thinking behind this functions folder structure but what if we have to have different versions of the same end point?
o
If I use Supabase in local with docker and I run my project using self hosting, can I create more than 10 edge functions?
g
https://supabase.com/blog/edge-runtime-self-hosted-deno-functions This was announced recently. I don't know much about local hosting.
s
The problem I see with the
oak
approach is that if one function goes down they all go down. Also if one function is taking a while to process, it would mean the others could be blocked due to this since it would be running in the same worker.
v
@silentworks Fair points. i am a believer in "microservice" architecture but here is Paul Copplestone's message to me on Twitter about this issue
Copy code
Actually I would recommend using a middleware router like Oak. We have it documented that “fat functions” are better for maintainability.
s
If I remember correctly the context of this was that local supabase was only able to run one edge function at the time. Now you can run multiple which wasn't possible at the time when Paul wrote that tweet.
v
@silentworks that wasnt a tweet. thats a DM to me two days ago
s
Ah ok, it wasn't clear in your original message that it was a DM. My point above still stands and users should be aware of the cons from using one edge function.
v
agreed. monolithic services have several drawbacks and we are definitely not going down that path. I was just encouraging osamita (and friends who are on the free tiers) to be naughty and think out of the box. thats how we got down this road.
🙂