Fireship · @fireship

Is "edge" computing really faster?

Uploaded July 11, 2022 · Length 8:14

Is "edge" computing really faster?

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.

  1. 0:00

    if all your friends jumped off the edge

  2. 0:01

    of a cliff would you do it too in

  3. 0:03

    today's video we'll find out all the hot

  4. 0:05

    new game changing frameworks talk about

  5. 0:07

    their ability to run on the edge using

  6. 0:09

    serverless computing platforms like

  7. 0:10

    cloudflare workers and vercell edge

  8. 0:12

    functions and just a few days ago next

  9. 0:14

    js released version 12.2 with the

  10. 0:16

    ability to opt into the edge for

  11. 0:18

    server-side rendering and api routes

  12. 0:20

    sounds edgy but what does that even mean

  13. 0:22

    is it some magic new way to make web

  14. 0:24

    apps faster or just marketing nonsense

  15. 0:26

    you can ignore coca-cola with a new

  16. 0:28

    taste a new explosion of wonderfulness

  17. 0:30

    in your mouth i did some actual

  18. 0:32

    benchmarking between vircell edge

  19. 0:34

    functions and firebase cloud functions

  20. 0:36

    to find out which one is faster in the

  21. 0:37

    real world and the results are

  22. 0:39

    absolutely shocking but first what even

  23. 0:41

    is edge computing well traditionally

  24. 0:43

    when you deploy a web app you rent out a

  25. 0:45

    computer that lives in a physical data

  26. 0:47

    center somewhere around the world like

  27. 0:48

    us east 2 africa south 1 or tatooine

  28. 0:51

    west 4. because you're poor you can only

  29. 0:53

    afford this one virtual machine so all

  30. 0:55

    requests around the world go to that

  31. 0:57

    same server the problem is that your

  32. 0:59

    users are all around the world the speed

  33. 1:00

    of light is fast but not instant so

  34. 1:02

    being physically closer is faster in

  35. 1:04

    theory web developers have known about

  36. 1:06

    this problem for a long time and have

  37. 1:08

    been using content delivery networks to

  38. 1:10

    distribute duplicate or cache static

  39. 1:12

    files like html css and jquery on

  40. 1:15

    servers all around the world that means

  41. 1:17

    if someone from sri lanka visits your

  42. 1:18

    website they get an image hosted in

  43. 1:20

    bangladesh as opposed to iowa on the

  44. 1:22

    other side of the world that's awesome

  45. 1:23

    for static files but it doesn't really

  46. 1:25

    work when you have a dynamic server that

  47. 1:27

    needs to execute some code when a

  48. 1:28

    request comes in edge computing changes

  49. 1:30

    that it's like a cdn for a full-blown

  50. 1:32

    server that means when you hit deploy it

  51. 1:34

    doesn't just go to a single data center

  52. 1:36

    but is distributed all around the world

  53. 1:37

    as a developer they work just like

  54. 1:39

    serverless functions like aws lambda but

  55. 1:41

    without cold starts and are executed

  56. 1:43

    closer to your end users sounds awesome

  57. 1:46

    but what's the catch well in order for

  58. 1:47

    the system to scale there needs to be a

  59. 1:49

    very minimal run time that means nodejs

  60. 1:51

    and the million mpm packages you have

  61. 1:53

    installed aren't going to work at least

  62. 1:54

    not out of the box you'll have to bundle

  63. 1:56

    them with webpack and the total size of

  64. 1:58

    your bundled code can't exceed one

  65. 1:59

    megabyte that requirement can disqualify