Other Key Libraries

Features: retries with backoff, cron, uniqueness, rate limiting, Oban Web dashboard.

JSON (built-in, 1.18+), Jason encode/decode JSON Req, Finch, Tesla, Mint, HTTPoison Bandit, Cowboy persistent, Postgres/SQLite-backed job queue phx.gen.auth, Guardian (JWT), Ueberauth (OAuth), Pow Swoosh, Bamboo Cachex, Nebulex, ConCache Ecto changesets, NimbleOptions, Peri data/option validation

NimbleParsec, Earmark (Markdown), Floki (HTML), NimbleCSV Ash Framework, Kaffy, Backpex declarative resources, admin panels firmware for Raspberry Pi & IoT devices

Nx, Axon, Bumblebee, Scholar, Explorer tensors, neural nets, HF models, dataframes interactive, collaborative notebooks LiveView Native, elixir-desktop

Mox, ExMachina, StreamData, Wallaby (browser), Bypass

48.1 Req

Req.get!("https://api.github.com/repos/elixir-lang/elixir").body["description"]
Req.post!("https://httpbin.org/post", json: %{a: 1}, retry: :transient, receive_timeout: 10_000)

48.2 Built-in JSON (1.18+)

JSON.encode!(%{name: "Ann", tags: ["a"]})   # "{\"name\":\"Ann\",\"tags\":[\"a\"]}"
JSON.decode!(~s({"a": 1}))                  # %{"a" => 1}

48.3 Oban

Features: retries with backoff, cron, uniqueness, rate limiting, Oban Web dashboard.

defmodule MyApp.Workers.Email do
  use Oban.Worker, queue: :mailers, max_attempts: 5
  @impl Oban.Worker
  def perform(%Oban.Job{args: %{"user_id" => id}}), do: MyApp.Mailer.send_welcome(id)
end

%{user_id: 1} |> MyApp.Workers.Email.new(schedule_in: 60) |> Oban.insert()

48.4 Absinthe (GraphQL)

defmodule MyAppWeb.Schema do
  use Absinthe.Schema
  object :post do
    field :id, :id
    field :title, :string
  end
  query do
    field :posts, list_of(:post) do
      resolve fn _, _, _ -> {:ok, MyApp.Posts.list_posts()} end
    end
  end
end

48.5 Nerves

Build minimal Linux firmware where your Elixir app is PID 1; OTA updates via NervesHub.

mix archive.install hex nerves_bootstrap
mix nerves.new blinky
export MIX_TARGET=rpi4
mix deps.get && mix firmware && mix burn

48.6 Nx & Livebook

EXLA/Torchx backends run on CPU/GPU; Bumblebee runs pre-trained transformer models (text, vision, speech); Nx.Serving batches model inference across a cluster. Livebook lets you mix Markdown, code, charts (VegaLite, Kino), and smart cells.

Mix.install([{:nx, "~> 0.9"}])
t = Nx.tensor([[1, 2], [3, 4]])
Nx.dot(t, t)
Nx.mean(t)