Fireship · @fireship
Is "edge" computing really faster?
Uploaded July 11, 2022 · Length 8:14
Summary
The video compares the performance of edge computing using Vercel's edge functions and Firebase Cloud Functions, discussing the benefits and limitations of edge computing, including its potential to be slower in certain situations.
- edge computing
- vercel edge functions
- firebase cloud functions
- serverless computing
- next js
- cloudflare workers
- vercell edge functions vs firebase cloud functions
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
if all your friends jumped off the edge
- 0:01
of a cliff would you do it too in
- 0:03
today's video we'll find out all the hot
- 0:05
new game changing frameworks talk about
- 0:07
their ability to run on the edge using
- 0:09
serverless computing platforms like
- 0:10
cloudflare workers and vercell edge
- 0:12
functions and just a few days ago next
- 0:14
js released version 12.2 with the
- 0:16
ability to opt into the edge for
- 0:18
server-side rendering and api routes
- 0:20
sounds edgy but what does that even mean
- 0:22
is it some magic new way to make web
- 0:24
apps faster or just marketing nonsense
- 0:26
you can ignore coca-cola with a new
- 0:28
taste a new explosion of wonderfulness
- 0:30
in your mouth i did some actual
- 0:32
benchmarking between vircell edge
- 0:34
functions and firebase cloud functions
- 0:36
to find out which one is faster in the
- 0:37
real world and the results are
- 0:39
absolutely shocking but first what even
- 0:41
is edge computing well traditionally
- 0:43
when you deploy a web app you rent out a
- 0:45
computer that lives in a physical data
- 0:47
center somewhere around the world like
- 0:48
us east 2 africa south 1 or tatooine
- 0:51
west 4. because you're poor you can only
- 0:53
afford this one virtual machine so all
- 0:55
requests around the world go to that
- 0:57
same server the problem is that your
- 0:59
users are all around the world the speed
- 1:00
of light is fast but not instant so
- 1:02
being physically closer is faster in
- 1:04
theory web developers have known about
- 1:06
this problem for a long time and have
- 1:08
been using content delivery networks to
- 1:10
distribute duplicate or cache static
- 1:12
files like html css and jquery on
- 1:15
servers all around the world that means
- 1:17
if someone from sri lanka visits your
- 1:18
website they get an image hosted in
- 1:20
bangladesh as opposed to iowa on the
- 1:22
other side of the world that's awesome
- 1:23
for static files but it doesn't really
- 1:25
work when you have a dynamic server that
- 1:27
needs to execute some code when a
- 1:28
request comes in edge computing changes
- 1:30
that it's like a cdn for a full-blown
- 1:32
server that means when you hit deploy it
- 1:34
doesn't just go to a single data center
- 1:36
but is distributed all around the world
- 1:37
as a developer they work just like
- 1:39
serverless functions like aws lambda but
- 1:41
without cold starts and are executed
- 1:43
closer to your end users sounds awesome
- 1:46
but what's the catch well in order for
- 1:47
the system to scale there needs to be a
- 1:49
very minimal run time that means nodejs
- 1:51
and the million mpm packages you have
- 1:53
installed aren't going to work at least
- 1:54
not out of the box you'll have to bundle
- 1:56
them with webpack and the total size of
- 1:58
your bundled code can't exceed one
- 1:59
megabyte that requirement can disqualify


