5 Things Developers Should Know About Serverless by Alan Ho, Apigee

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right how many people here and actually played with serverless oh okay that's good it's a lot better than my previous talk okay my previous at a conference how many here are developers from Austin Texas oh great how many here are founders from Austin Texas oh great awesome okay we have a few in the crap all right yeah and just to show of hands how many people here have used containers okay so it looks like containers definitely very interesting to people all right just a show of hands - because it's 20 minute talk I just want to give it would you prefer to have a cool demo or when you hear like to prefer to hear production deployment so like a production employment such as Autodesk for a cool demo please urge at hand okay and then for production deployment story okay so which I do a bit both okay yep good morning everybody there we go alright so my name is Roscoe kolinsky I'm here helping out with note school this afternoon so are you you are learning interested in learning node or sort of honing your node school on your node skills drop by node school which is can be just down here at the end of the hall from one till three and I'm here today I'll be the emcee for this room for the rest of this morning session and I'm here excited to introduce Alan Howe from Google which can you talk about service alright so there's a bit a lot of talk about server let's say this is a cool new technology a lot of vendors are pup are pushing it really hard but you know the question is what does it really mean to a developer and isn't really any different like I'm ready being bombarded with all these container technologies do I even should I even bother about server list so is it ready yet well I just wanted to give you like five things you should know about server list and give a more high-level overview about from an architectural standpoint how we're coming to this to to the server lists so just a little bit about myself I founded a company in Austin Texas called in stops it was an API company that did performance monitoring got a choir by a company called Apogee in San Jose and just two weeks ago got acquired by Google so for all those founders out there keep on hustling for all the startups in Austin keep on hustling it's it's going to be really hard to actually go there but you know you're gonna you're going to be successful so what is server list I'd like to start with a definition of server list and if you go on the internet and google it I personally didn't find any good definitions that suit my criteria and what I believe server list is is a code execution model that the cloud provider abstracts the complexity of managing individual servers right and the reason why I'm going to talk about cloud provider is because server list really is a lot about money it's not not really about programming and we'll get it we'll get to that a little bit more so what are the attributes you shouldn't have to manage any servers right so even though there's a even-even serve services like relational databases a service that amazon has you still have to manage your individual servers is still based on servers whereas server lists you know you want to use services that don't make you have to think about servers you shouldn't have to think about low balancing and you should definitely be paying by request serverless really is the stack reimagined so and I'm gonna when I say the stack reimagined right we've always had this concept of networking compute and storage where as certain you know and it's and it's like many different iterations of it we're at so serverless you're networking a can't your communication is done via an api gateway or some sort of pub sub mechanism your compute is done by a function as a service and your storage or your databases is done by a back-end service so let me get into each of these components individually so what is function is service function of service is literally a place where you can deploy code to and that particular provider cloud provider would execute it for you now I think the big difference between let's say containers or VM technologies is that you're giving code you're not you're at your level of abstraction with interacting with the providers is deployment of code not a VM right so other other services out there even like container the container services from Google etc you're still giving in a VM and you know the VM and then the VM would execute the code whereas function the service you're providing code so today live you listen to a lot of functions service providers they may use containers underneath the hood but there's no reason why in the future when you give a code they can't take your code and then you know compile it down and push it up push it onto an FPGA right so I think in the next ten years you're going to see you're going to see server lists that under the hood technology of server lists for function of the service evolved very differently it's not going to be running underneath the hood it might not be containers it might be something totally different the other thing I want to talk about like the gotchas and one of the big gotchas for fun the service is that you have no access to the file system and that has a lot of there's performance reasons why they do that that it also allows the cloud providers to pack in more tenants on one place and still maintain security and it lets people boot up the underneath the hood it lets them boot up their containers a lot faster but it what it means for the developer is that things such as reading configurations from files that doesn't work anymore reading having your cash your in-memory cache spill over a disk that doesn't work anymore using your own monitoring write your own logging system that doesn't work anymore you're kind of forced to use whatever logging system they're built in so you really need to rethink about how your application operates especially at the time of Buddha and last but not least you pay by request there's a lot of interestingly enough all the major cloud providers I don't have IBM over here I just heard of a open whisk but a lot of the major product cloud providers have their own functions and service and they're all fairly similar so what about communication so when we talk about communication you're not thinking about putting in load balancers there's like the because you know underneath the hood you're not managing servers anymore and rather there's two levels of abstraction which is API gateways and pub/sub mechanisms so if you have a if you have an event that needs to be a synchronous request reply event you definitely want to have an API gateway in front of it you definitely wouldn't want to have use an API gateway it's also useful an API gateway is also useful for external events as well if it's a if it's a synchronous event then using a pub/sub mechanism is important so talking a little bit more about API gateway why do you want why would you need it so things that traditionally would be in your application is now actually pushed up into your API gateway a good example of this is mapping rest to RPC so if you think about if you actually look at the programming model from a function of service they they you need something to actually map your resources you know map your resources and the rest verbs you know get put post etc to your actual functions to your actual functions and this is probably better done in in the in the Gateway and there's other features that you also want to have in the Gateway that you want to take out of your application code these are things like ooofff you know rate limiting you know things of that sort security related things and some analytics as well that you want outside of your application code and rather within the Gateway itself so what is a back-end is service right like what is it this is this this could be construed as it actually a database is a service usually these are based on no sequel very high scale and from a limitation standpoint they usually limit the ability for you to configure the indexes so you're not going to have the index configuration ability of let's say an elastic search or a Cassandra but you get the fact that you have that the the trade-off is it's multi-tenant and you don't have to run those clusters yourself so let's give an example who's played with Pokemon okay know as the many as I thought as I thought so this is a graph it is about a graph of I think about two months when the Pokemon when Pokemon Niantic labs said hey we're gonna launch this game they gave the Google cloud platform team original target and a worst estimate and as you can see that it was 50x the original launch target after just two months I think they blew through their worst case scenario in 12 hours so these systems are extremely high scale okay what are the benefits biggest benefit money because you're leveraged it you're letting the cloud provider optimize the infrastructure for you right you're not managing the servers yourself they usually because they're optimizing across a lot of customers they're able to drastically reduce their costs and they usually push on say usually they usually push on the cot that cost-savings down to you so you get into you either you can read a lot of reports about customers are using actually I think yesterday that was a conversation bye-bye bustle talking about how much money they saved a lot of companies saved a lot of money the second big benefit is there's I would say no ops but there's definitely less ops when you have to deal with function the service sorry when you have to deal with serverless biggest example of less OPS's managing Cassandra clusters like because if you have like hundreds of micro services you want to have a separate database for each of those services because sharing database across micro services is kind of an anti-pattern well if you have to manage hundreds of databases individually that starts getting very very expensive so you know it this is les ops I want to say no ops and the last but not least is probably the most important is there's a drastically simpler programming model over you know simple programming simple programming model but with limitations this is an example of Autodesk they have a production deployment using a combination of Apogee ava's lambda SNS ATS SNS and dynamodb you can see here that they put a put a gateway in front of a lot of their services that they believe that are going to be reused in the future they don't put they don't put a gateway in front of all of them and you can see in order to it's it's it's they would to this previously would have been just one big monolithic system and they would split up into many many small services another thing to note here too is they use a lot of cues in between each of the services because if they make them all you know synchronous requests you know these could take a lot very long time and actually driving the cost to because you remember these for the functions of service your charge model is usually by request and how long each request takes so if you have a call if you have one request that's calling a blocking call right to another service that doesn't really need to be a blocking all you end up paying money for that while it's blocking all right so the big question is serverless versus containers I get a question about this all the time and I'm just kind of talk I want to talk to a real-world use case which is Autodesk why they have they have both and some of the considerations for both is for containers they had a lot of workloads that needed to access the filesystem Hadoop kind of kind of like Hadoop you know these are big big data kind of things so you know server list wasn't even an option and the other area is because you don't have actual access to control of the underlying operating system or even the environment so for example if you Zetas lambda you have to choose your you you choose which node version to use and there's usually behind for the longest time they've been like on I think node that they've been like one or two versions behind LTS all the time they're getting better though so you don't have access to it so if you need if you have specific libraries or you know high performance computing requirements that needs oh s level access or you know you know being able to customize your node environment you know you just won't be able to do that with serverless all right quick demo how many minutes do I have left okay great so I want to show you a bot that I created instead of doing BOTS I'm kind of sick of slack BOTS you know toys slack BOTS so I decided let's why don't we do a production bot so you can actually try if you have a laptop too you can do you can actually try this out go to action comm slash developers and what I was trying to we have a we have a bot on our you know we have live chat on our website and the way that we want to do our live chat experience is that we want some of the responses to be automated and some of the responses to have a real person answer it so things that are like you know brain-dead questions you know we want the bot to automatically do it but if it's a real person we wanted them you know a real person to actually answer the question so for example let's say I go hi all right what's that's actually ask another question oh wait actually sorry oh yeah okay so it said how do I run nodejs you could probably find out in our Docs so how did this actually work out let me just ask another question how do I run how do i implement OAuth is like one of the most common questions that people ask alright so how did that work so on intercom this is kind of our live chat application we created a web hook and then we basically select the messages that we want events that we want to get notified on the API gateway this is a pudgy edge we selected we were able to we basically are proxying cloud functions this is Google cloud functions and cloud functions is talking to a called API a I so API AI is another recent Google acquisition that does natural language processing so for example you can you can do things you can put in some example expressions like how do i implement OAuth and it gives a reply and this is the code that we that we use to actually implement it so it's fairly just going quickly through it you know we handle this is the event this is the function that we export out and that is going to be compiled and executed by Google Cloud functions it simply takes the conversation ID and the canta and the raw text from the from the conversation and it makes a request to API AI to get a response and you know if after it parses the response and sends to intercom the result so let's let's do it again one thing that we could do here is we can trace the requests and see what we get so I could do something like what features do you have all right so in the in the API gateway you have a set of analytics and you can also do tracing we can see here that there was a post to the intercom web hook post from the intercom web poke and you can see the you can see the actual JSON that's going through so this is one of the reasons why you may want to put a gateway in between is also because you got a lot of debugging capabilities and then if we go into the log files alright there's a lot of you guys testing right now who loves ice cream here come on alright okay so I asked how do i implement OAuth and it executed in about in just under a second and replied under a second so just to recap here are the five things you should know number one serverless isn't lambda or some vendor new technology but it's rather the stack reimagined it's a drastically simpler programming model and there are a lot of gotchas to can't access the file system limited access to tweaking your indexes it's all about cost you should you should see drastically reduced cost over let's say a container infrastructure or a vm based infrastructure and last but not least it's a lot of fun and just give you an example that that little application that i wrote i including learning cloud functions it took about four hours to implement and deploy into production alright thank you so we've got time for a couple of questions since this is all about cost and that makes sense to me is there a model in which you think serverless doesn't work for cost yeah so the question was you know when the serverless not work for cost what i what we typically see especially for large enterprises is that if you have if you have like if you have a workload so typically what happens is that if you're doing like this very small project it really makes sense to use and it doesn't have a lot of traffic it makes sense to use server list because you don't even know whether or not it's going to be popular or not so just just that that itself becomes very it's very very cost effective but if you have a system that you know is has some ridiculously high performance requirement and then you have the ability to optimize the code even at that maybe the operating system level right then it doesn't make sense to you server lists because you know you're getting massive utilization out of your servers underneath the hood so these things are underneath the hood I mean server list still runs on servers right so if you're if you're if you have a workload that's not elastic and that you can have and then you can at a lower level drive master optimisations and then it doesn't make sense these herbalist currently like developing you can run your doctor locally or you can run your node app just you know through bash or something like that how does developing locally change when you're going to a surrealist model do you have to connect to a third-party service just to develop no so that's the kind of nice thing as server list that you can actually for AWS there's a can't remember there there are local actually there are local testing you can run the functions locally on your own laptop and then you upload it actually I didn't show you how what it's like to actually you know load a function so this is so this is if you look at the this is basically the command to upload a a function so I would usually do all my testing locally on my own host and I would just run this g-cloud command and it would just package up the function and deploy it on the cloud the good thing too is that you know kind of the model for server list is you write individual functions and then you upload it so you it's much more iterative you you kind of deploy one function at a time yeah so good so like let's say I'm going from zero to app quickly I noticed a lot of the benefits are very similar to maybe some of the benefits that firebase is reporting so how does this as a product differentiate itself and so that I should choose this over firebase that's that's actually good I mean like you know what I'm trying to get here is server list isn't about function as a service server list is a stack right so I would consider firebase as a back-end as a service for serverless right so I mentioned firebase as a back-end a service to use right you want to think about that's why I'm trying to get the biggest point of the talk is that it is the stack reimagine so I like using cloud functions with with firebase would totally make sense it would be very very good to do one last question sorry he raises that first so the question is that is is there any standardization effort between the main providers today Google Cloud I'm Samantha there isn't a official standardization the question is is there a standardization effort going on and the answer is no but one sort of if you want to choose different clouds actually I really recommend checking out the serverless framework there's an open source server list framework out there and I'm not hundred percent sure if they bit their beta they're in development or their beta in the Google Cloud functions so that actually that framework is actually going to be working across multiple clouds but the good thing is honestly I've actually done both actually before this we got acquired by Apogee just Google two two weeks ago and I had to turn this demo from from a DOS lambda over to Google cloud functions and it didn't take a whole lot of time so I could tell you as a first-hand experience that the AP is are actually not too different great Thank You Alan [Applause]
Info
Channel: node.js
Views: 7,326
Rating: 4.8130841 out of 5
Keywords:
Id: Dh_UXXtSvjQ
Channel Id: undefined
Length: 25min 16sec (1516 seconds)
Published: Thu Dec 15 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.