 Oh, who's Able, by the way? Oh, hi. Okay, I've got 20 minutes, right? Like all my talks, I upload them to talks.webconverter.com. So if you're feeling like really weird, you could go to an old talk of mine. Introduce yourself, Henry. Oh, my name's Kai Hendry. So I've been using Golang for a couple of years, but I guess it's only in the last year, oh, sorry, that's my umbrella. It's only in the last year that my current employees have had given me the opportunity or let me run wild with Golang because we usually have been using JavaScript at the workplace. And if you're using JavaScript, you might run into problems, you know, just like JavaScript fatigue and promise chains. I mean, I think I'm quite comfortable around promise chains, but like when I was working with newbies, sort of like when you explain callbacks to newbies, they sometimes suffer. When you explain promises to people, oh, God, it can be difficult. So what do I do at work? At work, at my sort of nine to five job Monday to Thursday, I work for a company called Spool. We do video stuff, and we're like, everything's in AWS. So, you know, the minute one of our content creators uploads a video, it's like on S3, and then we're processing it using AWS Batch, and then we're slicing and dicing it and putting it up on CloudFront. And I think we're not terribly unusual. I think most, I mean, how many people are using AWS at their workplace? Okay, some people. What else is there, actually? Google? Please. Okay, well, so my talk is about Golang and AWS, because like when you bring both of those things together, I think you can do some cool-ass things. The Golang, sorry, the AWS DK is actually one of the most popular packages on Godoc.org. I don't know if it's actually accurate, but I was impressed to see this thing. I don't know what the hell this firestore is. Sounds crap, but never mind that one. But the AWS SDK is one of the most popular ones. But if anyone, who's actually used the AWS SDK? What, two people? What are you guys doing? Do you actually work? You need to know this stuff, otherwise you'll suck. That'd be nice. Okay, sorry. Other languages exist, like Python. If you use AWS CLI, it is actually quite good. But then you might want to sort of automate it and put it in a Lambda function, make sure it runs every day or something like this. You'll just hit problem after problem and use the CLI, I feel. I mean, who uses the CLI? It only gets you so far. You've got to trust me with this. I'm sure you've seen it. And as you all know, Golang, when you implement stuff in Golang, and importantly, when you write some like underscore test.go with it, it becomes so much more confidently stable and a way of handling complexity. I think, I mean, a lot of smarter people have said this. The minute you start having your tests for managing your processes, the minute you can sort of like offload this complexity. Previously, when I came back to some shell scripts, I kind of had to remember how these things work all the time. I didn't really have confidence that this thing was working. But when I CD into my Golang project and I just go go test, and I'm testing something end to end, I have perfect confidence that it works. And most of the time, that's true. We were using, as I mentioned, JavaScript. But yeah, it's a bit painful. It's a bit painful. We still use serverless framework for a lot of stuff. But it's very hard to manage the asynchronous synchrony of JavaScript. And Golang makes it easier because it blocks by default. That's so nice. So I think the results have been quite amazing, actually, at my workplace. We've been able to not run EC2 instances. We've been able to not run Docker instances. And we've been able to automate things in a very sort of confident way. And basically save money and save time and all that sort of jazz. So at work in the last year and a half, I've done the website. The website is statically built. Obviously, some JavaScript shit runs on top of that. But that's not me. I did the static thing. Golang is a pretty awesome HTML template thing. It's pretty fast, too. The playlist generation. So those M3 rate, those dash XMLs, that's using a Lambda function. It scales. I think we were previously running it on a Rails backend. And now it's like an Apex up function that costs us like $0.20 a month or something. It's just, well, it's hard. You get a million requests for something free anyway. It's cheap. This new catch-up TV stuff, that's done with a whole bunch of Lambda functions. The stats pipeline, Kinesis makes it really easy to handle streams of data. And you can just write a Golang Lambda function which computes something. It's pretty nice. How does Kinesis do non-AWS uses? Kinesis is like vomit. A steady stream of vomit dribbling down your shirt. Is it Kafka? I don't really know. It's a way of handling streams, I think. And I've written lots of internal tools with Golang. One thing I did in Golang, which you couldn't probably do in Shell very easily, you probably could do with image magic. For example, I had to figure out whether some of our test feeds were going blank. So I wrote just with some sample code from the image library, which is quite nice, to detect it when segments are blank. And I don't think you can do that. Well, you could probably do it with FNPEG and image magic, but I did it a lot faster. Well, I did it a lot slower, but it's faster now. So the way I deploy Lambda functions is with this thing called Apex by T.J. He used to be a big guy in JavaScript community, but then he saw the light and joined the Golang developers, I think. Actually, is this a big mistake? Has Golang actually worked out for you guys? I don't know. So Apex is for handling the Landers, and Apex Up is for handling the Lambda and API Gateway. As a rule, I try to keep my functions outside Lambda, so I go test everything, and my Lambda functions are just like the function call that's all tested somewhere else. I don't put much complexity inside my Lambda as if possible. And then I use SNS for communication, I guess. Here's the typical sort of things I use. The cool thing about Apex is that it makes it easy on your CLI to filter out all the errors. It makes it easy to debug invocations all from the CLI, which is pretty nice. I like. So the V1 SDK, if anyone used it, I've got some links there. It's a bit weird when you start using it. There's all these pointers. And when I first saw references, what is the correct term? Pointers, references? I think I call them pointers. There are all these pointers everywhere, and the code looks really ugly. I should have put a code snippet here, but it feels a bit strange. Does anyone use the AWS SDK? It feels a bit weird. And I notice also it doesn't support AWS profiles, so every time I had to switch between accounts, I don't know about you guys, but I try to keep doing stuff in separate accounts. And it's really painful switching between things with the V1. And it sucks. Or I don't know, it's just a bit weird. But now there's a V2. I was very excited when I learned about this at VEvent. But the bad news is that it is pretty unstable. You've got to start using DEP and stuff like that. Who uses DEP? I tried being with it. I'm not sure I like DEP. It's a bit slow, isn't it? No, because it's for vendor. Okay. And then sometimes I have problems with importing stuff from different... I get these vendor errors when I'm doing some cross accounts. Anyway, so the bad news is that it is a bit unstable. It's a preview. This is actually kind of like work in development. And we actually... I know you don't want to hear this, but they need people to use it so that they can shake out the bugs and get it right, I think. So I think... I mean, I'm one of those guys who like to use new stuff. But to be honest, it can be painful at times. And there's a link to GitHub Search. I actually did a GitHub Search and there was only like one other guy, Raven, in Singapore, who was using the V2 DynamoDB stuff. One other guy in the planet. What do you say about Singapore? Which I thought was quite cool, but at the same time really, really sad. And one of the things I don't like about the new V2, but hopefully we'll bring it back, is that there's this option called chain verbose errors. I don't know how you guys work, but when I work with Golang SDK, I don't declare the permissions. I run my program and then I see what permissions it needs. And when you run verbose errors, it tells you what permissions it needs. It's not easy to make a policy at a later date. Or you could just put AWS, I don't know, full privileges and get your Lambda running that way. That also works. So the good news is that the new V2 has AWS profile things, so you can switch between accounts, really nice. The good news is that it is being designed, it's being worked on. And I'm no expert with SDKs and stuff like that. But I do enjoy learning about APIs because I think everyone should know a little bit about APIs. It's just like a fundamental thing, isn't it? Like, for example, does anyone use AWS JavaScript SDK? I thought it was very interesting that AWS has this DynamoDB interface, but they also invented this other thing called DocClient, which made it a lot easier to work with JSON and JavaScript. So it's not like other languages have solved this problem. This is an ongoing problem with all languages, having a good API to a third party like AWS. And the other good news is that the developers are quite nice. I've asked them stupid questions on GitHub issues, and they haven't shut me down like other people have. So here's an example of what the SDK kind of looks like. What do you call those? Ampersand things? I'm not too sure what they mean. I add them to the things to make things work. Same goes for this thing, whatever that means. That's an address of reference too. But the reason why they have these convergent stuff is that evidently the way Golang works, excuse me, I'm not an expert, you guys can probably fill in the blanks here, is that if you declare a struct or something, if you declare like an int, the SDK doesn't know if you meant zero or if you meant it was unset. This is the big problem with Golang. So hopefully that was a good explanation. So this is why they have all these weird conversion stuff. But with V2, they make an exception to maps and slices because that maps to AWS stuff because the empty slices and empty maps, what have you, they also don't exist in AWS. So they previously, what do you call this, converted everything in V1, V2, less things need converting. So the code is slightly more readable. One way of not doing all these, what do you call these conversions is to use setters, but it was decided in a GitHub issue that this is not idiomatic. Does anyone have strong opinions about setters? Well, they've decided to drop them. It's just very Java like that's all. There's no setters, there's no setters anymore, guys, sorry. Another thing with V2 is that they've designed the API so that there's less methods to every call. And I guess, I don't know where this request stuff comes from. I guess HTTP request has something like this, but I don't know about you guys, I use HTTP.get and HTTP.post. But anyway, they've made changes in that regard. I think the idea is that when they have smaller APIs on a call that like, I don't know, your auto completion isn't such a big, what's the term, fucking mess, you know, when it goes like that in your editor. It's much easier to basically build something with Visual Studio Code or VIMGO. Who uses VIMGO here? Power, power to the people. And then, yeah, they're basically adopting some idiomatic styles like buff.io, but to be honest, I don't even use buff.io. Who uses buff.io? I use read all and be done with it. Moving on. Good thing about the V2 is that the configuration is much easier. There was like a couple of weird ways of doing it with sessions, I believe, in V1. Now, it's a lot more simple. And it even can handle, like, better caching states. It can even handle MFA. Who uses MFA here? I don't know what that is. It means mother, father. It means a multi-factor authentication. I use Authy because Google Authenticator burnt me. But I hate Authy, too. I hate it. Banks use it. Well, banks use it badly with SMSs. V2 should be also more performant. I'm not too sure what reflection is. I think it's when you look at a mirror and you get a reflection back at you. But evidently, with the V2, they're using marshals instead of reflection. I know reflection is like the last chapter in the GoPL book. Has anyone read that book? It's the very last chapter. I never read the last chapter. It's too difficult. But anyway, this thing, there's always these links to the issue. And with this thing merged, it should be faster. I mean, it's claimed. I haven't actually noticed the difference. To be honest, GoLang is pretty crazy fast to begin with, I mean. Oh, and the discoverability, like with the V2 thing, I noticed that these very handy things. Who uses DynamoDB here? What the hell? What are you guys doing with your lives? You need a data store. You need to use something like DynamoDB. AWS fanboy. AWS fanboy. You could also use JSON on S3. I use that a lot because it's so much cheaper and easier. Anyway, DynamoDB is sometimes what you need to use. And I actually discovered these very handy things like Marshall Map and Expression Builder. Because if you work with DynamoDB, you usually have to do these very strange hash equals expressions to build up stuff. And basically, there's easier ways. And V2 exposes them nicely. So, yeah, cranky. So I wanted to make this repeat. How do you make it repeat? So, guys, when you're using V1, think about adding a dash V2, and then you're using V2. Isn't that extraordinary? It's so easy to switch. But, yeah, that's basically, I think that's basically all I had to say. Just before coming here, I thought it'd be funny to show you a blank video. What do you do? Oh, I thought it'd be funny to take a V1 thing, GH poles, which is by TGA Hollywoodchuck, and see how long I could quickly change it to V2. It took me about seven minutes, which was quite long, I thought. But I thought we could just run this on the background while I take questions. So you can see the kind of changes that I had to make, like copy, paste, and change things from pointers to whatever, normal stuff, references? Oh, okay, yeah. And also, you can be enabbed by this thing called VIMGO. It's a lot faster than Visual Studio. Visual Studio is like molasses. This thing's pretty fast. I'm actually going a little bit slowly because my son was hanging on my leg. But this is the way I work, Control-F, VIMGO. And yeah, any questions about V2? Hopefully something. For people who don't use AWS, we're lacking a bit of context. What the hell? Do you know what AWS is? It's a toilet system, the best toilet system in town. No, AWS is basically a hosting service, right? No, I'm not asking what AWS is. Do you have an example of the kinds of... What do you use it for? Yeah, what do you use it for? You use it for everything. No, not AWS. I mean the SDK. Oh, the SDK? Well, this one, this little thing here is... Do you run it at the end? What? Do you run it at the end of this video? I do a Go test and everything passes. Pretty close. Same as being run. Yeah, this is the way I work. I should have bound Go test to some sort of key, but I just do things, say, for Go test. What do you use it for? Yeah, AWS uses it for computing. I don't know. Storing files, manipulating files, doing pipelines. I don't know, when you have a Golang program, you need to host it somewhere, and AWS is the place to host it. Obviously, you don't need to use the SDK for some sort of random number generator or something like that, but the minute you want to store files, this is using DynamoD. The minute you want to use some sort of query engine, the minute you want to manipulate thing, I don't know, manipulate AWS resources, create SDK. Trust me, you're going to have to touch this bad boy. So it's all in your best interests to have a look at the API to be familiar with it. And yeah, I think at my workplace, I dare say using AWS, I am a total fanboy, but it has saved so much time and money, and I know things work so much more robustly and reliably now that, yeah, I think I would go far to say that I'm going to resign from my job and go into consulting so that I can help other businesses use this stuff. This stuff called Go, have you heard of it? It's okay. It's not bad. Yeah, GoTests and AWS. I don't know if Google and Azure have an SDK of their own. It'd be interesting to compare, actually. I'm comparing the JavaScript one and this one, and I think I prefer the Go one. Walk through a real use case. A file pops up on S3. What the hell? A file pops up on S3. Someone uploaded a file on S3. Yeah, it triggers an Apex. Yeah, it can trigger what you call this, an event. Yeah. And then you attach a Golang function. The Golang function is attached to your Apex? Yeah. Your Apex is just a way of uploading it. Yeah. So your Golang Lambda function would take the event and do something like send you an email that something was uploaded. Like a little DB field, for example. Exactly. I don't know. That sounds boring. Okay. E-mailing or perhaps transforming the image or something like that. All right. I'm going into a thumbnail. Yeah, sorry. I should have come up with some more use cases. I was actually, you know, I was too tired to come up with more examples. This is enough, guys. This was hard enough. Seven minutes of concentration. I didn't use Facebook once, as you will see. But yeah, it's, yeah. Anyone, I'll be happy to learn about other APIs and SDKs. Whatever's best is my motto. Yeah. Any questions? I have a question. Okay. You know, so in your experience, you do, in your SQQ, the first time I used Python once. Oh, God. What are you doing here? Okay. Sorry. What was it? In your experience, what was it like, in programming or in your book? Well, I mean, I have limited experience with Python. I've never deployed a Python Lambda function. I have used AWS CLI. I don't know if that counts as Python. But when I was using Python before, I wasn't testing maybe. What is the testing framework in Python? I don't even know. You didn't test it. And then I guess Python also isn't strongly typed. Is that true? I don't know. It's not strongly typed. So basically, the strongly typed Golang and the testing, I mean, I don't go crazy with the testing. I just do something quite end-to-end. But from Python to Golang, I think Golang is faster. Never mind the faster. It's just way more robust and reliable. Like seriously. It is like, I know it's going to work. I don't know. With Python 2 and 3, with the bytecode and all that jazz, who knows what's going to happen. But yeah, it's just giving me, it gives a, yeah, I can safely offload complexity with the stack, I feel. Any other questions? So the SDK cover all the APIs? Yeah. 100%. I haven't noticed anything missing. Well, it's interesting because like the AmazonJS SDK doc client is like a weird API of its own. And obviously those, their APIs aren't mapped to, I mean, how to explain this? I mean these APIs are, some of them do a lot for you, some of them don't do so much. But you can do everything with Golang SDKs. It's not like you're limited. But some I would say are easier to work with maybe. Let's be honest, working with Jason and Golang is, it's a little painful, but you get used to it after a while. Any other questions? Using the need to go on and on those things still? I haven't actually, I haven't. I'm using Apex's JavaScript shim. But I have been following the bugs and people say that they haven't even noticed any real change. I mean, I think it is folly, I hope you all agree with me to focus on speed because speed is not the important thing. It's having something robust and works and deals with complexity. Any other questions? Yeah. Thanks for sharing.