 I'm trying to make your life simpler with the serverless talk and hold on, I'm trying to remember, what is serverless? Does anyone know? No. It's basically, it's basically you got someone else to do your serverless stuff. So it's serverless for you, but a cloud provider takes it over. And I guess my talk is about using Golang in that sort of environment. Because right now, Amazon, I don't think support Golang, for example, in London. So I'm going to tell you about using it at work. I work for a company called Spool, a competitor to VKish. We do Bollywood content, so if you're into Bollywood. The Koreans and the Bollywood fans. And what else? Yeah, we use this in production. I'll tell you how maybe later if I can remember. So what is serverless? I'm going to talk about Amazon Web Services. I must admit I'm an Amazon fanboy. There are other cloud providers I think, but Amazon is definitely the best. So the whole idea with this serverless is that you reduce your logic to something quite small. And then you upload it and Amazon runs it. And the idea is that it's like super low maintenance. You don't have to run the server yourself. You don't have to provision it. It should automatically scale to whatever that means. And you pay for what you use. So like for me, when I'm just doing these simple tests, I don't think I even like registered 0.01 of a cent. So now it scales. I was trying to get this SVG to scale. That's the stupid logo for 808's Lander. Every time someone mentions Lander, I'm just bought back to my computer science course book. I hate this book. Does anyone have to read it? Bullshit. That's not real life. Yeah, it is not real. Anyway, it's not this. That's good. Honestly, who had to do this one at school? Just a couple, yeah. If you were into a classical university, you probably would have. And now it's really out of scale. Maybe I can downscale it. Oh shit. I had something at the bottom of this. Oh fuck. Hold on. This is awesome. What is it? It's terrible. Look, you can all go to talks. That way you can convert to a comment and actually look at the slides on your phone. Anyway, so, alright. I was just trying to define what Lander was. Whatever. No, actually, yeah. Lander is, all it is, is utilizing Linux containers. And Linux containers sounds like some sort of virtualized VMware, but I think the best way to think of it is just running a process with a namespace. It's not a security feature. It's nothing very complicated. The cool thing is it's just isolated in a non-secure way, I'd say. And when you upload to Lander, the one thing you should note is that perhaps there needs to be a warm-up time when they get the containers going, so the initial performance can be quite bad. But otherwise, it works quite well. The whole Linux container, I mean, thanks to Linux last 12 volts and its minions, we have quite a cool technology being used that we can leverage. And I was going to mention, yes, it does currently only support, Amazon only support Node.js and Python, but there's a way of getting it to work with Golang because you can actually upload an AMD64 binary and get Node.js or Python for their matter to execute it. Another thing that should be noted about Lander is that you have all these restrictions and you just have to look them up. But for example, you can't have a long-running operation to get it cut out. Also, you can't, you have quite a limited storage. So, for example, at work, I work with videos. I would like to use Lander, for example, to encode videos, but that's a long-running operation with a lot of data. Not applicable to Lander. Don't use it for, that's not the right task for Lander. Unless you're running Google. Still, I don't think it'll be, you've got too much space. I mean, too big a file. So, what Lander is good for is event processing. So, something happens, you do something. These little bits of pieces that you just need to do at your workplace. That's what it's really good for. Let's go back to your slides, if it works. Oh, no. There's my browser. Is it under here? Is it here? Okay, Apex. Apex is a tool by this guy named TJ Holloway Chuck. Is that the way you pronounce it? TJ. So, I don't know about you, but I like my stars. Who likes David Beckham? Who likes Victoria Beckham? Anyway, I don't really like those people, but I do like famous people in this community, like Rob Pike, the guy behind Golang, Ian Hickson, the guy behind WhatWork Group and HTML, and Linus Twilvolt. I like these characters. They are probably sounding like a fanboy, and I am. But this guy, TJ Holloway Chuck, he has more than 500 NPM modules, and they're very good quality. This guy is a crick and savant. He's a machine! And he's behind Apex, so it must be good. And Apex, basically, as the tagline goes, allows you to build and deploy Lander functions with Go support. And then, yeah, basically, a Lander works off events. And if I could show you these events, it's probably never going to work. You get different sorts of events. I don't know who... Are you guys familiar with AWS? Because, for example, there's an S3 event. S3 is for your file storage. It's better than using a database. Hint, hint. There's the simple notification service, which is a simple way of just subscribing to a notification of some sort. And these... Basically, the whole Amazon infrastructure is primed with events, so you can basically conjure up things like, if a file is uploaded, you do something. Or if some messages receive, you do something. So in my workplace, for example, a new movie is added to the catalogue. And it hits my Lander function, and my Lander function uses Golan HTML templates to generate a static file that gets uploaded to S3, which in turn is cast on CloudFront, and then there's like a new entry in the website. For example. And then obviously, yeah, Lander functions are booted by events, but what they can do is kind of limited by their Amazon SDK, which is a lot more. So you can pretty much go to town on this sort of stuff. I thought I should mention there's another framework called serverless, which is a bit confusing, because it's like serverless technology, and there's a serverless framework. And I should mention it, because you can actually get Golan running binaries, running in serverless. And serverless does have some nice features, like setting up, attaching the events. Right now with Apex, you have to manually set up the events with the Lander functions, which can be a bit tedious. But to be honest, I'm also using serverless. I noticed that when you tear down and tear up, there are some bugs. I don't know who uses Amazon. I mean, CloudFormation. It's a nightmare. It's a goddamn nightmare. But yeah, it's something else to consider, and it has like a more comprehensive syntax. And it kind of helps you do local stuff, too. A little bit better than I think Apex does. But Apex is actually a little bit more dear to my heart, because it just wants to be a bit more minimalistic and just do one thing well. The Unix philosophy. So Apex is... I'm happy with the choice. This is where I will do a demo, but I thought to myself... What's serverless again? It's running in Lander functions. No, serverless is just a framework. It's written in Node.js. That's another hint. Apex is written in Go. It runs in Node.js. The code is really insane. Any Node.js project is insane. But anyway, so I wanted to show you guys a demo, and I actually bothered to record it. I'm not going to tell you what I was wearing this morning. Not very much. And I just thought out, I know you can't see that, can you? Basically, there's a file where you can change things like environment variables. For example, I changed the environment variable to my own S3 bucket. And then I created this bucket. This is so cool. I don't have to do any typing. Then I set up the website on that bucket. And then I deploy Apex deploy. There's some code there I probably didn't show you. It's just one simple file. I'll give you the link to the code. You have these convenient functions like Apex logs to see the logs. You have Apex metrics to see how much you run it. For example, I've run it three times. It doesn't even register as a cost. And then the big thing is you can invoke it locally just within an event. So what happens is that the event comes in and hits my template, and then it just gets uploaded to S3. So now I'm showing you the main.go. Yeah, it's boring. No, it goes fine. But to be honest, this templating stuff has been boring. How many lines of code is that? Too many lines, considering what it does. Another cool thing about Apex is that it doesn't hide things from you. You can actually see the build. You can see the Node.js that executes the binary. I like that. I like seeing everything. I hate it when things are hidden away from me. So hopefully I will just show you the output here. Just copying and pasting this URL. And boom, this is basically the template printing out what I sent. And then if I reload the Lambda console, you can see that I uploaded the Lambda function there. So it's a great way of managing your Lambda functions and way better than messing around with the Amazon console. Here I think I'm just giving you an example where I'm attaching an event. This is my screenshot bucket, so I have a bind on my keyboard. So I'm going to make a screenshot now. Actually, I made a mistake there. Damn, I think I put the wrong video in. Okay, this video shows you that you can't have two triggers on something. So I had to go and remove the trigger and then put it back on. But the idea is that once I take a screenshot, it will trigger an S3 event and then it will show up as a static file thanks to that Lambda function. Who keeps all their screenshots by year month there for the last more than 10 years? I do. It's great. It's a great way of figuring out what you've done. Yeah, so right now with Apex, you do this manually, but with serverless it does it all automatically, but you have to obviously put everything serverless. So now I'm taking a screenshot and then if I reload control R, there's the details of that event triggered by the S3 upload. And there's the key. And then if I load that key into the URL, you can see the screenshot. So I think that demonstrates everything, I think. Hopefully that wasn't too boring. Okay, caveats or what I learned along the way or hope you guys don't mess up like I did in waste time. The Apex and the one limitation of Apex is that you have to use standard error for logging, which is a bit of a pain in the ass. And the next thing that's painful is testing because I'm quite used to go test with my functions. So you can't really do that with this sort of structure. So I was chatting to some person who knows better than me and he says when you write Lambda functions, just think of them as shims. You don't put your logic in there, you put that somewhere else and you just keep your Lambda functions very minimalistic. So keep your logic out of it. And I also found authorization really tricky. I found when you're doing a real proper website, a real proper web application, you want to be able to have it multi-tenanted. Is that the right term so that you can have different user groups? I mean, if you're doing stuff seriously, do you shit like that? Unfortunately, it's kind of painful to do it like that because, well, anyway, it is painful. And obviously, AWS, you know, SNS, I mean, I don't know how familiar you guys are with S3, but a lot of this stuff goes over my colleague's head and they use it. You know what I mean? It's like guys, SNS, it's simple. But AWS and all this terminology, it's a new thing and yeah, it's a learning curve. And then I guess part of the whole multi-tenanted stuff is all comes down to the nightmare, which is like managing your accounts and all that sort of stuff. Yeah, my big tip for any AWS newbies is to actually get separate accounts. That makes things easier. Get separate accounts. You're supposed to use rules. No, no, that's the old way. New ways to have accounts, so you have complete isolation. And to conclude, I thought I would jot down why the hell that came out here. No, there's a really good YouTuber called NPJ and he just primed me on how to keep productive, you know, what to do and why you did it. So yeah, I gave this talk and I wanted to share what I've been doing with Lambda. If you guys are also using Lambda, please share that with me and maybe we can trade notes because I just want to get better at using it. I think it's the future, I'd say. It's plugging a lot of holes at work. It's fast. It's cheap. It's awesome. So where do you keep your business logic? Well, I mean, right now with Lambda, it's doing simple things like, you know, an event and then slap it into a template. Effectively, it's doing state listings. Yeah, state listings. I guess so. Yeah, that's right. That's what we're putting in. So yeah, my takeaways for you guys was that, yes, you can use Golang with AWS Lambda. If you look at my slides, talkstopwebconverge.com, you can get a hold of my example, which is production quality, even though probably now, forget that production quality there. It is. It's a production level. It's a production. And yeah, give serverless a try. Don't think of it as the way you're going to build your next app. Just think of it as a way of plugging in some holes and automating some little things here and there and get your workplace. That's where I'd start. No, it's good for everything. It's the next big data. It's going to be huge. No, start small, please, guys. And I think that's all I had to say. This talk has some links to some interesting stuff, like for example, one nasty thing about using Go is that you obviously should be using the strongly tied nature of it and different events and different schema, but Apex has these useful tools to, you know, they have the types defined for each or the events, basically. I think that's it, guys. Please get in contact with me. I think I need to run off. So if you have anything to share, if you have any questions, I'm happy to answer them. Okay, this is a question. Yeah? Did you benchmark this for a course against naked pipe and lambda? No, I didn't. This actually shows out a Go process from the... Yeah, it probably... Yeah, it sounds nasty, doesn't it? Any requests? Well... The way the containers work is that they get warmed up. So I guess the process is loaded in memory somehow. Yeah, but does the experience have to leverage the lambda? Yeah, you can see the JavaScript child process thing there. I mean, it is a bit of a... It's a shim. It's shimmied in. It's not great. I don't think it's going to be a performance... what do you call it? It's not going to be a performance. But I don't think it's going to be a bottleneck as well. I don't think it's going to be a bottleneck. I mean, like, it's... Because you've listed this stuff. Yeah. You just pay more money, that's all. Yeah. Oh, yeah, another question. Just because of the price, how much is it for, like, I guess, paper time? Yeah, it's basically by time and compute resources. But to be honest, maybe this is a testament to how well... how production quality myself is. But, like, it's like... It's nothing. Yeah, it's not much. I think it's millions to a few seconds. Yeah, I wish I could show you our Amazon bill. Lambda doesn't really get on there. I mean, it is on there. Do you use SNS to feedback events? Let's say you build your template. Do you have SNS? To notify that it's being done? No, we don't. Just talk back to a central process that says this has been done successfully. No, there's no... what do you call that? Coordination? Manager, coordinator, supervisor, whatever. The one really good thing I didn't really point out to you is that the logging is actually for free and good. You know what I mean? Like, usually when you're building an app you have this logging problem. How are you going to manage your logs and all that stuff? Blah, blah, blah, blah. You get that for free. So you can see stuff going well. But I say all this stuff working with GoLang. I think GoLang is the best way to work with HTML templates. Because I think JavaScript should start. But I must concede that the tooling and the direction of Amazon stuff seems quite no JS centric. So, like, they have like a thing in preview for like debugging JavaScript on their console. That's pretty sweet. I still don't even know how to debug GoLang. Do you guys do that? There's all sorts of other cool things coming in with Lambda, which I think could be really, really amazing. For example, they got this thing called Lambda on Edge. So the CD... So, right now, the way that Lambda's work is that they're running in particular regions. So I've loaded, in my demo there, I've loaded a Lambda to a single port. But if you ran that Lambda function in Europe, it would probably suck. Like, for example, if you triggered it through an HTTP event. But the cool thing with well, it's in preview, it's in beta. I think it's... there's nothing like it, is there? They're introducing Lambda at Edge. So basically, all these cloud front edges all over the world you can run Lambda on the Edge. So basically, if you have people in some shitty country like... I can't say that. Australia. Like, Rwanda. Or something like that. They could have an amazing user experience because they're basically on CDN-type speeds. You could be running some sort of transaction and get the result back in 10 milliseconds from some shitty country. That's effing amazing. I'm sorry to say. That concludes my talk. Please check out the slides and please contact me with your any more questions.