Building Serverless Applications in GoLang

Mx Kas Perch
IOpipe Blog
Published in
2 min readJul 3, 2018

--

This last January, AWS made a great addition to their supported languages by adding GoLang. Previously, GoLang could be run through a wrapper, but it was tricky and dealing with errors was a bit more difficult. And there was a good amount of excitement over the news:

For those of you who haven’t had the distinct pleasure of hearing about GoLang for hours on end (or even if you have!), you may find yourself thinking…

Why all the excitement over GoLang?

GoLang is growing at an explosive pace, and shows no sign of slowing: Hacker News hiring trends for April 2018 show it breaking into the top ten most popular topics! But what exactly gets developers “going” about GoLang?

One thing is the match of type-safety with pragmatic language design. While pragmatism is by nature subjective, you can’t argue with the numbers, and more and more developers and companies are making GoLang their statically-typed “go-to” language.

The other factor? Speed, plain and simple: when you want your code running (going?) quickly, GoLang is one of the speedier choices. I could show you our own artisanal benchmarks to prove my point, but there’s a ton of material already out there.

Right, but what about Serverless?

So performance in general is great, but how does this translate into benefits for serverless applications specifically?

Cold starts. They are a necessary evil in the serverless world, but their impact can be mitigated. Because GoLang programs start up much faster than other compiled Lambda languages, such as Java, the cold start time for a GoLang Lambda function is significantly smaller! This can be a case of having the best of both worlds: a type-safe language that is highly performant — not just at runtime, but on those cold starts!

There’s also a lot of support for GoLang being developed by the community to help get you started: the Serverless Framework has full GoLang support, and there are lots of AWS docs and tutorials to help you build your first GoLang Lambda function.

Bringing GoLang Beta Support to IOpipe

We’re happy to announce that we now have a GoLang IOpipe agent in Beta release. IOpipe is all about observing and monitoring AWS Lambda functions and applications as they grow, and GoLang is definitely growing!

To get started, there’s a how-to in the readme for the GitHub repo, with installation instructions and an example!

Ready to try it? We have a free 21-day trial ready and waiting for you! You can also check out the GoLang Agent code in GitHub, and if you have any questions, we’d be happy to chat in our community slack.

--

--

Dev🥑. Robotics Author and Maker. Yells at robots occasionally.