4 ms·
Disclaimer: Chief Architect @ Vercel This is a good summary. Edge Functions bring another set of trade-offs into the mix: - Startup-time so fast that if you h
by cramforce 4y ago
Disclaimer: Chief Architect @ Vercel
This is a good summary. Edge Functions bring another set of trade-offs into the mix:
- Startup-time so fast that if you hit a "cold start" it is still fast enough from a human perception (often <30ms attributable to startup)
- Global by default
- Cheaper on a per invocation
- No limits on concurrent invocations
BUT
- Restricted API set, no node.js API support like Buffers or filesystem access
- Smaller max binary size
- Lower available CPU quota per request
- Lower max RAM usage
- Lower CPU-
- ascorbic 4y agoCongrats on GA! I'd add to the pros that these edge runtime are a lot more standards-compliant than Node too. Users do get conufused about the CPU quota thing. They compare the 10ms or so that you get with edge functions, vs 10 seconds on lambda and think it's loads worse, without realising they're comparing apples and oranges. Both Cloudflare and Deno Deploy are limiting CPU time, whereas Lambdas are limited on wall clock time. I've had no trouble keeping long-running Deno Deploy functions running for far longer than a Lambda could run, e.g. when using Server-Sent Events or passing-through a large file download. As long as they're blocking on IO rather than CPU then you're fine. As long as you're not doing something like trying to process images, you're much more likely to hit a 10s lambda timeout than a 10ms CLoudflare or Deno limit.