Python Web Apps that Fly with CDNs Transcripts
Chapter: Welcome to the course
Lecture: What is a CDN?

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Let's start with a quick visualization. What is a CDN or content delivery network? Well, let's see how the web works without one.
0:11 See that over there on the East Coast of the US, that little pink dot, that's your web app running on some data center
0:18 on the East Coast of the United States. And over here on the West Coast of the US, we have one of our users and they wanna check out our website.
0:26 They wanna go check their mail or see a message or buy something from us, whatever it is they do on their web app, they wanna do it today.
0:34 So they're gonna come over here and they're make a request, ping time, West Coast to East Coast US, it's about 100 milliseconds,
0:42 connections are pretty good there. So this user is having a good experience. We have multinational users, we're a multinational company.
0:52 And so we've got another user over here near Sydney. Now, they also wanna interact with our website.
0:59 So they're going to make a request and it's got a little bit further to go. So the ping time is longer, the network is slower, that might be a problem.
1:09 Now, to be honest, if all we're exchanging is one page, or one API response, something like that, this, this would be probably be just fine.
1:22 It turns out there are many files requested per page as we'll see.
1:27 So even though there might be some delay here, this is amplified maybe 20 or 50 times worse than what you would imagine for a single request.
1:36 So it's not a great experience. And the larger the files, the harder it is to serve a multinational set of users.
1:44 So a CDN comes along and says, well, what if all of those files that we are going to
1:48 request, what if we could just put them on a bunch of servers and replicate them throughout the world?
1:54 So when our West Coast user makes a request, most of the files they request are just a few hundred miles away, maybe 20 milliseconds delay.
2:02 But the same thing for our folks in Australia, as well as in Japan, or South Africa, or Sao
2:10 Paulo, all over the world, our files are automatically replicated, at least our static files are automatically replicated to all these locations.
2:18 So when users interact with them, it's as if every single one of them is right by the data center. And that is fantastic.
2:26 That takes load off of our servers, and it makes it way nicer for all of our users.
2:33 So our goal throughout this course is how do we take the web app that looked like this
2:37 first one here, it's already working, but it only serves files straight out of its local
2:44 data center, not directly out of its Python code, but you know, Nginx just outside of
2:48 our Python code and probably the same server and convert it to use a cool CDN that's easy
2:54 to use, extremely fast, and has over a hundred different server locations throughout the globe.
3:01 So, it turns out it's easier than it sounds and it's really, really effective. You're going to have a good time building this.


Talk Python's Mastodon Michael Kennedy's Mastodon