Discover the World of Serverless Computing

Lecture 53 Serverless Computing - II

Estimated read time: 1:20

    Summary

    In this engaging lecture on serverless computing, the instructor provides an in-depth look at the evolution and advantages of serverless platforms like AWS Lambda, Google Cloud Functions, and Azure Functions. Serverless computing abstracts the complexities of server management, allowing developers to focus on code rather than infrastructure. This shift empowers developers by reducing operational overhead, with major providers offering serverless environments that operate on an event-driven basis. The lecture covers the fundamental principles, architecture, and practical applications of these platforms, while highlighting the importance of serverless computing in modern software development.

      Highlights

      • Deep dive into serverless computing platforms like AWS Lambda, Google Cloud Functions, and Azure Functions đŸŒŠī¸.
      • Understand how serverless shifts the focus from infrastructure management to application logic 🌈.
      • Discover the event-driven nature of serverless platforms and how they optimize resource usage 🔄.
      • Explore how serverless architectures only charge for active usage, offering significant cost savings 💡.
      • See how serverless computing is changing the landscape of software development 🌟.

      Key Takeaways

      • Serverless computing hides server management complexities, allowing developers to focus on coding 🧑‍đŸ’ģ.
      • AWS Lambda, Google Cloud Functions, and Azure Functions are leading serverless platforms 🌟.
      • Serverless solutions operate on an event-driven basis, enabling efficient resource utilization ⚡.
      • Developers only need to pay for what they use with serverless architecture, making it cost-effective 💰.
      • Serverless computing is revolutionizing the way developers build and deploy applications 🚀.

      Overview

      Serverless computing is transforming the software development landscape by removing the burden of server management from developers. In this lecture, various serverless platforms, including AWS Lambda, Google Cloud Functions, and Azure Functions, are explored. These platforms provide a robust environment where developers can focus on writing application logic while the infrastructure concerns are handled by the service providers.

        The lecture emphasizes the event-driven nature of serverless platforms, where functions are triggered by events in cloud services. This allows for a highly scalable and efficient use of resources, ensuring that developers only pay for the compute time they actually use. By abstracting the infrastructure layer, serverless platforms also simplify the deployment process, making it easier for developers to bring applications to market.

          As serverless computing becomes increasingly popular, it is reshaping how applications are built, deployed, and managed. The discussion in this lecture provides valuable insights into how these technologies work and the benefits they offer, such as reduced operational overhead, enhanced scalability, and cost-effective pricing models. These advancements empower developers to innovate faster and more efficiently.

            Chapters

            • 00:00 - 00:30: Introduction to Serverless Computing The chapter introduces the concept of serverless computing, a continuation of the previous class's discussion on different computing paradigms, particularly focusing on cloud computing.
            • 00:30 - 01:40: Popular Serverless Platforms and Their Features The chapter focuses on serverless computing, highlighting various popular serverless platforms available in the current market. It emphasizes the utility of these platforms for conducting small experiments, often aided by the provision of free credits. Despite a common underlying philosophy, the chapter explores the distinguishing architectural features of each platform.
            • 10:00 - 19:30: AWS Lambda: An Overview The chapter titled 'AWS Lambda: An Overview' introduces the concept of serverless computing, focusing on AWS Lambda as a key example. It provides a recap of serverless concepts and discusses the offerings from major cloud providers namely AWS Lambda, Google Cloud Function, and Azure Functions.
            • 19:30 - 27:00: Google Cloud Functions: An Overview This chapter provides an overview of Google Cloud Functions in the context of other popular cloud service providers like Amazon AWS Lambda and Microsoft Azure. It highlights the competitiveness of Google Cloud Functions in the global cloud service market, comparing it to its counterparts from Amazon and Microsoft. Additionally, it mentions the existence of several open-source platforms, though Google Cloud Functions, AWS Lambda, and Azure Functions are noted as some of the most widely used options in the industry.
            • 27:00 - 31:00: Azure Functions: An Overview The chapter provides an overview of Azure Functions, highlighting the ease of creating a login and using the service. It mentions that while the service is chargeable, some free credits are available. The chapter also revisits serverless computing, emphasizing how it abstracts server management for application developers, simplifying the use of cloud resources.
            • 31:00 - 33:00: Serverless Architecture Patterns The chapter 'Serverless Architecture Patterns' discusses the convenience serverless architecture brings to cloud software development. It highlights how developers can focus on building applications without being concerned about server configurations. The serverless approach provides a layer of abstraction for application developers, simplifying cloud-level development.
            • 33:00 - 43:00: Common Serverless Scenarios The chapter discusses the growing importance of serverless computing in the context of cloud-based platforms. It emphasizes the ease and convenience offered by serverless architectures, which eliminate the need for backend configuration. This trend is driven by the widespread adoption of cloud applications, necessitating solutions that simplify infrastructure management.
            • 43:00 - 44:30: Conclusion and References The chapter discusses the focus of cloud computing, specifically targeting system administration. Cloud computing aims to simplify system administration tasks, allowing people to benefit from easier configuration and maintenance. Additionally, the chapter touches upon the concept of serverless architecture, which targets different objectives.

            Lecture 53 Serverless Computing - II Transcription

            • 00:00 - 00:30 [Music] hello ah so we will continue our discussion on cloud computing or rather the different computing paradigms what we were discussing ah if you recollect in the last class ah we discussed about serverless so in this class we will have an a little more
            • 00:30 - 01:00 discussion on serverless computing specifically ah emphasizing on some of the popular serverless platform which are available at present and you can also use those you can basically handle on those platform ah to have small experimentation most of them give some ah free credits ah that providers so we will see those platforms right what are the basic philosophy and what are the basic architecture though their basic philosophy is same but they
            • 01:00 - 01:30 may differ ah in some minor aspects so so what we discussed about is ah we will be discussing about the serverless computing little ah whatever we discuss little ah recap of the things and then primarily we will be taking up three things aws lambda google cloud function and azure functions so which are serverless paradigm which are provided
            • 01:30 - 02:00 by ah amazon aws nematode lambda is a amazon is the service provider ah cloud service provider global provides this blue gold cloud functions and microsoft azure ah comes up with this ah azure functions right so these are some of the popular there are several other things even there are few open source platform also but these are popularly used and
            • 02:00 - 02:30 you can easily create a login and start using it ah though that will be chargeable but they do have a some free credits so these are the things what will be discussing so just we let us continue our discussion little bit recap so if you recollect so serverless computing primarily it hides the servers by providing programming abstraction for application builders that simplify cloud
            • 02:30 - 03:00 development making cloud software easier to write so what it is telling that ah a ah developer or a programmer is not ah bothered about the the servers or server related configurations right so it is basically hiding the servers from it and then providing [Music] by providing a programming abstraction for the application builders or application developers right so that this cloud level development becomes
            • 03:00 - 03:30 much easy this is becoming important these days because most of the cases we are ah moving towards this cloud-based platforms right so that that the huge purification of this cloud based application and cloud based platforms basically triggers the need having a a a basically a platform where i do not have to bother about the backend configuration
            • 03:30 - 04:00 management and etcetera so here the focus or the target of the cloud computing if you see ah was system administration and system administration is one that to make that overall system administration is much easier type of things right like i configure a cloud computing and that i ah this basic system administration if i maintain then people can leverage on those things right whereas serverless serverless basically targets to us the
            • 04:00 - 04:30 programmers so they are basic focus is not the administrators they are the programmers right so in case of a cloud computing the ah if we look at that type of ah personal we are looking at the system administrator here the programmers right there are lot of other features definitely this change requires the cloud provider to take over many of the operational responsibilities need to run applications right so if you if you if
            • 04:30 - 05:00 you want to give a platform to the programmer so that they can easily develop or programmer or developer or builder so to say so that if they can easily develop their application so the responsibility of the cloud service provider is not only now providing vms etcetera now they have to give them operational responsibility of applications something it sounds ah like ah pass right so they are also we try to provide this sort of a environment where they can develop ah
            • 05:00 - 05:30 they develop their application etcetera yes that is that is their overlapping but will see that we have seen that there are some differences so serverless computing to [Music] this in order to look at the change of focus from servers to applications right so the change of focus is from servers to applications this paradigm is known as server less although remote server etcetera are there
            • 05:30 - 06:00 right so in order to say that this is ah this is not ah some some of the literature mention them as a server full computing like our traditional or that ah existing cloud computing framework has server full computing right though that those are that will create confusions we are not want to give names like that but the serverless wants to emphasize that the now ah the focus is on the applications
            • 06:00 - 06:30 not the ah servers right the this phase or this new phase of cloud computing or new paradigm or the variant of this cloud computing will change the way programmers work as dramatically as cloud computing change the operators works right so if you if you see or if you are you could have you if you are ma if you are managing your ah system administration of your ah or some ah sort of a system
            • 06:30 - 07:00 administrator of your organization or looking after system etcetera now once you move to the cloud the way things has to be done has changed right so similarly when we look at the serverless the way the programmers will work will change our programmers or coders or developers will work will change dramatically when we look at the server less computing right so thus serverless
            • 07:00 - 07:30 applications are one that do not need any server provisioning right but ideally there is no need of server provision and do not require to manage servers right i do not have to manage servers the managing servers means managing their not only different type of configuration os networks etcetera ah i we do not have to do that i need to focus only of my so called business logic for which for the logic of the
            • 07:30 - 08:00 application that is required here right now ah in the last session or last class if you remember we discussed some of the major players right so three major players here aws cloud google cloud and azure there are other things other still major players like ibm and so and so forth right there are many many players but primarily we
            • 08:00 - 08:30 ah these are some of the popular things and they are they lot of lot of [Music] programmers lot of coders developers use this platform ah that is why we take enough there is no specific reason for that you can the philosophy still remains the same right so if we see the virtual server so in case of a aws so we say that as aws instances or virtual machines ah
            • 08:30 - 09:00 and vm instances in case of a azure now so the function ah or what we say that ah cloud functions or function as a service but where which basically ah enables the serverless computing in case of a aws we call it lambda aws lambda service in case of a google google cloud functions and in case of microsoft azure ah
            • 09:00 - 09:30 it is as your functions right and they do have their own databases though they can connect to other databases like here amazon dynamodb is their basic database which basically have a storage of a back to back storage of s3 amazon s3 whereas in case of google they have a global cloud data store and
            • 09:30 - 10:00 they google do have a cloud storage and in case of a azure as your have that as your cosmos db right as we as your cosmos ah database and in the storage they have s3 they fall back to the s3 or they can utilize the s3 and type of things right so rather our main ah today's discussion hovers around this three functions right so we will see that the philosophically they are same
            • 10:00 - 10:30 because all are trying to ah provide or provision serverless computing platform and but there are there may be ah certain difference of their working path so we start with aws lambda so aws lambda is an event driven right serverless computing platform provided by amazon as a part of amazon web service or aws right so it is a ah event driven serverless
            • 10:30 - 11:00 um computing platform right so thus ah if you look at you need to ah you need to worry about thus one need to worry about which amazon resources to launch or how to manage actually you sorry there may be ah there is a typo that you do not need to worry about that aws resources to launch or how to manage them instead you need to put code on the lambda and runs right so the
            • 11:00 - 11:30 somehow one that not is missing so one need not ah only need to worry about their that how this it will be configured where to launch and where the resources how to provision etcetera need to more worry about that logic of the code and ah just put the code on the lambda and it runs right so in aws lambda the code is executed based on the responses of the events on aws services such as
            • 11:30 - 12:00 so as it is event driven so that aws [Music] it is it basically the codes are tiggers or codes are lambda code code is executed based on the response of the events in the ews services like like some like it is add delete files in s3 bucket or http request from amazon api gateway so means there can be lot of ah type of things
            • 12:00 - 12:30 which are going on ah means events which can trigger right ah [Music] so however amazon lambda can only be used to execute background task as of now what we see that whenever so this background does come into things we want to execute those those tasks right so what we have seen its a event driven serverless computing and some sort of a this function is executed in response to
            • 12:30 - 13:00 some of the some events right so that is another thing what we ah see it here right so it can be something in the s3 bucket or http request of amazon api gateway etcetera now ah if you look at that big picture of the block diagram and there are components one two three four five different ah components marked will see that what are the role so aws lambda
            • 13:00 - 13:30 function ah helps you to focus on your code product core product right that means or on your ah business logic and instead of managing operating system access ah os patching right sizing provisioning scaling etcetera which i otherwise you need to bother about when you go for ah our traditional way of cloud computing right you or your ah
            • 13:30 - 14:00 that cloud administrator needs to bother about but here you just put your ah code and it start running right so if we look at the picture so one is that ah so this is the overall block diagram we will see what are the different components so first thing you need to upload your aws lambda code in any language supported by the aws lambda that means whatever the iw lambda ah platform supports you can the code it can be java it can be
            • 14:00 - 14:30 ah python go c has and other some of the languages there are supported right so these are ah which are popular language which are supported you can have other means other whichever the language supports by the ws you can use it so these are some of the in the 2 if you see this the down layer or if you go up this one like amazon s3 amazon api gateway dynamodb amazon sns right ah
            • 14:30 - 15:00 that amazon ah kernels and etcetera different things are there you will see these different type of operations you can have ah that different [Music] aws services which are there so what what it is there it is basically allow you to trigger aws lambda that means as we as see again that is even degree
            • 15:00 - 15:30 event driven so this events are generated by these things right so aws lambda helps you to load code so this aws lambda platform code and and the event details on which it should be triggered right so some like as we have seen that two things we are discussing as you add delete files on s three bucket things will be triggered or h p three request where http request which is ah from
            • 15:30 - 16:00 this amazon api gateway that can be triggered and there can be other triggering things also right so these are the aws services which can trigger this the aws lambda code which you have uploaded right so execute aw lambda code when it is triggered by aws services aws charges only when aws lambda execute code now the charging is only this whenever this aws lambda execute the code then the
            • 16:00 - 16:30 billing will be done not otherwise that means whenever it is not triggered and not executing deciding it is it is not there otherwise right so it is not charged so if you go to this what are the different components which we see when we execute a code one is that ah or this aws number combat component when you want to include the code one is the function a function is a program or a
            • 16:30 - 17:00 script which runs in a w s lambda right so lambda passes invocation events into your function which processes an event and returns to the response file returns this response right so that means the code you upload so there is some event generated by your aws services and that is good so there are some run times runtimes allow function in various languages which runs on the same
            • 17:00 - 17:30 base execution environment right so it helps to configure your functions in in runtime it also matches your selected programming languages right so it is the things whatever the programming languages you are using for the coding there are event source and even source is aws service what we have seen that aws in ah sns can be one simple notification service or custom service that this triggers function helps you to executes its logic
            • 17:30 - 18:00 ok lambda layers lambda layers are important ah distribution mechanism for libraries custom run times and other important function dependencies these are the lambda layers and you finally need the log stream allows you to annotate your function code with custom logging statements and which helps you to analyze the execution flow and performance of the ah your aws lambda code or functions right so that is the log stream for
            • 18:00 - 18:30 analysis for password field so these are the ah different ah concept which comes with lambda if you see that many of these things are there in there but in in their nomenclature where you go to other type of service provider and running or executing is straight forward if you have many if you have a login in the aws is great otherwise you can create one login and then ah basically
            • 18:30 - 19:00 hm ah sort of edit your code and execute nothing ah nothing is required everything is everything will be managed by the backend this your aws lambda bracket next one we would like to see this google cloud function as we mentioned google also provide the serverless computing so google find function is a serverless execution environment for building and connecting
            • 19:00 - 19:30 ah cloud services right so that is the environment provided so with ah google cloud google functions you write simple single purpose functions right ah that are attached to events emitted from your cloud infrastructure and services right so this is this you can ah right write this in the google cloud function is a trigger when an event being watched in the ah is
            • 19:30 - 20:00 being washed is fired so if when again this is also ah once even is is fired the the cloud function is triggered right so the code execute in a fully managed environment there is no need to provision any infrastructure or worry about the managing the service so you see now we are looking at a higher level than the at the server ah like i that more specifically on the code level right ah like whatever is rick whatever the dependencies etcetera are taken care
            • 20:00 - 20:30 by these ah platforms that whether it is amazon aws lambda or google cloud function or as amazon a sorry ah azure function so those are ah taken care by those things so this is one ah very simple ah overall example or scenario of the functionality so we have cloud services this is the cloud ah google cloud
            • 20:30 - 21:00 platform ah cloud platform ah so which emits events like in case of amazon you have seven that aws services right and various ah services services like google cloud storage google cloud publication and ah subscription pops up ah stackdriver google data store etcetera those are in that ah different cloud google cloud services part right and they all have events that happen
            • 21:00 - 21:30 inside them for example if a bucket has got into a new object ah uploaded into delete it from the metadata is being updated etcetera so those are the events which are being these are the event generator things and in case of the function that is the cloud function say an event is generated or fire or emitted the even data associated with the event has ah information on the basic event that the metadata sort of things eventually associated with that
            • 21:30 - 22:00 even metadata for that event if the cloud function is configured to be triggered by that event if your cloud function is ah configured that it will need to be triggered by that even then the cloud function is invoked or run or executed right based on that thing right so as a part of its execution the event data is passed to it so that it can decipher ah what has caused the event that is the event source gate meta information for the event and so on and do this
            • 22:00 - 22:30 processing right so there is at the part of that cloud function as a part of the processing it might also may be invoke other apis ah like it can be a google api or other external apis right so while processing the things it is possible that you want to invoke other apis right not only google apis external apis that is possible right it can even write back to the cloud services that is another thing right so if required it is not a
            • 22:30 - 23:00 one way traffic ah it can write back to the cloud services if required right so when it is it has finished executing its logic that is your code the cloud function mentions it ah or specifies ah that it is done so it is basically once it is done it ah flag that it is done so multiple event occurrences will result in multiple invocation of the cloud function if there are multiple events ah so multiple
            • 23:00 - 23:30 obviously multiple invocations will be there this is all handled for you by the cloud functions infrastructure right you focus on your logic instead of the functions ah and be a good means keeping your function in a single purpose use minimal execution time etcetera in other sense you manage your functions in such a way it is basically ah executed in a more efficient way do not
            • 23:30 - 24:00 bother about the environment much right so it is only need to work on that type of programming environment which is supports and rest is taken care so it indicates that your model based in a stateless fashion right so if you look at so things like it is a stateless person right so is even when the event is there if your if if your function to be triggered by the event then it is triggered right
            • 24:00 - 24:30 so rather ah you can maintain your state out of means outside this framework right so you can maintain the state in outside the like in ah say m cash or somewhere you can maintain the states so what we see that events and ah triggering so events if you see that ah they occur in cloud platform services for example file uploaded to a storage a message published in a queue direct http invocation etcetera this can be
            • 24:30 - 25:00 ah that several ah events and tigers you can choose to respond to a event via a tigger right so whether you respond to a your function so tigger is the event plus that is associated with the event based on the event and the data the metadata information with the events the tiger can be fired even data this is the data that is passed to your cloud function when the event trigger results in your function execution so once it is
            • 25:00 - 25:30 executing so the data to be ah passed to your function to that can that is is the event data so even ah providers ah is there that all that what we have seen right different ah services right and that tiggers and the data is passed to the cloud functions that google cloud functions where your code are starting
            • 25:30 - 26:00 so there are ah some of the event providers ah like ah one is the http ah that is the one of the popular things invoke functions directly via http request right so that is the provider what we see pretty popular not only here in other context also there can be cloud storage cloud pub sub as we mentioned there is a
            • 26:00 - 26:30 firebase those who have used firebase you can you might have seen that is a database analytics authorized authorization all those things are maintained by this firebase stackdriver login cloud firestore google compute engine bigquery so these are the different ah cloud services google cloud services which are ah quote unquote event providers right so now finally let us look at that ah
            • 26:30 - 27:00 as your functions right so the it's a serverless solution that allows you to write less code maintain less infrastructure and save on cost right instead of worrying about the deploying and maintaining the servers the cloud infrastructure providers [Music] provides all the up-to-date resources need for needed for your applications so if you look at the basic philosophy remains
            • 27:00 - 27:30 same right so concentrate on your code and less ah maintain less infrastructure and less configuration issues and type of things right so that is that is the bottom line right so user focuses on the piece of code and azure like others ah serverless platform handles the rest of the ah things right so a function is a primary concept in azure function right a function contains two important piece your code which can be written in a variety of languages and some
            • 27:30 - 28:00 configuration that like function dot json which are stored in the function generation and things like that right so for compiled languages this config file is generated automatically from the annotated annotations in your code for scripting language you must provide the configuration itself right so that depends that whether it is a combined language or a script what you are running right so as your function
            • 28:00 - 28:30 ah helps you in build your own functions so there are different resources ah available like use your preferred language ah write functions in c has java javascript python etcetera etcetera ah or you can use a custom handler to use virtually any other language right so those is there but these are the things which are supported and may be the most efficiently handled
            • 28:30 - 29:00 automate deployment from a tool based approach ah to using external pipelines there is a ah a a huge amount of deployment options available right good amount of ah deployment of options available ah troubleshoot a function ah use monitor tools and testing strategies to gain insights in your own app flexible pricing options with consumption with the consumption plan you only pay
            • 29:00 - 29:30 while your functions are running while premium and app service plans offer features of the specialized needs so that means you pay when it is running same thing if you remember we discussed when we discussed about google or ah amazon ah same thing was there you pay only for the execution of the ah this aws lambda when it is there right otherwise you are not charged for the things
            • 29:30 - 30:00 so common serverless architecture plan or a pattern is that the serverless apis ah mobile and back ends right ah event and stream processing iot data processing big data and machine learning pipelines right and so we can have different type of backup
            • 30:00 - 30:30 like serverless api or mobile and web backups or different improcessing event and stream processing right integration and enterprise service bus to connect line of business systems publish and subscribe to business events automation and digital transformation of the process automation and so and so forth right so it is it is ah so different ah type of ah architectural options are there
            • 30:30 - 31:00 different types of patterns are there right like if we look at some ah one two common scenarios like web app back end what we are looking at is like little scenario where we have request made in a web app request queued in the service bus and then go for this function function a function process the request sends out the output to the cosmos db and things like that right or like mobile app back end
            • 31:00 - 31:30 thing back in where we have a financial service scenario right like we have http api call from mobile app call processed by a function output data goes to this cosmos db and data transfer tiger second functions right so if you want to do a data things is stickers functions which sends notification to the note that notification hubs etcetera right so ah
            • 31:30 - 32:00 there can be several other scenarios where you have something where the event is generated and the this function is triggered and then output are based on the type of output the either it is stored or it is ah means going for like here output stored in the cosmos cosmos db data transfer tiger second function and type of things right so that based on that what sort of ah
            • 32:00 - 32:30 applications or what sort of ah serverless applications you want to run right so with this let us ah [Music] conclude our today's discussion so these are some of the references from where i have taken not only the um this different figures for this our ah discussion purpose and also we have
            • 32:30 - 33:00 we we that helps us in coming up with this discussion document so what we is you can go through these documents every every provider have their own things and there are lot of other documents which you will get over the internet so let us conclude our discussion todays discussion here we will continue this looking at that different computing paradigm in the subsequent classes thank
            • 33:00 - 33:30 you