nburkley

nburkley

Elixir on AWS Lambda is coming soon

AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS Lamda. This is how they’ll be supporting new languages on AWS going forward (they just added ruby support through this API).

They’re already working with Alert Logic on building a Elixir and Erlang runtimes.

Looking forward to trying this out. I wonder how well the BEAM would work given it has relatively slow startup time. Still though, no need for a server, spawn up a process, do some work and you’re done, could be interesting.

Most Liked

mikemccall

mikemccall

The same use case for any other language in lambda. Honestly, I haven’t found a reason to use anything other than python because boto3 is awesome. I have mainly used it for one off tasks that I don’t feel like building into the main app. Recently I’ve used it to process SQS using amazon polly. The elixir app is just running a genserver listening to the queue for completed items. How that text gets synthesized the elixir code doesn’t need to know or care about. So decoupling is a good use case. Especially when your language of choice is lacking integrations.

Kelsey Hightower (Mr. Kubernetes) gave a talk called the Path to Serverless. It’s a really good talk and I think it covers the basics of why serverless is important. Despite what I feel like is an over analyzation of the technology, the fact is you don’t need to maintain a server to run some code. It’s that simple. Serverless has been around since you could upload php files to a server and it just runs. We have serverless file hosting (s3), serverless database hosting (RDS), serverless queues (SQS), etc. Lambda is just serverless compute. Some people take it to the extreme and run entire web applications, and that’s fine but I think it depends on the scale. For example, we run a lambda that gets triggered when a thumbnail object is not in s3. This lambda generates the thumbnail on the fly, saves it to s3 and returns the image. These requests typically occur in large burst, lambda makes this trivial to handle the load. I have yet to pay a penny for the compute time.

Another important aspect with lambda is it’s triggers. This allows your cloud infrastructure to respond to events. Not everything is a http request. The use cases will evolve as the tech matures. Elixir on lambda would be good for api endpoints and glue functions. It’s also very cheap. Technologies like lambda **cough** firebase **cough** give react/vue devs and easy to implement backends. There are a lot of front end apps that are most static but contain small forms such as newsletter signup. Having elixir be a documented option helps language adoption. Official recognition is huge. Getting elixir in early gives developers the opportunity to solve real problems with their preferred language and add more use cases.

to run an app that needs to be fault-tolerant not to be run for 30seconds and thrown away

Lambda doesn’t just throw itself away when the function is done. The same event can trigger the same running lambda many times. Lambda is also as fault-tolerant as it gets. The problems lambda solves is definitely inline with the problems elixir solves but they’re not mutually exclusive. I think that’s very good for elixir. Technology like lambda will only continue to evolve. Today we have options, you could put an ALB with path based routing in front of long running stateful elixir code and short lived stateless lambda code (elixir or not). Take advantage of all the tools.

It’s not for everything or everyone, but dismissing something because of perceived value is not always wise. One could argue they don’t see the point of running elixir on kubernetes. It’s not about replacement, it’s about adding a tool and utilizing the right tool for the problem.

mikemccall

mikemccall

Stumbled across this today

cblavier

cblavier

AWS has just announced SnapStart which starts your app after deployment, takes a snapshot of the disk + memory at that time, and then spawns very quickly an already initialized application.

This looks like a good solution to the BEAM slow start time shortcomings aforementioned in this topic.

Do you think we can leverage this with Elixir?

Where Next?

Popular in Discussions Top

jswny
I would like to better understand what the advantages/disadvantages of umbrella applications are compared to structuring your app as as s...
New
vans163
So useless benchmarks aside, Its possible to write a webserver that can serve 300k requests per second (perhaps more with optimizations)....
New
laiboonh
Hi all, I am trying to convince my team to use liveview over the current react. What are some of the points where one should consider us...
New
Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
lucaong
Hello Elixir and Nerves community, I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
230 14027 124
New
CharlesO
Erlang :list.nth simple, but 1 - based nth(1, [H|_]) -> H; nth(N, [_|T]) when N > 1 -> nth(N - 1, T). Elixir Enum.at … coo...
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
Qqwy
Looking at the stacks that existing large companies have used, WhatsApp internally uses Mnesia to store the messages, while Discord uses ...
New
kostonstyle
Hi all How can I compare haskell with elixir, included tools, webservices, ect. Thanks
New
AstonJ
It’s been a while since we’ve had a thread like this, so what better way to kick off the year with :003: What does being an Elixir user ...
New

Other popular topics Top

stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43757 214
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

We're in Beta

About us Mission Statement