I’ve just noticed that there is enough info in the Go run-time support for AWS Lambda to show you how to support any language in Lambda. The source for the Go run-time is here: https://github.com/aws/aws-lambda-go
When you make a Go function for AWS Lambda it actual compiles down to an x64 Linux binary. You can run that binary from the command line on your local machine. When you run it, the run-time implements a little server. That server does the request/response stuff with the main Lambda control system that enforces security, starts lambdas, etc. So, by looking at the source in aws-lambda-go you can see exactly how to implement the server.
I haven’t tried this, but it looks to me like you can upload any random x86 Linux binary and claim it is a Go lambda function. This should allow lambdas to be written in C or any other language. Might be a way to get docker based lambdas working too.
These are my observations from playing with Go for about a week. Next week I will convert some larger lambdas over to Go and see how they perform.
Out of curiosity, what is your use case where Go ran so much quicker than Node? My work does a lot of text processing and we’re switching from Node to Go to help with speed. I have a feeling we might just eek out enough speed improvement to make a serverless architecture affordable.
In your case I’d take advantage of the new C language support and write optimized code. You can also now upload pre-compiled libraries so maybe there is an off-the-shelf library that is fast?
As is always the case, make sure any calls to AWS services are paralleled. Waiting for 5ms for 10 service calls to respond in parallel is far cheaper than waiting 5ms ten times sequentially since lambda charges for wait time.
Ah that makes sense. In my work’s case, startup time would be irrelevant because it’s a continuous stream of data. The cloud functions would always stay warm. It’s just that once the function accepts the data to process, we would want it to finish ASAP. I should definitely look into writing cloud functions with Go or C. I have no problem using Node for occasionally triggered cloud functions that don’t do intense processing, but intense processing is definitely not its domain.
It is always good to work with Golang when distributed systems come into the picture.
Serverless computing offers a number of advantages over traditional cloud-based or server-centric infrastructure. For many developers, serverless architectures offer greater scalability, more flexibility, and quicker time to release, all at a reduced cost.
With serverless architectures, developers do not need to worry about purchasing, provisioning, and managing backend servers. However, serverless computing is not a magic bullet for all web application developers.
If you have created AWS Lambda function with Node.js then you have felt that the speed is relatively low compare to Golang because go can provide the blazing fast speed in execution.
There is a documentation regarding AWS Lambda and Golang in Serverless website.
AWS Lambda is finally. Compatible. With Golang.
Did you ever try plain C in Lamda, or come across examples? I don’t presently know enough about the Go example to derive what’s needed for C.