If you have different opinions, now's the time. I'm thinking hosted on Brasel, one of my favorite serverless platforms in the whole world, and abstraction on top of AWS. So if you want to use AWS, cool, but potentially unnecessary because Vercel is like a nicer layer on AWS and requires no credit card. So for the workshop, it's probably better than putting your credit card in AWS and so on. Again, all of this is interruptible and customizable and we have the time, okay.
We host it on Vercel, the data store is of course, Zada because I work there and I know it better than any other data store. I think that's it, really, I mean, those are the only servers we need, a router, so a client-side slash server-side router, that's Vercel and a place to dump our data. If there's anything more we'll add to this list. So now I'm going to, yes Arslan.
Hey, so I'm new to serverless, so I was just wondering, as a part of this workshop, can we cover how you would debug through different serverless code? So normally in a REST API, you just throw the debugger around and kinda figure out where things are breaking. But it doesn't make sense to me how that would work in serverless. Yeah, definitely, we'll spend some time, because with serverless, you usually need to set up something called a log drain. Because you don't really, like, logs are expensive, there's just tons of streaming strings, and providers don't wanna accumulate that much stuff. So, yeah, we'll set up a log drain and everything. Julio, Julio, Julio? What's up? Hey, what's up? So it's actually a question, since you're working with Verso, and I saw Next.js in the readme, is that, does Next.js has any relation with actual Serverless, or it's something else? That's a great question. Yeah, Next.js is a serverless React. Wait, what? That's so cute, by the way. Yeah, Next.js is a serverless React framework. This is different, in a way, comparable to Remix, because both of them have, like, Remix forces you to have a server, and it's entirely server rendered, but Next doesn't. So you can generate a static site from Next and deploy it to a serverless CDN, content delivery network, where you serve static stuff, or Next will actually server render stuff for you as well, and this is something I'm excited to show you how Vercel will do that. So yeah, Next is definitely, I'm not gonna try to say Clement, I'm sorry. Yes, what's up? You raised your hand, Clement. You're gonna say something, or was that a butt dial? Where's the button? Oh, okay, well, Oscar, what's up? The question that I have is, are you going to do a little bit of the Edge, like Cloudfarer or explain a little bit? Yes, definitely. I love that you mentioned that. Thank you. Thank you very much, yeah. Vercel Edge functions, so good. Awesome. Good, I like this. I love the collaboration already, and I'm really excited for the time we're gonna spend together. I remember going into this, I was a bit nervous. I was like, shit, am I just gonna be talking to a bunch of bots with the camera on? And yeah, but it's fine. Okay, so cool, let me just adjust the readme. Yeah, feel free to put your hand up, unless there's something you want. That's working. Is that Clement? Yes, sorry. Yes, my Mac wasn't working. Just a question, what would be the best use for serverless? Is it like just something where you don't have much traffic? So half of the time it's not used? Yeah, that's a good question. I'm going to answer your question by drawing diagrams. Feel free to watch my screen. So traditionally, right? If you have a site, like a React app, whatever, you usually will have, why is this a dotted line? Okay, you usually have your React app on your computer. So your computer. And what you'll do is you'll want to upload this somewhere so everybody can access it. And how you will do that is using AWS, Vercel, whatever. Let's call it Cloud, the Cloud CDN. A CDN meaning a content delivery network. Its one job is to host static file, HTML, CSS, JavaScript. So on your site, you have a Build step, right? You'll do like NPM Build or something. And you'll get static assets. So then you will get some HTML, CSS, whatever. So this is what happens on your computer. And then by the way, if you used, if you've ever used Vercel ever in your life, this is what they do. So you like Next Build, it just runs this, gets you static assets. You push it to the Cloud CDN, okay? This is a serverless setup. In a serverful setup, you would have to maintain the CDN. And you'd have to maintain complexity like across the world. How is it distributed? So like, if this is the world right here, let's draw the world. So there's North America, South America, Canada, Europe, Australia. Wow, it's amazing. So if this is the world, right? You'll want to have your CDN here. You'll want to have it in multiple places, US East, US West, Australia, Europe, South America, maybe Canada. This is really important. And these are called points of presence or POPs. It's very important to have many POPs because if someone here from the US wants your website, they're going to get it really fast from this point of presence. But if you don't have this point of presence, then they have to go like all the way here to Europe. And this latency is long. It's very slow. Nobody wants to wait that. There's actually empirical evidence that if somebody has to wait more than a certain number of milliseconds, they're going to just like not give you money. So having multiple points of presence is very important in a server cloud network. And if you don't use serverless, you would have to manage this shit yourself. You'd have to literally create servers and put identical configuration on them in multiple parts of the world, and then install like monitoring software to deal with them. And you'd also need to configure something called Regional Failover where if say, for example, somebody tries to talk to this point of presence, but it's not available, like it's broken, then automatically this request would be rerouted to another available point of presence or the root node. So all of this is like complete server bullshit that Vercell and that AWS and that Heroku and that everybody else saves us from. Small question, as far as I understand, content delivery network appear much earlier than cloud, well, serverless and it's totally separate. So we can have, not a serverless but still have a CDN. Yes and no. So serverless by definition is you don't manage servers. So if you're using a CDN, that can be considered serverless because you're using, so for example, Akamai, the most famous CDN, you're using their servers. You don't manage the servers. Therefore it's serverless. Oh, sorry, I didn't erase my hand, but basically if I have all the management done on my server and I expose that for some public offering, expose that as a service, basically from anyone else's point of view, it's a serverless technology still, I guess. Let's use another example than the CDN because that can be confusing because CDNs were around before serverless became successful. So let's say you have a site. Let's call it, why is this green? Sorry, I have a thing with colors. Let's make that white again. So you have a site, this is your site and every site usually needs data, okay. So you decide, hey, I want a database and that's cool, but your site needs a way to interact with the database. So you need an API. I'm not gonna talk about how your site is deployed.
Comments