fireproofsocks

fireproofsocks

Elixir on AWS Lambda? Or more broadly: Elixir as a Service

I’m not a Lambda fan-boy because I think it’s overprescribed as a cure-all for every possible problem when in reality, Lambdas are best suited for a narrower scope of tasks. Generally I wouldn’t think any VM-centric language would be a good fit for a Lambda because they would have a larger footprint and may take longer to start, but Java has been one of the Lambda options for a long time. So… clearly there’s more to the story.

Anyhow, because Lambdas often get brought up any time there’s a conversation about “serverless” deployments, I think they are a worthy topic of discussion.

There’s an old thread about Elixir on AWS Lambda: Elixir on AWS Lambda is coming soon

but I haven’t seen much on it recently. There’s even the aws_lambda_elixir_runtime Hex package, but it hasn’t been updated in quite a while (e.g. it uses Distillery instead of releases).

Ironically, I have had to think a lot MORE about the infrastructure when I use tools like serverless. However, one can’t ignore the push towards deploying apps in the context of various cloud services, so IaC tools are hard to ignore. I’m curious what people are thinking or have seen with respect to Elixir deployments and Elixir as a service. It would be nice to have easier deployments. Gigalixir is a great platform-as-a-service, but I’m wondering if there’s room for more tooling something that might a bit more like serverless or chalice that deals with automating the painful AWS permissions around getting something deployed.

Most Liked

Sebb

Sebb

The startup is only an issue if you have few requests and the lambda has to cold-start. You can keep the lambda “warm” to not have to cold-start.

But I would not use Elixir as a lambda. It seems a little hacky. But more important, lambdas are usually used as very specialized functions. You have to build a system around it. Elixir/OTP is very good at just that: building a system. You’d give that up and make everything more complicated than needed. Depends on the use case obviously.

dergraf

dergraf

Not an answer, more of an experience report :wink:

I’ve played at some point with AWS Lambdas written in Elixir, first by using one of the mentioned libraries and second by rolling it on my own using just HTTPoison. It made me realize how simple the architecture actually is or can be (assuming the official Lambda stacks do more or less the same as I did).

But that was only an experiment. Today we live with a mixed codebase of Javascript and Python based Lambdas used as custom Authorizers in AWS API Gateway. All our Lambdas are deployed using Terraform aws_lambda_function module. To make this work with plain Terraform we must store the Lambda dependencies, e.g. JS node_modules folder, in the same directory as the actual Lambda code, all checked into Git. :weary:

Separating the Lambda code from Terraform could solve this issue, which would be possible with the other Lambda flavors; deployment packages on AWS S3 or container images on AWS ECR. In contrast to the simple zip based approach, one must introduce a whole new process to separately test, build, and deploy those artifacts (but that’s what we do for our Elixir apps anyways, right).

I think if a Lambda codebase gets bigger, their dependencies more complex, using a separate CI/CD process for Lambdas outside of IaC becomes inevitable. We’re not at this point yet, but once we are, I would definitely do another round of experimentation with Elixir based Lambdas.

dergraf

dergraf

Hi!

I was using a containerized lambda instead of the classic zip file, see Create a Lambda function using a container image - AWS Lambda. this requires the containerized application to poll the AWS Lambda runtime for requests to be run, this is done using a Lambda runtime client, several libraries exists for this, but honestly it’s (was) two separate HTTP requests that were very straightforward to implement.I think I’ve started with this library GitHub - aws-samples/aws-lambda-elixir-runtime: Example implementation of a custom runtime for running Elixir on AWS Lambda..

Best,

Where Next?

Popular in Discussions Top

hauleth
Maybe some of you know that there was (is?) something like BERT-RPC which in short is simplified version of External Term Format (also kn...
New
lichuan
Hi, I’ve created a new repository on GitHub to compare the fairness and real-time performance of schedulers in Erlang and Go. Feel free t...
New
AstonJ
A recent chat with @leifericf inspired this thread - he’s worked in the gaming industry, and so it got me wondering what kind of industri...
New
szsoppa
Hey folks! For the third year in a row, we’re running the Elixir Survey by Curiosum! It’s been live since yesterday, and 300+ people hav...
New
Sergiusz
Hello everyone, I don’t know if my post is appropriate. If it isn’t, you can delete it. After a year of designing and defining the requ...
New
markmark206
Every time I build a web app, I worry about a bunch of basic things (persisting data, knowing when to compute which things, keeping thing...
New
dogweather
I’ve been brainstorming about ways to solve the N-dimensional code organization problem, and am thinking about developing a Smalltalk-lik...
New
travisf
In upgrading from Ecto 2 to Ecto 3 I’m dealing with a failing test. If I use ExMachina build(:address) I’ll get an error trying to put_e...
New
New
AstonJ
Inspired by Andrew’s post in another thread about types: If the main benefit of static typing is to catch errors, and most people think...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New

We're in Beta

About us Mission Statement