Lesson Description
The "Scaling the Todo App" Lesson is part of the full, Backend System Design course featured in this preview video. Here's what you'd learn in this lesson:
Jem demonstrates adding a load balancer to a todo app, showing its placement and function. He also demonstrates how to sketch a cluster setup, explains scaling with multiple servers, and briefly discusses using a cache to handle high user loads efficiently.
Transcript from the "Scaling the Todo App" Lesson
[00:00:00]
>> Jem Young: All right, so what do we need to add now in our system that we just talked about? Bouncer, yeah, let's go ahead and pop that in there. Call you load balancer. And we'll put this at our edge here. And we talked earlier, you could have a load balancer in front of your multiple databases as well. That's a little bit different of a problem when you're talking about multiple databases, which we'll get to in a future section.
[00:00:32]
So I had a load balancer. Some of these lines. There we go. Cool. And one for you. And we want to represent this as a cluster, so we'll just wrap a container. And generally, if you're actually sketching this out in a real interview, you can do something like this. And the assumption is it's, you know, more than one server. You don't have to sketch out, hey, there's actually 20 or 30 or 50. This implies it's a cluster.
[00:01:16]
And a load balancer is going to talk to. Then I'm just going to go to this one or this one, but, you know, it's a diagram, you don't have to draw the full cluster. So now we look at this and we say now we have a to-do app. This can do 100,000 users pretty easily. So that's a lot in the database. Yeah, but the database is pretty read heavy, as we talked about earlier, and reads are pretty straightforward.
[00:01:42]
We didn't talk about caching yet, so I'm not throwing one in there, but generally we're going to put a cache in front of the database, and that would get us to easy 100,000 users with a system this simple. I skipped some details. I didn't lay out the APIs in the paths and things like that because, you know, as I'm talking, I'm like, oh, you'll get it. I don't need to lay it out. But if I were going slow and I wanted to be like, you know, I'm not quite sure what's going where, I would do something like this.
[00:02:13]
I can say, oh, now the load balancer, the load balancer is hitting the authentication. It's doing the routing. And then I'd say the web server's doing all the business logic. It's handling all the API requests and processing and things like that. That's helpful when you get to a more complex system where you have many, many boxes, many, many arrows. It's really helpful to label what is this thing doing unless you're really good with naming.
[00:02:44]
But that ends section one. We drew a diagram and we got here. For the next section, we're going to make it a lot more complicated. But now we don't have to explain as much. Now we can just jump right in and be like, there's a few other concepts I want to explain, like async communication. We're going to get more into the databases, that's really important and touch on caching, but that will cover almost every system we need to design, just a few components, the same components we talked about earlier.
Learn Straight from the Experts Who Shape the Modern Web
- 250+In-depth Courses
- Industry Leading Experts
- 24Learning Paths
- Live Interactive Workshops