Exploring the Next Big Thing in Cloud
Lecture 52 Serverless Computing - I
Estimated read time: 1:20
Summary
In this lecture, serverless computing is introduced as an emerging paradigm in cloud computing. Distinguished from traditional setups, serverless computing allows developers to run code without the headaches of managing the underlying infrastructure. It offers a model where backend services are provided on an as-used basis, freeing developers to focus on the core business logic without infrastructure concerns. Key topics include Function as a Service (FaaS) and Backend as a Service (BaaS), illustrating how they allow event-driven, scalable, and efficient execution of code in isolated environments. The lecture discusses the benefits, such as cost-effectiveness and focusing on business logic, while highlighting potential challenges like asynchronous calls complexity and maintenance issues. Popular platforms like AWS Lambda and Google Cloud Functions also feature in the discussion, painting a picture of serverless computing's growing impact.
Highlights
- Serverless computing is the newest buzzword in the tech world, shifting focus from infrastructure management to core logic. 🌟
- It offers developers ease by allowing them to code without server setup complexities. 💻
- Key models include 'Function as a Service' and 'Backend as a Service'. 📦
- Providers like AWS and Google ensure seamless scaling and execution of functions. ⛅
- There are challenges, such as asynchronous calls and shared code risks, needing careful management. 🧩
Key Takeaways
- Serverless computing is revolutionizing cloud technology by abstracting the server management. 🚀
- It makes coding more enjoyable as developers now focus on business logic, not servers! 🤓
- FaaS and BaaS are key models in serverless computing—providing flexibility and scalability. 🔄
- Major players in the field include AWS Lambda, Google Cloud Functions, and Microsoft Azure Functions. 🌐
- Watch out for challenges like complex debugging and the risk of hitting size limits! ⚠️
Overview
Serverless computing is causing quite a stir in the tech industry, largely because it allows developers to offload the headache of managing infrastructure. Instead of worrying about servers, they can focus on fine-tuning business logic and core functionality, which is exactly where their talents are most needed. This new model of computing provides backend services on an as-used basis, which marks a significant shift from traditional cloud computing methods.
The lecture delves into Function as a Service (FaaS) and Backend as a Service (BaaS), two pivotal components of serverless computing. By allowing developers to deploy and execute functions in high-level abstractions without managing operational logic, scalability becomes effortless and more cost-effective. Companies like AWS, Google, and Microsoft offer robust platforms to support these services, ensuring developers can take advantage of the serverless benefits while enhancing their productivity.
Despite its advantages, serverless computing is not without its challenges. The complexities of asynchronous calls, maintaining functions, and potential cost implications require careful consideration to manage effectively. However, the prospect of writing code that seamlessly scales and operates efficiently is enticing for many developers, suggesting that serverless could play a major role in the future of computing.
Chapters
- 00:00 - 01:30: Introduction to Serverless Computing The chapter begins with a continuation of the discussion on cloud computing from the previous session, focusing on the topic of serverless computing. The instructor references previous topics on computing paradigms to set the context for the current discussion.
- 01:30 - 03:30: Serverless Computing Models and Paradigms The chapter introduces serverless computing as a major emerging area in the computing domain, highlighting its popularity and the increasing interest it has garnered within the industry. It mentions that this topic is being widely discussed in conferences and journals, underlining its significance as a trending buzzword. The lecture aims to explore this contemporary paradigm in depth.
- 06:30 - 08:30: Role of Containerization in Serverless Computing The chapter delves into the concept of serverless computing, focusing on its relationship with containerization. It introduces two key terms associated with serverless computing: 'Function as a Service' (FaaS) and 'Backend as a Service' (BaaS). The discussion sets the stage for a deeper exploration of these concepts in subsequent lectures.
- 11:00 - 12:30: Advantages of Serverless Computing This chapter explores the concept of cloud computing as a utility, highlighting its characteristics and different service models. It delves into Infrastructure as a Service (IaaS) and Platform as a Service (PaaS), indicating how these models are integral to cloud computing. The chapter aims to provide a foundational understanding of the advantages inherent in serverless computing by examining these cloud service models.
- 13:30 - 22:30: Function as a Service (FaaS) The chapter titled 'Function as a Service (FaaS)' explores the concept of Function as a Service, a subset of Software as a Service (SaaS). It highlights the transition from on-premise computing to hiring computing infrastructure, emphasizing the need to still provision certain elements like virtual machines and operating systems during development. This infrastructure method focuses on simplifying and streamlining computing needs by offering scalable functions rather than complete application hosting, which is beneficial for development and deployment processes.
- 22:30 - 27:30: Backend as a Service (BaaS) The chapter titled 'Backend as a Service (BaaS)' discusses the dependency of developers on servers, whether they are personal or cloud-based. It highlights the significant investment required in terms of time, expertise, and sometimes money, to configure and manage these servers efficiently.
- 31:00 - 47:00: Challenges of Serverless Computing The chapter discusses serverless computing, which is a new paradigm in backend services. In serverless computing, backend services are provided on an as-used basis, meaning resources are allocated and built as they are used. This allows for more efficient use of resources and can alter traditional approaches to handling backend processes.
- 51:00 - 55:30: Popular Serverless Platforms In this chapter titled 'Popular Serverless Platforms', the transcript discusses the advantages of using serverless providers. It explains that serverless architecture allows users to write and deploy code without worrying about managing underlying infrastructure. This simplifies code development and deployment, making it more efficient. The text mentions fast or bash type of things emerging in the serverless domain, indicating a trend towards more streamlined software performance. Overall, the chapter highlights the efficiency and simplicity offered by serverless architecture to developers.
- 55:30 - 58:00: Conclusion The conclusion discusses the benefits of eliminating the need for system administration, allowing developers to concentrate on core business logic. It emphasizes removing additional overhead by avoiding the instantiation of resources like instances or containers, as previously discussed in earlier classes regarding infrastructure monitoring.
Lecture 52 Serverless Computing - I Transcription
- 00:00 - 00:30 [Music] hello continue our discussion on cloud computing rather if you remember the last session or the last class we discussed on one of the computing paradigm ah so rather some of the this correlated or associated computing paradigms ah we are discussing in ah
- 00:30 - 01:00 this couple of lectures so today what we will take up is a serverless computing right there is a very emerging area and what we say that it is a buzzword which is there in this computing domain and having lot of interest you will find that lot of conferences and other journals papers are coming up on surprise this computing so we will try
- 01:00 - 01:30 to see what it is and rather in next lecture also we will see little more detail of the serverless computing right so we will be ah covering mostly the service less computing and what comes back to back with it is a function as a service even ah sometime a term ah called back end back end as a service right so ah these are the two keywords
- 01:30 - 02:00 so what we have seen ah in case of ah cloud computing so what we i see that computing as a utility right so all our things the computing as a utility and ah also what we have seen that we have different models like one is your is pass sas these are the predominant models right ah like infrastructure as a service and say platform as a service and ah
- 02:00 - 02:30 software as a service so this has different manifestation right ah so and what we try to do you from your ah on premise computing ah infrastructure you are hiring the computing infrastructure but if you look at in several cases we need to still provision the thing right like provision a v a m provision that what sort of a os etcetera underline you need look at when the development is going on and things like that or rather
- 02:30 - 03:00 whether it is a your own server or a cloud server you still are ah linked with the server primarily i mean to say the developers are still linked very much linked with the server and need to have a lot of [Music] say quote unquote ah in investment in terms of time and expertise ah you know sometimes this money that how the it can be configured to use it on the things
- 03:00 - 03:30 so this new way of looking at it new paradigm what we look at is the serverless computing so let us see that in some of different aspect how how try to have a fill of the things that what it tries to say so its a computing method of providing backend services on as used basis right as as i am using or as i go on using the thing it has been built or
- 03:30 - 04:00 charged based on the things so the back end services right so the serverless provider allows users to write and deploy code without the hassle of worrying about the underlying infrastructure right so the infrastructure management is being taken out as by the serverless provider right so we will see that how this ah fast or bash type of things which is coming into so serverless architecture simplifies the code development and development and deployment and
- 04:00 - 04:30 eliminates the need of system administration allowing developers to focus on the course be core business logic what it is looking what he or she is looking for ah without creating additional overhead like instantiating the ah resources such as instantanes or containers what we seen couple of ah classes back containers in monitoring the infrastructure right so what what what what it tries to
- 04:30 - 05:00 do that ah that co developers ah should be involved in developing the job rather than looking at the that back end services or the back end management and monitoring issues right so if we can segregate this or if we can provide this type of a service things will become much what we say beneficial to these
- 05:00 - 05:30 developers or for developing and deploying their applications now what we see in this model the developer execute their logic in form of functions so what we try to do that their logic is some sort of a function and submit to the cloud provider to run the task in a shared run time environment right so more develop the logic as a as a function so what we are looking as a
- 05:30 - 06:00 going towards that means giving as a function as a service and submit that to the this ah service provider to ah in a set runtime environment so cloud provider manages the scalability needs of the function by running multiple functions in parallel right so it one may one way of looking at it that the if i want to scale now ah suppose you want to scale in other way you need to look at you need to think about that ah
- 06:00 - 06:30 the whole thing right whole ah base of the back end etcetera right how things will scale and things like that right so you you still the provider will provide in as a as a i service provider or pass or service provider but nevertheless you need to look at the ah what we see that scaling factor but here ah the provider basically take the scale of things based on the type of ah by like one is that running multiple function in a in parallel
- 06:30 - 07:00 right rather we will see that it is something um which is going little bit overlapping of or something what ah past type of service provides right but we will see that where it goes so following the wide scale application so one one thing what ah emerged out in ah recent times is that wide scale proliferation of this quantum containers right or the services provided by the in form of containers that that ones the things which is what
- 07:00 - 07:30 we see in last ah say couple of years or so right so wide scale application of the containers we have also seen that how easily you can take the container from a from say windows to linux to say any cloud platforms what they say from your desktop to laptop to cloud it works in a seamless fashion you do not have to go ah install the things of the of installing the things but nevertheless
- 07:30 - 08:00 you need to load boot ah and if there are orchestration of the things multiple things need to be orchestration that need to look at like if you remember that ah our previous couple of class when we back when we are discussing about containers especially the example scenario where we have taken up two container containers one from one is that your ah mysql and ah phpmyadmin from
- 08:00 - 08:30 this docker hub and then we can run if the docker this engine is running so you can run up front right but still you need to run that docker engine right so that is there but nevertheless this container has given a different dimension to deployment of different services especially looking at the micro services and things like that so following the wide scale application of containerization approach the cloud service provider adopted to offer a
- 08:30 - 09:00 better fitting containers that require less time to boot right so it is something ah the container needs to ah wake up so bill or what we say time to less time to load or boot and to provide increased automation in handling orchestration that is another challenge containers on the behalf of the client right so there may be ah challenges of orchestration of different services so how it can be it can facilitate that
- 09:00 - 09:30 that is another ah challenge which need to be managed by the we need to be realized by the or ah the client right client want to have that orchestration of services to basically realize a particular ah outcome so serverless computing promises to achieve full automation in managing fine grained container right so what we coin the word called fine grain so this ah this our serverless computing promises or
- 09:30 - 10:00 attempts to achieve this full automation in finger containers in quick loading or booting of the things ah or automatic or handling better handling or in automation in handling the orchestration or containers orchestration of containers services and things like that now ah
- 10:00 - 10:30 so if we if we again ah try to look in that in a in little bit whatever we have ah discussed so far so serverless computing is a form of cloud computing so we are trying to realize another ah a form or model of ah cloud computing that allows users to run event driven and granular applications right so tiger by the event so event driven and granular application without having to address the operational logic right so
- 10:30 - 11:00 underground whatever the back end operational logic is there user are not bothered but it it can trigger this event driven ah and granular applications so serverless as a computing abstraction ah if we look at so with serverless developers focus on high level abstraction as we are discussing like function queries events like that and bit application that the ah that the infrastructure operates map
- 11:00 - 11:30 to consent this concentrated resources and supporting services so what it is the developer is ah trying to do it only it basically focuses on the business logic or what we say that high level abstractions of the things like at the function level or you can look at the query or ah event level and build application that the infrastructure operator or the service providers map to the resources and the supporting services right so you build your
- 11:30 - 12:00 functions and instead of bothering that how it should run on the thing the service provider or the server less service provider so to say they take care of this mapping to the actual resources and this other supporting services if if there are any so developers basically focus on the core business logic and ah [Music] and on ways to interconnect the elements
- 12:00 - 12:30 of business logic into complex workflows so whenever we do have a ah have a ah particular ah application in mind so there is a definite workflow right so the developers bothered about the overall business logic and how to interconnect this workflow to achieve something right so that that is the ah that as such the developer doing along with that you do not have a you do not have to manage the back end so so service provider ensure that the serverless applications are orchestrated
- 12:30 - 13:00 that is ah it puts into put into container deployed provisioned and available on demand see this is interesting right so this that the back end it takes care of how it the containerization has to be done how it need to be deployed how need to be provisioned and how it can be made available on demand so while billing the user only for the resource used right whatever the resource is used that may be the billing
- 13:00 - 13:30 anyway that is a billing procedure how things will work that is one thing but the backend thing is taking care of all these things ok so this is this is the way we want to say what i can say that segregate or isolate this infrastructure management of a cloud ah like say vam and other things along with that application development so or even
- 13:30 - 14:00 container management things etcetera taken care of the end so ah when two terms come into play we will see that one is a function as a service and another is a backend as a service right so when we look at the function as a service so client of the serverless computing can use as a can ah basically use this function as a service model so what when you talk about face is a form of serverless computing so its
- 14:00 - 14:30 a its a form of a serverless computing in which the cloud provider manages the resource life cycle and even driven execution of the user provided functions so the users or the client provide this function and the cloud provider or the serverless computing providers takes care of the [Music] resources needed life cycle of the this process and event execution of the
- 14:30 - 15:00 hm this ah sorry user level functions right so those are taken care by the ah cloud provider for exa like we can so with function as a service so user provides small statelet functions to the cloud provider which manages the operational aspects of running thing function right so as if you can realize that to realize your overall applications you have a number of functions which are you know the work flow but you
- 15:00 - 15:30 are not not bothered about or are not concerned about how they the containers will be made how it will be deployed how this overall based on the workflow this overall orchestration of the back end things will be there that you are not bothered right so one example available in this ah reference like consider that x camera so it is considering some camera application which uses cloud functions and workflow to edit transform encode videos with low
- 15:30 - 16:00 latency and cost so the whole application that in this [Music] so called this cam this video application or camera application what is what the application is named as x camera so what it is ah doing it is basically wants to edit transform in code videos with low latency and ah say minimal cost so that is the overall ah objective of this ah application and which is being taken
- 16:00 - 16:30 care by this serverless things right so a majority of task if you if you see ah in this operations what we if we look at even x camera or any type of applications can be executed concurrently right some of the things i can we can execute like if the if there is a transmission of ah some videos or something i can do ah parallel transmission or ah several things suppose i do some frame
- 16:30 - 17:00 by frame operation some of the things we parallel frames wise or a group of frames and things like that we can do right so even encoding etcetera so wherever the parallelization is ah possible right so can be but there are lot of opportunity of parallelization executing concurrently allowing the application to improve its performance through parallelizing this task right so the if the if we have that type of ah function as a service then ah say executing multiple things by the
- 17:00 - 17:30 provider may ah improve the overall performance of this particular applications right so ah though the picture is not good you will find in this the references ah whatever given at the end so if we look at that evolution of serverless computing starting from nineteen sixties when we are having this ibm systems so in seventies this virtualize and other things ah
- 17:30 - 18:00 were coming up then one we see that in 80s this rpc [Music] implementations and rpc things were in the high note that is that remote procedure calls then in 90s what we see that what what that private this virtual private servers and all those things are ah
- 18:00 - 18:30 are coming up in a big way and along with that there are other things like on the other side cgi if you see that resources code function naming and registry services ah functions execution flow and different type of aspects and what we see in 2000 is that ah this containers linux containers and other things were where aws cloud all those things came up google app engine and though all those surfaced and
- 18:30 - 19:00 and 2010 onwards what we are looking at that more prodification or a big way purification of ah container services like google ah sorry ah docker came in from 2013 and then kubernetes and so and so forth and other things like is pass sas type of cloud which services cloud based services came in a big way in a what we say
- 19:00 - 19:30 what we can what we say that it is something which is deployed or being used right initially it was more of a organization's own uses but it becomes as a public services right so public at large or or city means different organization can have this type of third party services of the ah of services right on the other hand like if you see on the events so that even driven
- 19:30 - 20:00 architecture also 2010 onwards we see that lot of activities there also so taking together what we look at that orchestration ah this container orchid station and micro services is one part which which which which are ah coming ah came up or what we see its a booming thing in these days and which basically lead to this
- 20:00 - 20:30 formation or realization of a function as a surface model and on the other hand we see that event driven workflows right so we have a business workflow or my application which is even driven so this things what with function as a services trying to realize this event driven workforce or this together is basically lead to this serverless computing paradigm right
- 20:30 - 21:00 which we see right so though it it is came up from the ah is a ah say model based on this cloud computing paradigm and leverage on different thing these cloud computing things but nevertheless what we see that it came up in a this event driven workflows and other side this function as a service type of things so so if we look at that in serverless
- 21:00 - 21:30 computing ah cloud provider dynamically allocates and provision servers right so servers are there right so only thing you have abstraction of the things and try to realize that thing right the code is executed in almost tests ah stateless ah containers ah that are even triggered or even driven and ah may be ephemeral like like last for one invocation and things like that right so
- 21:30 - 22:00 if we as we discuss the serverless attempts to cover a wide range of technology primarily grouped into two categories one is that back end as a service another is a function as a service we have seen or we have discussed something on the function as a service right so in this brought to categories what we try to see so as the backend as a service at it the name itself ah implies enables to replace the server
- 22:00 - 22:30 side components with of the self services right so instead of ah looking at the server side component we are more looking at that services in terms of say functions and things like that right so bass enables ah developers to outsource all the aspects behind a syn of an application so that the developers can choose to write and maintain our application logic in the front end so in other sense
- 22:30 - 23:00 this all this back end load is now taken care by this ah back end as a service so i require this type of environment for my code it takes care of the things so typical ah examples example scenarios remote authentication system database management cloud storage hostings which are going at the back end of the ah things right rather those who have used that google firebase you may
- 23:00 - 23:30 have seen that is a fully managed database that can be directly used from an applications right so that the firebase ah google firebase ah i think it takes care both means nosql and relational model both please look into it i i as i remember what i was telling so google firebase is a but it is a fully realized database right where you can quickly connect to other
- 23:30 - 24:00 applications and ah means quickly connect to especially this web applications and things without ah very seamlessly right so in case of this firebase ah as a say back end services as a database and things like that so manage data components on the u on users we have right so whatever the data etcetera is there this firebase takes care of the backend services right so
- 24:00 - 24:30 this is the this the thing which we look at when we ah look at the back end as a service and the function as a service already we discussed so the serverless applications are event driven ah cloud based systems right so ah it is no we are considering that over and above ah means basically my cloud system is in ah place where application development relies slowly on combination of third party services right client side logic and cloud hosted demon procedure call
- 24:30 - 25:00 see we are not talking about any server etcetera here right so it is a third party services client site logic the basic business logic and the cloud hosted rpc or remote persist procedure calls right so fast allows ah developers to deploy code that upon ah being triggered is executed in a isolated environment so once the it is triggered so it is as if ah is executed on a server mode so that
- 25:00 - 25:30 that the things it tries to ensure so function are so each function typically describe a small part of the entire applications right so i have the applications what we realize is as a ah a bunch of functions and each function takes care of a ah a chunk of this application the execution time of the function is typically limited right so ah like ah if you look at aws lambda it is
- 25:30 - 26:00 typically i think 15 minutes or so so it is based on the the type of things it is the execution time is limited so function are not constantly active instant fast platform listen for the events that initiate the functions right so function are instantiated whenever that ah things are that platforms are ah this it is triggered right so thus the function are triggered by events such as ah client request events
- 26:00 - 26:30 produced by any external system data stream and other things like that right so it is it is triggered by the events like like in the camera application and i do not know that how only it works but it can be event by a movement ah of a any object of the things it is getting triggered it is not like that every time it is capturing and ah edit a filtery means capturing storing filtering the image ah videos etcetera but nevertheless it is triggered by something right it is it can be triggered by a some object
- 26:30 - 27:00 movement it can be triggered by something that predefined time of ah switching on the cameras and so on and so forth so the fast provider is then responsible to horizontally scale ah function execution response to the number of incoming events right so based on the number of incoming events the past ah this your fast provider will scale up the things right so like having different parallel execution of the
- 27:00 - 27:30 of the function and like that so there are ah if we look at there are ah not all good things there are few there are several challenges or there are several what we say [Music] um not so ah good things about this serverless computing so one is that asynchronous call like atkins got a call to and
- 27:30 - 28:00 between the serverless functions ah increase complexity of the system right so it is as synchronous so usually remote api calls follow request response model and it is easier to implement with synchronous call if there is mean synchronous call it is easy to implement but if you have asynchronous call then there is a challenge in it function calling other functions that is another challenge that complex debugging lose isolation of features extra cost if functions are called
- 28:00 - 28:30 synchronously as we need to pay for two functions running at the same time that is a billing or cost wise thing but ah nevertheless it becomes a more complex situation there are issues of shared code between functions so might break existing serverless function that depends on the shared code that is that is changed right so it is based on the on some shared code and that the shared code has changed now it has to do visitor to execute the things so risk to heat image
- 28:30 - 29:00 size limit like ah typically aws ah lambda the 50 mb is the image size limit or warm up time the bigger they made ah longer it it takes to start or load or become active so there are ah issues like that so uses of too many libraries right so so increase ah space used by the libraries increase the risk to heat image size limit and so and so forth so
- 29:00 - 29:30 too many libraries adaptation of too many technologies right such as different libraries ah different frameworks languages now you have become very flexible right you are telling that lot of things need to be all all my back end work is maintained by the provider i only write the function based on my business logic rest it be executed so it becomes ah too many technologies may be involved so add maintenance complexity and increases skill requirement for people working within the project right so
- 29:30 - 30:00 that who are working in the project or who are at the maintaining the things required more ah very means ah skill ah full people right and at times there may be too many functions though that that that already we discuss creation of function without reusing the existing one so non active serverless function does not cost anything so there are a temptation that you keep ah create new function instead of alternating the existing
- 30:00 - 30:30 function to match change requirements right so decrease maintainability and lower system understandability right so what happened a running system if you are using so what happened that it goes for ah different change requires and go on updating now in this case if you if you see that so long the function is not instantiated so executing so what we have we have the whatever it is not you are not paying for that right so while a new
- 30:30 - 31:00 new functions or new change request or something new is coming so it is a there may be a tendency of updating this function a not to update create a new function and deploy because you you do not want to disturb the previous functions and type of things right one may be that one psychology may be that that if sometime it is coming to use you can use so what happened too many functions ah comes into play and it creates a problem of maintainability and of course also
- 31:00 - 31:30 overall understandability of the system especially when you are handovering to some other things and like that so these are some of the issues i or faced by the serverless computing in this paradigm so just to look at there are there are popular ah things there are many more so like aws have a um what we say around lambda ah
- 31:30 - 32:00 platform whereas google has a like google cloud functions or cloud functions for google ah in the google cloud and microsoft azure is as your function so these are the popular things which are which are there and which [Music] and there are several others right [Music] means environment but these are pretty popular things there are few open source stuff also that which you can
- 32:00 - 32:30 use for this serverless computing so google if you see that we have virtual different virtual servers these are the functions and there are databases and also different type of storage services right which is the there ok so what we is we are what we try to see that what is the over overview of the serverless computing paradigm ah how it helps say developers
- 32:30 - 33:00 to develop and deploy their applications looking at the core business logic in a more efficient and fast method ah and the is being build or charge for the instantiation of that function instead of ah the whole ah infrastructure what it is what it has taken out so with this let us conclude our discussion today there are few references ah
- 33:00 - 33:30 some of the other things are taken from the internet may be so so these references are you can have a look on the things so let us conclude our discussion today we will continue our discussion on serverless computing in the next session thank you