Serverless Architecture using AWS Lambda | Tech Primers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to tech primers in this video we are going to see what our surveillance architectures so imagine right there is no server and you want to deploy your code your code is running there and there is no server out there which is running currently so how is that architecture sounds right so this sounds crazy isn't it so that is what Cerberus architecture is all about so basically serverless architecture is the design pattern or a day where your process will be running in there your function will not be executed until it is called or basically it is triggered so if you notice here currently I have the website from Martine folder so if you don't know who Martin follows Martin folder is a developer like us so he's an octa basically so he the visionary I would say so he currently works in sort works so he has a his own idea of how you should design stuff how how you should do a gen software development he has lots of credits in taking sessions and coming up with proposals and stuff so I'm a big fan of him basically so that is I am using his particular website to just explain you what civiles architecture is ok so he currently works in thought work so if you want to follow him you can check his website Martin Volcom he has very good articles on every topic if you notice he has lots of videos design document related topics as I related topics refactoring related topic so he is the one who created a book called refactoring in in the 1990s and it became famous and then like how we call now write refactoring so that is how it became famous so let's come to the main topic for this particular organization so it's the service architecture so as I said earlier service architecture is where you will not be running a server full time ok so your execution will be triggered based on an event or or an action ok so basically it can be called as back-end as a service basically you don't have anything running okay your code is lying out there if somebody calls that particular code then it will be execute okay it can also be called as function as a service so basically you write function and those functions can be executed at that instance then there is something coming and triggering right so what happens most of the time in production right if you had worked in any company or 30 hi you know that okay all your processes are running they're in production but you never know that then liquid comes into your production machine right and it comes with re that that's what we know right and then for that we always keep on running and if you know cloud is all about how much ever time you are utilizing that that measure that much amount of money you have to pay right so that is why people thought of serverless architecture as a dead fit so basically what server logs the service architecture says is you don't have your server always running so whenever there is an event or a action which is triggered for this particular function you trigger the function only when it is required okay so basically at that particular instance your function will be spawned in a server and you have to pay only for the time with which it ran on a server so basically that is that is the seventh architecture so actually as the name suggests there is no server but you have to use the server at some point eight so that is then you trigger an action ok so that is why it's called server this architecture but imagine that terror there are servers it will be running on servers only but it could be used only when it is triggered so basically your imagine that your JVM is down and then you a request comes in your JVM gets alive processes that request will get returns a response back and then it goes for sleep so that is how it what we called you can visualize it okay that is how it works so there's this big upset from departing follows website okay is the article from the martini follows website so there are lots of information about why you need and stuff like that so I'll just cover some basic stuff so if you have worked on applications which are MBC's right the client-server architecture so you would have noticed that we have a browser then we have a back-end server and then we have a database so we notice yeah this is our current architects other side so you have a browser you have a back-end server which is rendering the request from the browser and then giving it back right and then you have a database with from which T so fetches the data and then sends it back to the browser so in terms of service architecture how we will design it we will start splitting our service into multiple micro services and we use whatever we want as a function so if you notice here there is a client browser you have an authentication service separately with which you authenticate your server ok once it is done you go to the Gateway so gateway is where all our routing happens ok the Gateway is go to route it to a specific function so if you want to purchase it goes to a first stage function if you want to search the retail store it goes to the search function so that is why if you notice here these are serving as architecture so basically purchase function and search functions are server love and then you have a database so once your function called the database you can process the data and open it back right so that is this is how serverless architecture will look like when you are splitting this particular architecture ok so basically we are saying that split based on functionality ok and those functionalities can be put inside a function ok so that there is no harm for it to run independently right there are lots of other things I am NOT going to go through that but I will show a typical example of where the serverless architecture is already used and who is the big player if you notice here I have already opened the website so Amazon provides something called a double use lambda ok if you're familiar with AWS area blur is a cloud in the next the next story which runs on the infrastructure as a service platform right so it is the infrastructure and service offering from Amazon so similar to that Amazon provides AWS lambda which is nothing but a function as a service or a back-end as a service offering also you can it's already live in production basically so Amazon is offering that for free it's not free but you can kind of for free for some time but here so what it does is whatever we is talked about right so it provides you a functionality to store your functions inside the AWS lambda and and it will be triggered based on an action or event if you notice here that is what they say so a WM a tobias lambda lets you run code without provisioning or managing service you can you pay only for the compute time you consume and there is no charge when your code is not running which is a major advantage right so most of the time our processes are idle and you don't have to pay for that right so with lambda you can run code for virtually any type of application or a back-end service all with zero administration just upload your code and the lambda takes care of everything required to run and scale your code with high availability you can set up your code to automatically trigger some other aw services or they're called directly from any website or mobile name okay that is what the lambda says aw is lambda safe and if you notice here what are the major advantages of features of AWS lambda is more servers to manage so literally you don't have to manage the server so if you're if you're bugged in an IT company I would I would say that okay definitely we would have had a chance to see a server log into a machine manage that server make sure the health of a server is good and make sure that is not going down and solve is available all these six pivotal maintain right so that you don't have to do of a variable yeah we don't have to worry about the server management in the a SS lambda would so it is all taken care by D lambda itself okay cutting miscarriage so you can scale your application so let's say you wrote an you wrote a function okay and that particular function is taking triggered by thousand people at the same time okay you don't have to worry about that because a double use lambda automatically scales so literally it can spawn thousands of threads or thousands of servers parallel so that each request is individually handled okay so you don't have to worry about that in a traditional operating system water we do we are running on a server and if the memories out of memory is like exceeding that limit we won't be able to do it or we have to have a global load balancer and then load balance between two different servers and different data centers are within the same data center we have to split based on that right and we have to scale down later or we have a we have to keep them running idle in idle state because always you might not be expecting high volumes like high volumes or practice so that we don't have to worry about in a Douglas lambda because underneath the lambda infrastructure it is going to be AWS cloud so the spawning of servers are going to be cloud thing so you don't have to worry about T scaling as okay and then sub second meeting so based on the a success right so based on the time you will be charged so that is what this is all about ok so how does it work so you just need to upload your code a database lambda so currently understanding what a doubly slam data so you have to place your code in the end of this lambda that is the only restriction right now which I see because your code is going to result in somebody else's data center okay so from there you can spawn based on and event basically any rest endpoint call or based on a file push or any mobile app connectivity or something like okay so that is how it gets triggered and then you are lambda function processes the data and then sends it back okay and then you pay only for the processing time for each function that's it okay so if you notice here these are just some implementations of their you can use them X and lambda so for example data processing you can use a to base a lambda execute code in the response in the X you decode interest in response to a trigger such as changes in the data ships in the system state or actions per user so a taqueria the trigger point for the a double is lambda would be changes in the data or a shift in the system state basically or any action by an user basically any destined phone call or anything okay and if you notice lambda can trigger directly sugar can be triggered by a delay services using s3 DynamoDB connects ssns and cloud watch ok the Charro's used to directly call the serverless data directly from the aw isn't she okay so that is what they are providing same a real-time file forcing you can do that as it we can get the file push to to s3 and s3 triggers a at a place lambda function you can process the data immediately and then you can do whatever you want with that basically you can upload the data back again or do something with it so you can literally have s3 as a trigger for a wh lambda processing as well okay so the other one is the real-time stream processing so kinases is the real-time streaming system which amazon has so you can push the data there and then these lambda functions are triggered and you can store them in the DynamoDB and then process that data okay so basically you can you use it for ETL processes if you know what is an ETL ats stands for extract transform and load so most of the places you would have noticed that they have the our process will be dating for a file and based on the file arrival the process the data right so what are what do we do we always wait for the file and our process is always running most of the time right so you don't have to do that because all these aw is lambda features are triggered based on an event basically if a file is that I automatically a function gets spawned and then you do the X transform some one load so you don't have to keep on running your sources instead you can go to serverless architecture and then a formal Amazon provides AWS lambda which turns up but in future I expect every other company trying to solve this serverless architecture problem and then they come up with some open source software which you can use and leverage and try out okay so that is it so that's all about PA SS lambda so I'll just summarize what we discussed so a SS lambda is basically an architecture where you provide function as a service so you don't have any servers running so you just give some function which is sitting out there so that will be get triggered based on an event or a state change or a file change or something like that okay or a trigger so based on that your aw lambda function will be executed in case we saw were delayed of those lambdas or a double is lambda users functions so you just create functions and keep it in the lambda infrastructure and then they have triggered by any event which you have configured and based on that a server will be spawned and your function will be visited on the server and it then goes to sleep so you have just pay only for the time when the server was running and then your function was using that's all that's it okay so that is the server this architecture okay hope you understood if you liked my video go ahead and like it if you haven't subscribed to the channel go ahead and subscribe and get regular updates from the channel so that's it for this particular video thank you
Info
Channel: Tech Primers
Views: 12,139
Rating: undefined out of 5
Keywords: techprimers, tech primers, aws lambda, serverless architecture, lambda pricing, aws lambda function, function as a service, FaaS, backend as a service, BaaS, lambda function, cloud functions, microservices architecture, serverless, no server architecture, aws functions, aws lambda intro, serverless architecture tutorial, serverless architecture example, server less architecture, what is aws lambda, what is serverless architecture
Id: Bta2MEy7kHM
Channel Id: undefined
Length: 13min 47sec (827 seconds)
Published: Fri Jun 09 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.