Why You Shouldn't Wrap a Stream in a Transaction in Elixir

When you need to process a large number of records in Elixir, the instinct is often to wrap everything in a transaction. All-or-nothing semantics, right? Safe by default. Turns out, this is one of those cases where the “safe” choice creates a bigger problem than the one you were trying to avoid. Here’s what’s actually happening under the hood, and a better approach that’s both safer and more efficient. The Naive Approach Let’s say you have a batch job that needs to process thousands of files, calling an external API for each one and saving the result to the database. ...

March 1, 2026 · Giulia

Designing Extensible Action Pipelines in Elixir with Behaviours and Dynamic Dispatch

When you’re building a system that needs to execute many different “actions” (think AI-powered pipelines, data processing jobs, or any multi-step business logic) you quickly face a design question: how do you keep things extensible without coupling everything together? In Elixir, the answer often comes down to two powerful primitives: Behaviours and dynamic dispatch via atoms. Let me walk you through an architecture that elegantly solves this problem. The Problem: Many Actions, One Orchestrator Imagine you have an application that runs multiple independent actions, and that each one takes some input, does some processing, and produces a formatted output saved to a database. You could write each action as a standalone module with its own logic, but then whoever orchestrates them needs to know about every single one. That’s tight coupling, and it makes adding new actions painful. ...

February 21, 2026 · Giulia