Elixir 1.19.3

Mayfly

A lightweight AWS Lambda Custom Runtime for Elixir

Zero Boilerplate

Focus on business logic, not Lambda implementation details

💜

Native Elixir

Use the same patterns and libraries you love

🚀

Optimized Performance

Built specifically for Elixir's strengths

🛡️

Error Handling

Meaningful stack traces and error reports

Simple & Powerful

Write Lambda functions in pure Elixir with minimal setup

defmodule MyFunction do
  def handle(event) do
    {:ok, %{
      message: "Hello from Elixir!",
      event: event
    }}
  end
end

Get Started in Minutes

1

Add Mayfly to your dependencies

# In mix.exs
def deps do
  [
    {:mayfly, github: "bmalum/mayfly"}
  ]
end

Then run: mix deps.get

2

Create your handler function

defmodule MyFunction do
  def handle(event) do
    {:ok, %{message: "Hello!", event: event}}
  end
end
3

Build and deploy

mix lambda.build --zip --docker

Upload lambda.zip to AWS Lambda and set handler to Elixir.MyFunction.handle

Note: On Apple M processors or ARM-based OS, the Lambda will be built for ARM64 architecture. Select "arm64" when creating your Lambda function in the AWS Console.

Why Mayfly?

Run your Elixir code in AWS Lambda without compromise. Mayfly brings the full power of Elixir to serverless functions.

Unlike generic custom runtimes, Mayfly is purpose-built for Elixir, bringing the language's reliability and expressiveness to serverless computing.