Serverless with Mama J
Skills:
AI Workflow Automation70%
Key Takeaways
The video introduces serverless computing and AWS Lambda, explaining the benefits and architecture of serverless applications, with a focus on AWS services and security.
Full Transcript
For years, my mom has been watching my presentations on YouTube and different things. And she finally sit down with me and said, "Eric, I want to know what serverless is. People asked me what you do. I want to be able to tell them. I want to be able to talk about the technology with some kind of understanding." So, I sat down with my mom who we call Mama J. And we had a session called Serverless with Mama J. If you want to know more about Serless, come along and join us and enjoy. Okay. So to understand serverless, the first thing you have to understand is servers. Do you know what I mean by servers? >> I think I do. >> Okay. What do you >> It's not a hard word. >> Okay. All right. So it's implicit in the word, right? Okay. So Okay. So we're going to talk about the idea of what we call client and server. Now you ever been on the web? >> Uh yes. >> Yes. Do you go on the internet? You look at websites, things like that. Okay. So, that's kind of the context we're going to be talking about this. So, >> when you go to a website, you're going to type in and so let's use I don't know if you've ever heard of it. We have a little startup we call Amazon.com here. >> Yeah. >> Yeah. You're a big supporter of us. I appreciate that. Uh >> when you call their website, some things happen. And I'm going to show you how that works. So, let's say you sit down at your computer and you open up a program. What do you use to look at the internet? >> I use Chrome. >> Okay. All right. So, what we're going to do, so Chrome uh is what we call a client. So, let's pull in our client real quick here. So, you have this client like this. And of course, you're here. So, this is your client. So, we'll put you in here so we can see you. There you go. There's Mama J, right? And she is on her client. And she's going to call Amazon.com. So, we'll just say Amazon.com. And then what happens now? As you know, not everything is on your computer. You don't have the whole inner tubes, interwebs, whatever you want to call it. >> Uh on your computer, right? Right. Okay. So, it has to get it from somewhere. So, what's actually happened uh and this is a very simplified explanation. So, you know, there may be people out there going, "Wait a minute, there's a few other things, but to kind of help you understand server and client, this is what's going on. So somewhere in the world when you call amazon.com is one or more and probably more like you know hundreds of thousands of computers >> that serve this back. Now you may ask the question what do they serve? >> So let's talk about what happens or what a website consists of. So there's several things right the first is what we call HTML. Okay. So we're just going to put these right maybe right here next to it. We'll get us out of the way. So, the first thing is an HTML file. And an HTML file's job is to say this is the content. This is the text that's going to be on it. Maybe here's some positioning, but it describes what goes on the page, right? >> When we used to have to use HTML for an address first using >> Yeah. Well, well, you're kind of dating yourself right now, but yes. >> Hey, that's no surprise. >> Yeah, exactly. You know, you're you're young because I'm young. But so yes, you would have to put like index.html and sometimes you still have to, but the the servers are pretty smart now. They say, "Look, if you want that folder, we know which file to give you, but yes, that's really good." So this is uh it's a it's a HTML or hypertext markup language. Heck, just Okay, I know you did. I know you did. Uh and so the next thing that's going to happen is we're going to bring out what we call CSS. And I got a f here it is. Okay. So CSS is stands for Do you know what it stands for? Maybe. >> Okay. Maybe. But you want me to say Okay, I'll say it. >> Uh, yes. Okay. I can't move this to save my life. There it is. Okay. CS CSS stands for cascading stylesheets. >> Okay. >> Okay. So, that must clear it all up and we're done, right? All right. So, a stylesheet describes what the page looks like. What color is that box? Is that image have rounded corners? Different things like that. >> So, it's the design. >> Exactly. Yeah. Yeah. in in the simplest form. HTML says what's on the page. CSS says what does it look like? Okay. >> Okay. And then we have another thing in here. Uh and I think I have an image board. We'll just bring a box in in here. And that's just going to be uh media. So media can be images, audio, video, those kinds of things. Those will be on your server as well. And the very last thing that we're going to have is JavaScript. Now, I know you're familiar with JavaScript already, but for those watching, I'll I'll explain it. Yeah. Yeah. So, we say JS or JavaScript. JavaScript is the interaction. Okay. So, when you go to amazon.com and you're saying what I want to buy, you'll type in what's something you're searching for. >> Oh, let's say I am searching for bedroom uh decor. >> Birthday presents for your son. Exactly. That's right. That is that is what you said, right? Okay, birthday presents for your son. So, you're saying uh you looking for new cars or uh a new computer or something like that. So, you're going to type that in. What's going to happen is under the hood where you don't see it. JavaScript is going to do something. Sometimes we use JavaScript to move things around to hide things or show things. >> Sometimes we use JavaScript, more likely use JavaScript to call and get more data from the servers. Right? So, here's what happens now that we've kind of explained what those are. What happens is when you make the call, the server is going to send all these files, everything needed down to your client. And your client says, "Okay, I've got all that. I have the instructions. I'll render this picture." Okay? So, this is the client. This is the server. So, when you get on, you make the call to here, and your server is going to return all that data. Now, there's a couple things to understand about that. Okay. So, have you ever been on Facebook? >> Once. >> Once or twice. Yeah. You're a fan. So, Facebook. So, you go to Facebook and you see on Facebook. Is it my data you see or is it your data, your feed, the stuff you like, right? So, it's very customized. How do they know >> that? How how do they know? That's exactly right. It's very customized for you. And the reason and and we we do that at Amazon, too. So we customize, right? The reason is is when it's on that server, it actually renders that. It does what we call business logic. Okay? It says, "Oh, that's Mama J." They may use Shirley, but if they know better, they'll say, "Mama Jay, that's Mama Jay. So, we're going to build out this content that Mama Jay likes, and she knows she wants to buy her son." So, that's how it works, right? >> They don't have cars. >> They don't They do, but we'll get into that another time. So yes, and so that's how it knows. So so the server actually runs some scripts and it can be many different languages. There'll be a test later, but some of them might be Rust. That's for you new Rust fans. I know you love Rust, JavaScript, TypeScript,NET, Java. I could go on and on and on. But we use different languages to render that out and we run business logic. >> Okay. >> Okay. So now let me tell you some more some more things about that. All right. So now we're going to talk about some logistics of running servers. This is what we've been doing forever. But there are some caveats about this, right? Okay. So first of all, how many servers do you think it takes to run Amazon.com? >> A gazillion. >> A gazillion is not enough. >> Okay. >> Right. A gazillion servers. And the reality is we never know. We're going to use probably a different website. uh you know, let's just do a madeup website like, you know, my domain.com or or or you know, we're going to use another domain that uh you know, that that that maybe doesn't have so much traffic >> like loveyouama. >> Like loveyoumama.com. That's exactly right. That can be taken a lot of different ways, but that's funny. So, um what what happens is we don't know what that traffic's going to look like. So, what we need to be able to do is those servers, we need to be able to add more as uh as you need more load and have some come away, but we can never totally get rid of it. You always have to have a server sitting out there. Uh and so it gets kind of, you know, it's it's like whether you're getting traffic or not, those servers are there and you always need at least two in case one goes down. And really what we do is we'll do like, you know, 300 in this area, 300 over here and go back and forth. Okay. You with me on that? >> I am. Yeah. >> All right. So, as a developer, we have to maintain those. Now, what's what do you think? What's the When you think computers, what's the thing you think? >> Oh, well, I'm remembering the server we had in the office that we worked in before, and it was this big old huge thing that that heated the room up. >> Yeah. Yes. >> And often broke down. >> And how often? And and I didn't know much about computers, but who was the IT? >> I called you and what are you going to do? we can't get on this. >> And how much time did I spend adding RAM to it, adding pro or changing out the processor, uh storage? I was taping RAM to the sides because we ran our website from this pitch. >> Yes. >> And when it got slow, our website was slow and when it, you know, we we were dealing with finances and all kinds of things and >> access data. >> Exactly. When it crashed, we couldn't access that. So what that means and it's the same here even and and Amazon has done AWS has done a fantastic job with offering instances in the cloud where you we don't have to run them on the counter or or in your closet anymore. Yeah, we use virtual machines but uh even then you still have to patch and manage and and do that and it kind of takes away from the whole reason you want to build. As developers we have these amazing ideas and we want to build these and work on these but we're patching and managing servers, right? So that's one thing. The second thing is we have to deal with that scale. Can we scale up and down uh as we need it? The third thing and actually at at Amazon or AWS is what we consider the most important thing. When you're dealing with your bank, what do you worry about? >> Oh, somebody getting into my account. That's right. Security. >> Security. Physical security. Who's guarding where the computer is? Right. Digital security. Is it encrypted? Is it encrypted? what we call there's two types of encryption that we often deal with. One at rest when it's sitting in a database is that data encrypted when it's transferring across the wire. Is that data encrypted across the wire? So, we want to deal with security as well. So, that's another thing that we have to deal with with our servers. Are we making sure they're safe? And finally, there's the financial part. Like we talked earlier, they're always running. If you're going to have requests coming through, I mean, you may check, you may shop, What time do you shop on Amazon usually? >> Oh, beyond >> 11 p.m. Okay. Yeah. I don't start shopping on Amazon until about 2 a.m., right? So, we do we do it different times of the day, right? But we always have to be up and running. So, those servers have to be up and running. And and really, if you think about it, it's like having a restaurant. And even if there aren't any people in your restaurant, you still have to keep it open and your servers are there and it's very expensive. It doesn't sound very efficient, does it? >> That would not be a good way to run a restaurant. >> It's not. >> You could just call them in >> say, you know, I'm going to beep you when it's time. >> Exact. Okay. So, unplanned, but that's exactly what serverless is. So, basically what we do is we say, hey, we got customers. Wake up. And I'll explain that in the next section. All right. So, let's talk about serverless. We covered servers and why you kind of need to understand that to get into serverless because serverless is really that answer of like like I told you waking up the servers when we need it. So, let's uh let's jump into our diagram here. So, I'm going to move us up here. I'll bring you down because you want to keep you right. So, we'll just do a new diagram. All right. So, here you are. So, we're going to do the same thing. Okay. Okay. So, let's go ahead and we're going to bring in our let's bring in our client again. Okay. And maybe we'll, you know, whatever website we're going to hit, that's not really that important. But you are deciding, okay, I want to look at a website. Now, we've already talked about how we have to have a lot of servers up and and things like that. But here's what AWS did. At AWS, we said there has to be a better way. We run one of the world's largest websites, and we're pretty good at it. we scale and things like that. So we think we can help customers do this with their websites and more importantly kind of move out or move away the what we call undifferentiated heavy lifting uh and let them just do what matters now let me explain. All right undifferentiated you you're going to have to go back on that. >> All right undifferentiated let's start let's break it down. Okay. Undifferiated means not different from everybody else, right? >> Oh, >> undifferiated a lot. That's Yeah. Yeah. So, never thought I'd be teaching my mom, but here we are. >> That's bad. >> Okay. Heavy lifting means obviously heavy lifting stuff we don't want to deal with. >> And the idea around that is if every developer is also having to patch and maintain servers and deal with security, they don't have time to build the code that makes them different. Okay? So they don't have time to concentrate on their product. Instead, they're doing what everybody else is doing and worrying about security and all those kinds of things. >> So you're going to assign specialties is what you're going to do. >> There you go. Okay. >> So yeah, something like that. So So a company comes in and says, "Look, we're great at payment processing or we're great at video editing or we're great at, you know, whatever, but we spend 90% of our time securing and patching and maintaining our servers. That's no good. We want to spend a 100% of our time building our payment process or our video editing or our audio creation or our AI. Yes. This there's the AI word. This definitely Yeah. The Yeah, we we won't talk about that because I know you get scared. Yeah. So, um but that that's the world we're in, right? And so, so what they want to do is they want to say we want to do our specialty. We want to do what we're good at. So, at AWS, we said, "Okay, we can help you." So, here's what we did. Let's get into the nitty-gritty. We took a bunch of computers. It's not really how many important things like that. And basically they appear as a big server farm. So think of instead of our servers like we had we have this big server farm. Okay. And then we said to the to developers we said when you have code you want to run go ahead and just give us that code. So let's just do code here and we'll change that color so we can see. >> Okay. Tell me again what you called that server. What? So, I'm going to call this we'll put a name in there so it makes sense. All right. So, I'm going to call this the server farm or or or what we call >> Okay, >> here's the term. Ready? What we call lambda. This is the lambda service. >> Okay. >> All right. So, that's the first service we're going to talk about. This was the first service to be called serverless, right? And so, we'll call this Lambda. And this is AWS Lambda. And it was it was our product came out in 2014, right? Well, I remember hearing you say that word and I just pretended I knew >> you. Yeah. Yeah. Yeah. Well, lambia has been around that I mean it's a Greek letter. So, and you remember my days of Greek, so Yeah. Yeah. Um, so we said to to our developers, rather than you building all the computers and everything, just give us your code. All right. So, let's say this is the code for Eric, right? This is Eric's code and and it's on a website. Uh, we'll call it eric.com. Okay. So now, so this is the website you went to because you want to read blogs about my daughters or something like that or my my sons and and and the kids. So all right, so we've got this and this is where you go. So now what happens is just like before, your service is going to call, but instead of hitting one or two servers or something like that, it's going to hit our service, the Lambda service. There's a couple of things in between that we'll break down later, but you're calling the Lambda service. What the Lambda service does the first time you call this, it says, "All right, we're gonna create what we call an execution environment." Let's make that orange so we can see that. And we're going to load it up in our server farm. Then we're going to call grab your code and put it here. And once we get that in there, then we're going to start billing you because that's when we're going to run all that business logic that we ran up here. We're going to run that business logic here for you. And then we're going to respond back just like we did with the other server. >> And this is for everyday people. >> Everyday people. Anybody can use this. If you have an AWS account, you create a Lambda function and there it is. and it passes back those same files as HTML, CSS, JavaScript, and it also runs that business logic that we talked about. >> Okay. >> Okay. So, but here's where it gets really interesting. Let's say you and a thousand other people all hit at the same time. Well, what we're going to do is we'll create a new So, I'm just going to grab this one if I can. So, we grab these. we create a new environment for each person calling, right? So, we'll scale that up for you. >> Okay? >> Or now here's where it gets really interesting. Let's say this one is done running. Okay? So, this one was run. So, do the first one. This one was running and now it's done. So, we pause it. So, we'll make it red for pause. So, the next call that comes in, what it'll do is it'll say, do we have an available? And we call this an execution environment. Do we have an available execution environment that can run this code? Well, yes, we do. So, instead of creating a new one, we'll just reuse that other one. Okay. And we'll respond once they sit for a while. We say, "Okay, well, you know, we've been using it and now it's time, you know, they're not calling anymore." Then it goes away. And then when they go away or or when they're not being even if they're sitting out here waiting to be used, you're not charged for it. And when they go away, you're not charged for it. >> Okay. So, let me ask you something. >> Okay. >> Black Friday. >> Black Friday. >> Sites get slammed. >> Yep. >> Thousands of people are trying to find the same thing at the same time. Yep. >> This is happening. >> This is happening. We use uh AWS or Amazon does use serless under the hood for a lot of their things. We also use servers. We use the right tool for the right job. But yes, this is part of a part of the architecture that scales up and scales down as needed. If you remember, I explained up here that these servers you always had to have something running. See, you were paying 24/7. That restaurant was open. >> But down here, if nobody's calling, >> then the servers are asleep. Okay? >> Right? So, we've told the restaurants, the the employees, go home. If someone calls, we'll call you back in. But the nice thing about here's where the analogy breaks down because every analogy does is rather than you have the the server having to get in their car and drive up this happens in milliseconds. >> So we're talking when to bring that code in and there's some variables that cause that but anywhere from you know seven to eight to a couple hundred milliseconds and that happens and we can come up and handle uh a thousand of those uh at one time. Uh and and that's just concurrently. If they're staggered a little bit, we can handle tens of thousands. Uh, so this is why very large companies use this for large streaming and different things like that. Okay. So, are you first of all, are you with me so far? >> I believe so. >> Okay. You okay? >> There's no test. >> Oh, there there will not be a test. I promise you. All right. So, we talked about this idea of now we're no longer paying for services that we don't use. Right. >> The other thing I want and and we also talked about it scaling as needed, right? So those are two two of the really important things. Let me talk about the third one. >> Remember when we had our servers I had to patch >> we call you exactly the night. >> If if we'd had this back then I would have just said no no no AWS has got it. They're going to patch and manage the servers that are underlying this. So I'm no longer dealing with that. The fourth thing we want to talk about and that's the one that you asked about is what about security? >> Yes. >> Okay. And we'll climb into a little bit more of that in the segment. But I want to explain here is yes, when you create when I as a developer say I want to use a lambda function. When I first start, it doesn't have the rights to do anything. It can't be invoked and it can't call anything and I have to explicitly give it permission and it's and I encrypt the parameters in it. So we use built in Amazon already gives you the tools to have a completely secure uh system, right? We also uh at AWS we handle obviously the physical security where it's at a data center and things like that. So those are the four things that make this different. So we answered that server thing of hey I only want to pay for what I use. That's number one. >> Number two I want it to scale as needed up and down. And we talk about this term when we talk about scaling >> in the server world. It's going to scale down at minimum to two. That's a two by the way. Oh man, >> I don't know if you know >> too right in in serverless we're going to scale to zero meaning you don't pay for it until the next call comes in right and then security is number one. So that's serverless and that's specifically AWS Lambda. There's four pillars that we covered. Number one, this idea of only paying for what you use. We're waking up the servers, right? Just like in the restaurant, we don't have to have them there. We're just going to call them and say, "Okay, we got a call." But the nice thing here, because this is where the analogy breaks down a little bit, is it doesn't take 30 minutes for them to drive in. It takes milliseconds, right? Uh for that for that Lambda to come up and and and to handle the call. Uh the second thing is it's going to scale as needed. And what's really cool about that is is in the servers when we talk about servers we need at least two but now we are going to we can scale to zero again following that idea. So scaling up as we needed to the thousands of people millions of people hitting at the same time scaling down to zero with servers we need at least two this week scale to zero. So again only paying for what you use and that scalability that's what that's really really important. Third is maintenance. No more calling your son in the middle of the night to add memory to change out storage >> for that. >> I guess >> for Yeah, you still call me and we both know you will because the printer doesn't print again. But um these that's the that's the IT world, right? Uh and finally uh so so again that that maintenance is being handled. So no and that's really kind of where the serverless came in. Oh, I'm not managing the servers so it's serverless, right? And then finally uh the fourth one is automatic security built in and that's what you get with AWS Lambda. >> Well that is super important because I know people in my particular world age category >> sure >> are scared to death about security. >> Yep. Yep. We believe so when we talk about security we believe in a thing called lease privileges. meaning you start with no rights to do anything and you have to explicitly add it because we know that security is is number one. So, uh >> well, and we finally understand that all our medical records, all our banking records, everything Yeah. >> is out there. >> Yeah. That's right. That's right. And so, you want to make sure whoever's handling them is run is doing it properly. >> Yeah. >> So, >> so I'll call you when there's a problem. >> There you go. >> Okay. >> So, that's AWS Lambda. What do you think? I think serverless and lambda are wonderful. >> Well, serless isn't only Lambda. >> Well, no, I saw those other things. >> Yeah. Yeah, but yeah, there's other things coming in. And so, so that actually leads us to our next section because Lambda was just the first one be called serverless, but there's a lot of other services and we're going to climb into that next. So, we've talked about servers, we've talked about serverless, and finally we're going to get into services, right? And this is the idea of there's a lot of services that we have made serverless and for a long time everything was serverless but I'm going to talk about some core ones like that. Uh and to do that I want to I want to uh use a real world scenario. So give me an example of what's a real world scenario that you deal with just like >> you've got about when I had a doctor appointment. >> Okay. And uh three weeks before I'm getting a text reminding me and two weeks before and then one week before. >> That's right. >> And then after I go I can hardly get home before I get rate your doctor. >> Okay. Okay. So this Yeah. >> Is that the is that you guys? >> Well, you can't blame us directly. But yes, I will show you how that something like that can be done in serverless and how it can be done efficiently and scalably. So I'm going to look at it positively. I know you're a little bitter about it, but >> No, no, no. I'm I'm getting texted over and over. So, all right. So, what we're going to do is we're going to build I'm going to show you how to build a scheduling agent. And we're going to up till now, you know, with the servers and and our client server here, we've been pretty general, but I'm going to get very specific for a moment and kind of talk you through some of the services and why we do that. Because like I said, serless is also about services. And that means that uh a lot of things that we do in code we can now do in services. And the reason we would do that and let me kind of get started here. We're going to pull you down because obviously you're the star of this and we always start with you here. >> So developers and and all developers are the same. I'm a developer. I wish I were in if I were in a room of developers and I asked you to raise your hand, you'd all raise your hand to this. But we always think we can do it just a little better with our own code. Right? I can code for that. I'm going to build the next great authentication system or authorization system. I'm going to reinvent the wheel yet again. And here's my challenge to you, especially when you're looking at service serverless and you're talking about services. Use the services. My mantra is I like a mantra. My mantra is if all else fails then code. And most people who have seen my code agree with that statement. Eric shouldn't be coding right up front. But this idea of there's a lot of things and I'm going to explain them. I You're not a developer, are you? >> Uh no. >> You know, I will be when we get >> when we're done if I don't stop talking. Right. So when we get this done or when we get not there I said it again. developers want to do everything in code, but a lot of things we can move out to services that have already been tested and hardened and made sure that they worked with with retry already built in things like that that can remove hundreds of thousands of lines of code. So it cleans up your code. So let me let me kind of explain. >> It's sort of the same as don't reinvent the wheel. >> Yes, exactly. Don't and again and again and again, right? That's exactly right. So let's let's go back for a second. So, we're going to come in here and uh we're going to look at a server. So, we get this idea of a client server. And the interesting thing about that, let's make our server a little bigger here. Is inside of this server. So, let's you've got the client and you've made the request when we deal with servers, especially before we moved it to the cloud. So, that server that we were running in our office. Yeah. Here's some things that we had to deal with, right? And and these aren't all of them, but just to kind of give you the idea of of of how it worked. So one is we had to deal with routing. Okay. Uh and then next we had to deal with uh maybe we would deal with a firewall. >> Okay. And and so I'll explain those to you. So the routing says, "Oh, uh that lives over here. Let me send the packets that way." Or that lives over here. So we're routing, right? Then a firewall says, >> I know what that is. >> You know, you know that's >> I'm not letting you in. >> That's exactly fire. That's exactly that's a firewall. that says you can come in but you can't and I I'll go back for my for my you know uh European colleagues that would also be called routing uh earlier so we say routing routing you see do that but you're you're right the firewall says yeah you can come in you yeah sir okay I didn't need to tell you that so then the next one we would have and and I'm going to make these just a little shorter is you would deal with maybe something like an API okay and so this is a little different API is kind of at the code level API stands for application protocol interface. >> Okay, >> that'll be on the test. >> Okay. >> Okay. So, or or we say appy. >> You want to spin the will. >> Nobody says app test. >> No test. There will be a will. So, okay. Um, so API what that does is that set that looks at a at a a route coming in. So, it's a little different than router. Routing kind of says, "Hey, what machine should you go to?" The API says, "Hey, what code should you run?" So, for instance, you might see something in your browser. You might might see it say like amazon.com/ user/profile. >> That's that the API will look at that and go, okay, I know where to put that. Right? So then you'll have uh in here also you might have a database and so I could go on. All right. >> Okay. Is that is that what is happening when perhaps you close out of Amazon? I have friends that use Amazon. >> I know you do. Yeah. Yeah. I know it's not you in again and you see exactly where you were before in your search. Ah, so that's a little different. That's that's uh that's a matter of we we that's well we won't take this too far. >> Take you to a specific. >> Right. Right. So that has so we we can memor we can keep memory of where you were. We store what we call sessions and that's done multiple different ways. I'm probably out of scope for this one, but that's a really good question. But no, the API is more about telling the server where should I be responding. Okay. What code should I be running? Right. Okay. Okay. So, we got these things and there's some others I could I could list, but we're going to there's there's a thing called a web application firewall. There's which is also with your firewall. We So, at Amazon, we said we think we can take a lot of that out of the way for you. Another one. Let's Let's actually do another one here. So, where do you store all your Okay, my mouse seems to There we go. Um, where do you store all those files that we're going to do? So, you have storage. Uh, and then where do we store all the data? Okay, so then you're going to have a database. And a lot of times back in the day, we would do this all on a single computer. That's the worst spelling of database yet. Let's try here. There we go. So, you would do this all on the same computer. They would all live inside of this computer like so. Okay. Okay. So that means you as the developer are responsible for all that or maybe at an operations team depending on your team. >> So again at Amazon we said all right we've given you compute that's serverless that's that lambda function because remember it's running the business logic >> but we think we can take some other things out of your way. Take some more of that undifferentiated heavy lifting buzzword central right here. >> Really? >> Okay. We think we can take some more of that out of your way. So here's what we're going to do. So let's get rid of this really quick. and we're going to build out that application we talked about and I'm going to show you some things. All right. So, first of all, let's throw our client in there just kind of small here. And this is where you have you've got a calendar on here and you've made your you've said, "Okay, I agree to come in and get my eyes checked, you know, whatever. >> See where you're going." >> Okay. All right. You with me? Okay. So, you you agree to that appointment. So, we're going to do the appointment. So then what happens is that in serverless that's going to then send a message to what we call API gateway or Amazon API gateway to be exact. Right? So that API gateway is going to be the router. It's going to be the firewall. It's going to be the load balancer. It's going to be you can do your authorization and authentication. actually your authorization uh and then it'll check with your authenticator. But basically it's taking a lot of those out of your way and it's a service that can handle tens of thousands requests per second. Uh it's very very fast. So we call that the front door to your application. All right. Sure. This is security and routing and all that. So then the next thing we're going to do is is in in our particular thing, it's going to call we'll just call a lambda function, right? So we'll put some arrows in here to help. So there's our lambda function. So when you agree and you hit submit, it's going to push that to API gateway. Then that API gateway is going to invoke your Lambda function. Now by invoke it means remember earlier I said hey create an execution environment grab that code and run >> getting you in. >> Okay. Exactly. That's the invocation right. So it's going to run that in that server. Okay. Good. Yeah you've got that. I know. Yeah you are. Okay. So then what's going to happen is we're going to write that information. >> Uh we'll write that just for the moment. We'll write it in a database. And in this one, I'm going to use Dynamo DB. There's a lot of options, but DynamoB is a great database for this. And it's going to write that out uh as an appointment. Okay, so here's what's really cool. Okay, and we're not going to go too far in this, but there's a thing called eventdriven architecture. We're going to talk about events for the moment. We've got an event that happened here. API gateway got an event. It said, "Hey, we got a call." and it sent that event to the Lambda function. The Lambda function looked at that event and said, "Oh, this is a schedule request. Let's save that to the database." The database then said, "Oh, hey, I have an event. I've stored a new record." So, with that database, I'm going to actually invoke another Lambda function because remember, I can use these as I need them. So, let's make this a different color and we'll say invoke a Lambda function for scheduling. All right. So here's what it does is it's going to say let's go. So we invoke that lambda function. That lambda function is then going to call another service called event bridge. Event brbridge passes events or write in the name. And and these aren't things this really won't be on the test but these are services. Okay. And I'll explain where we would have done this in our code in just a minute. So that lambda is going to call event brbridge and it's going to create in the event bridge scheduler. It's going to create however many. It's going to say send a message on this date. Send a message on this date. Send a message. You following me here? >> Shall I add this to your calendar? >> Exactly. Well, it's kind Yeah. Exact. So we're adding it to our internal calendar, right? And so then what it's going to do is when that happens, when that time comes, let's say so Monday morning at 9:00. Monday morning at nine o'clock, Event Bridge is going to go, "Oh, I have something to do." >> Indeed, it is. >> Hang on a minute. Yes. And it's going to come out. It's going to say, "I'm gonna call," and we'll do this again. I keep it in the top there. We're going to call yet another lambda function. We'll make it green. And this Lambda function, his whole job, so let's do an arrow here. His whole job is to call one more service, and that's going to be SNS. Okay. SNS is simple notification service and it has the ability to send text messages. Aren't you glad? >> Oh yes. >> You're welcome. >> I feel important. >> I will tell you you're welcome from from all of us here at at AWS. Uh so then what we'll do is when the Lambda function calls that, let me get my arrow. Then it'll do it'll call that and then SNS will actually be able to send an SMS and it will then send that right to Mama J. >> Yeah. >> Okay. So, let go ahead. >> I get that. And you know, I guess I'm glad I understand the need for that. We need to be reminded. >> Okay. Remember, we're just the technology. >> Yeah, I know. >> Yeah. Okay. All right. So, let me explain this again. So what we would normally do is in our code if we did this without all this we would say okay I'm going to have to run and it's called a cron job every minute I'm going to have to come up look at a database see if there's any events if there's an event then I have to write the code to send a message to mama j okay so I'm having to save this data and I have to run that chrome tab and that has to be in a server that's running all the time and I'm paying for run but what instead what we've done is we've said with API gateway that'll handle our security and be the front door. It's going to invoke a lambda to write data to Dynamo DB uh and save that data in there and have all my information. I didn't have to say uh you know call call them you know five times. That's part of my business logic because when that Dynamo DB has that record of that event it'll send it to this Lambda and that Lambda knows oh okay she has an eye appointment. Let's text let's text her 72 times about that eye appointment. Let's do >> so let's put in 72 events into our event scheduleuler. Right. >> But how do I know that that is private? >> Ah okay security. Yeah, I mean that's my appointment. I don't need everybody to know I had that eye appointment. >> Okay, great question by the way. Okay, so like before when we talked about securing things, what we're going to do is there's a couple things that are going to happen, right? So let me get a let me get a box here. So we're going to first thing is the communication from you to API gateway. We're going to make this dotted here. So okay, that is secured through S what we call SSL or secure socket layer. So you know how we have HTTPS? >> Yes. >> Okay. So that is a secure tunnel between you and API gateway. Okay. >> Just me. >> Just you just your client here. >> Just me. >> Right. So the next thing we're going to do is we're going to say okay so behind the scenes if you want to you can turn this on or off is you can encrypt those th that information behind the scenes as well as it's communicating. And so this is this is what we call encryption in transit. Okay. >> Okay. So as data is traveling it can be encrypted. Then when we actually store that data because the data is being stored now not your credit card data uh just your appointment data. Credit card data is a whole different thing. There's a whole compliance and we don't have enough time in this one to do that. That's going to actually encrypt your or we're going to do what we call encryption in at rest in Dynamob. So inside the database if I don't have the key to read that it's all garbled. It's all encrypted. So I have to have a key to do that and that key can be provided by Amazon or you can provide your own. Uh and so that's how we secure that. So that security I won't draw box all of them continues all the way around back to you. >> Okay. So it is totally guarded. >> It's locked down. It's secure. All right. So does that make sense on services? So now we've got one, two, three, four, five unique services that are removing code that I don't have to code for because event buses. So there's a thing called an event bus in code where I can say, all right, if something happens, put it on the event bus. You can do that in code. It's just a lot of code. There's software for it. You can install and do that. >> Sure. >> What we've said is, hey, we'll just build build a service that you can talk to to do that. The same with SNS for sending what that's called the term is called pub sub meaning publication subscription. I'll create a publication if you want to know anything about me you subscribe to it and that's again code that we've replaced with a service. So the idea here is reduce your code by using services. Use services first and then code when nothing yeah when all else fails then code. Okay. Okay. Does that >> So, should I be asking my doctor's office if they use AW? >> You absolutely be using them or at least ask them how are you securing this data? >> Well, I it is a concern. >> Yeah, absolutely. Yeah, it's it's an absolutely fair question. All right. So, that kind of wraps up services. Does that make sense to you? >> Oh, yeah. I'm going to apply. >> You're going to apply. You think you're ready to be a developer? >> Um, some stuff. >> Some stuff. Yeah. You got it all locked in. >> Uh, I will. All right. Okay. >> All right. Fair enough. >> Okay. So, I just threw a ton of information at you. How do you feel? >> Do you remember when you used to look at me like, "Yeah, I hear you, but I don't understand everything you're saying. >> Is that how you're feeling?" >> No, I I do understand a lot of it. >> Okay. >> You know, I mean, it's making sense in a way that I don't think it did before. >> Good. >> Uh I'm probably not going to apply for a job in this field. Well, that's fair enough. I appreciate it. But at least when people ask you what I do. >> Yeah. >> And the technology I work with >> can come up with something. >> There you go. >> Something other than I don't know. He just is it has to do with computers. >> That's right. But now you know serless. >> I do know that. I'll show him my shirt. >> That's right. Show him your shirt. And that's a wrap on Serless with Mama Jay. How you feeling? >> I feel like you're a pretty good teacher. I think your dad would be really proud. >> A thanks, Mom. I appreciate that. If you want to learn more about serverless, hit serverlessland.com and subscribe to this channel for [music] more videos like this. Thanks and we'll see you next time. >> Bye >> bye.
Original Description
Curious about serverless computing but find it confusing? Join Eric and his mom, Mama J, to learn about serverless computing and AWS Lambda in a way that anyone can understand.
Follow AWS Developers!
🆇 X: https://go.aws/3OY962D
💼 LinkedIn: https://go.aws/4lquGcb
Learn more about Serverless: https://go.aws/4di4Epd
00:00 Introduction to Serverless with Mama J
03:45 Understanding Traditional Servers
09:30 Introducing Serverless and AWS Lambda
15:20 Benefits of Serverless Computing
22:15 Real-world Serverless Application Example
31:40 AWS Services in Serverless Architecture
38:55 Security in Serverless Computing
41:30 Conclusion and Recap
#AWS #AWSLambda #Serverless
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from AWS Developers · AWS Developers · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Using Microsoft Active Directory across On-premises and Cloud Workloads
AWS Developers
What is Cloud Computing with AWS? | Hebrew Webinar
AWS Developers
Best Practices for Getting Started with AWS | Hebrew Webinar
AWS Developers
Best Practices for Using AWS Identity and Access Management (IAM) Roles
AWS Developers
Building Scalable Web Apps | Hebrew Webinar
AWS Developers
Dev & Test on the AWS Cloud | Hebrew Webinar
AWS Developers
Storage & Backup on AWS | Hebrew webinar
AWS Developers
Disaster Recovery on AWS | Hebrew Webinar
AWS Developers
AWS Israel News | Episode 1
AWS Developers
Security Best Practices on AWS | Hebrew Webinar
AWS Developers
Ready: Introduction to AI on AWS | Hebrew Webinar
AWS Developers
Set: What is ML for developers? | Hebrew Webinar
AWS Developers
Go!: Building your own ChatBot with Amazon Lex | Hebrew Webinar
AWS Developers
And Beyond: Amazon Sagemaker | Hebrew Webinar
AWS Developers
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech Talks
AWS Developers
Understanding AWS Secrets Manager - AWS Online Tech Talks
AWS Developers
Best Practices for Building Enterprise Grade APIs with Amazon API Gateway - AWS Online Tech Talks
AWS Developers
Build, Train and Deploy Machine Learning Models on AWS with Amazon SageMaker - AWS Online Tech Talks
AWS Developers
AWS Israel News | Episode 2 | re:Invent
AWS Developers
AWS Floor28 News - January
AWS Developers
AWS Floor28 News - February - Hebrew
AWS Developers
AWS Floor28 News - March - Hebrew
AWS Developers
AWS Floor28 News - April - Hebrew
AWS Developers
AWS Floor28 News - May - Hebrew
AWS Developers
Authentication for Your Applications: Getting Started with Amazon Cognito - AWS Online Tech Talks
AWS Developers
AWS Floor28 News - June - Hebrew
AWS Developers
AWS Floor28 News - July - Hebrew
AWS Developers
Enriching your app with Image Recognition and AWS AI Services - AWS Webinar - Hebrew
AWS Developers
Personalize, Forcast, and Textract - AWS Webinar - Hebrew
AWS Developers
Managing Your ML Development Lifecycle with Amazon SageMaker - AWS Webinar - Hebrew
AWS Developers
Running your ML code in Amazon Sagemaker - AWS Webinar - Hebrew
AWS Developers
Get Started in Minutes with Amazon Connect in Your Contact Center - AWS Online Tech Talks
AWS Developers
AWS Floor28 News - August - Hebrew
AWS Developers
AWS Floor28 News - September - Hebrew
AWS Developers
Deep Dive on Amazon EventBridge - AWS Online Tech Talks
AWS Developers
Advanced Serverless Orchestration with AWS Step Functions - AWS Online Tech Talks
AWS Developers
Living on the Edge - an Introduction to Amazon CloudFront and Lambda@Edge - Hebrew Webinar
AWS Developers
AWS Floor28 News - October - Hebrew - YouTube
AWS Developers
What's New with AWS Storage - AWS Online Tech Talks
AWS Developers
How to Build a Compelling Migration Business Case Using TSO Logic - AWS Online Tech Talks
AWS Developers
Configuring and Managing Amazon S3 Replication - AWS Online Tech Talks
AWS Developers
AWS Floor28 News - November - Hebrew
AWS Developers
Using Relational Databases with AWS Lambda - Easy Connection Pooling - AWS Online Tech Talks
AWS Developers
AWS Floor28 News - December 2019 - Hebrew
AWS Developers
AWS Floor28 News - January 2020 - Hebrew
AWS Developers
Top 10 Data Migration Best Practices - AWS Online Tech Talks
AWS Developers
How to Use Azure Active Directory with AWS SSO - AWS Online Tech Talks
AWS Developers
AWS Tips & Tricks - Amazon Redshift Advisor - Hebrew
AWS Developers
AWS Tips & Tricks - Amazon Redshift Elastic Resize - Hebrew
AWS Developers
AWS Tips & Tricks - Amazon Redshift Spectrum - Hebrew
AWS Developers
AWS Tips & Tricks - Savings Plans & Cost Explorer - Hebrew
AWS Developers
AWS Tips & Tricks - Amazon Redshift Concurrency Scaling - Hebrew
AWS Developers
AWS Tips & Tricks - Training Models with Amazon SageMaker - Hebrew
AWS Developers
AWS Tips & Tricks - Auto Model Tuning with Amazon SageMaker - Hebrew
AWS Developers
AWS Tips & Tricks - Amazon Comprehend - Hebrew
AWS Developers
Understanding High Availability and Disaster Recovery Features for Amazon RDS for Oracle
AWS Developers
Amazon Forecast – Forecasting - From Months to Days (Hebrew)
AWS Developers
Visualize your data with Amazon QuickSight (Hebrew)
AWS Developers
Amazon Kendra (Hebrew)
AWS Developers
AWS Floor28 News - AI/ML Special Edition
AWS Developers
More on: AI Workflow Automation
View skill →Related Reads
📰
📰
📰
📰
Episode 3: High-Level Design
Dev.to · surajrkhonde
Rate Limiting Like a Jedi: Mastering System Design Basics
Dev.to · Timevolt
The "Optimal" Order Book Data Structure Lost by 288 on Real Market Data
Dev.to · Umang Pokhriyal
Cache em memória e compressão de dados: o equilíbrio que todo dev precisa dominar
Medium · Programming
Chapters (8)
Introduction to Serverless with Mama J
3:45
Understanding Traditional Servers
9:30
Introducing Serverless and AWS Lambda
15:20
Benefits of Serverless Computing
22:15
Real-world Serverless Application Example
31:40
AWS Services in Serverless Architecture
38:55
Security in Serverless Computing
41:30
Conclusion and Recap
🎓
Tutor Explanation
DeepCamp AI