<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/broadway-visual-explainer-kqi93ukp0" -->

---
title: Broadway Visual Explainer | daily.dev
description: An interactive visual explainer walks through how Elixir's Broadway library builds data processing pipelines, covering data sources, producers, processors,...
canonical: https://daily.dev/posts/broadway-visual-explainer-kqi93ukp0
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Broadway Visual Explainer | daily.dev
og:description: An interactive visual explainer walks through how Elixir's Broadway library builds data processing pipelines, covering data sources, producers, processors,...
og:url: https://daily.dev/posts/broadway-visual-explainer-kqi93ukp0
og:image: https://api.daily.dev/og/posts/KQi93ukp0.png
og:image:alt: Broadway Visual Explainer
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Broadway Visual Explainer

**[Awesome Elixir](https://daily.dev/sources/awelix)** · 4 min read · 0 upvotes · 0 comments

## Summary

An interactive visual explainer walks through how Elixir's Broadway library builds data processing pipelines, covering data sources, producers, processors, batchers, and batch processors. It explains how demand-driven dispatch works, how producer count affects ordering and throughput, how processors run handle_message/3 on single events, how batchers form batches based on batch_size and batch_timeout, and how batch processors run handle_batch/4. A routing section demonstrates the :partition_by option, which routes messages with the same key to the same processor to preserve strict ordering, using a live example comparing default demand-based routing against partition-based routing.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://andrealeopardi.com/posts/broadway-visual-explainer>

## Questions this post answers

### What does the :partition_by option do in Elixir Broadway?

The :partition_by option routes all messages sharing a given partition key to the same processor or batch processor, enforcing strict ordering for those messages. This matters because Broadway pipelines process messages and batches concurrently by default and do not preserve ordering. Producers for sources requiring strict ordering, such as Apache Kafka, set :partition_by correctly out of the box.

_Building ordered Elixir pipelines? daily.dev surfaces Broadway and GenStage deep dives as they appear._

### How does a Broadway batcher decide when to form a batch and send it to handle_batch/4?

A batcher forms a batch based on two configurable settings, batch_size and batch_timeout, and emits the batch whichever limit is hit first: once the batch fills to batch_size messages, or once batch_timeout elapses. The resulting batch is then handed to a batch processor, which runs the handle_batch/4 callback, with the :concurrency option controlling how many batch processors handle that batcher's output.

_Tuning batch pipelines in Elixir? daily.dev tracks practical Broadway and GenStage explainers for that work._

### How does adding more producers affect message ordering in a Broadway pipeline?

Adding more producers increases parallel fetching from the source and can raise throughput, but it breaks ordering guarantees. For example, if multiple producers fetch in parallel from a single Kafka topic or partition, the ordering of events within that topic or partition is lost. Use a single producer, or the :partition_by option, when strict ordering is required.

_Weighing throughput against ordering in Elixir pipelines is easier with daily.dev's Broadway coverage._

## Similar posts on daily.dev

- [Elixir's GenStage Demand \(a Visual Explainer\)](https://daily.dev/posts/elixir-s-genstage-demand-a-visual-explainer--si6zgwh3q) · Awesome Elixir · 0 upvotes · 0 comments
- [Designing Data Flow in an Elixir Trading System](https://daily.dev/posts/designing-data-flow-in-an-elixir-trading-system-osvsj2vrv) · ElixirStatus · 0 upvotes · 0 comments
- [Code BEAM America 2025 - Learning Resources / Talks - Elixir Programming Language Forum](https://daily.dev/posts/code-beam-america-2025---learning-resources-talks---elixir-programming-language-forum-bagwzmtsq) · Elixir Forum · 0 upvotes · 0 comments
- [Consumers, projectors, reactors and all that messaging jazz in Emmett](https://daily.dev/posts/consumers-projectors-reactors-and-all-that-messaging-jazz-in-emmett-ie8ierv12) · Architecture Weekly · 0 upvotes · 0 comments
- [The Complete Guide to Message Queues and Event Streaming: Building Scalable, Reliable, and Real-Time Distributed Systems](https://daily.dev/posts/the-complete-guide-to-message-queues-and-event-streaming-building-scalable-reliable-and-real-time-72zillsk8) · Medium · 0 upvotes · 0 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#elixir](https://daily.dev/tags/elixir)

[View this post on daily.dev](https://daily.dev/posts/broadway-visual-explainer-kqi93ukp0)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Broadway Visual Explainer","url":"https://daily.dev/posts/broadway-visual-explainer-kqi93ukp0","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/broadway-visual-explainer-kqi93ukp0"},"datePublished":"2026-09-10T20:56:32.653Z","dateModified":"2026-10-15T02:22:58.704Z","description":"An interactive visual explainer walks through how Elixir's Broadway library builds data processing pipelines, covering data sources, producers, processors,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c82e85ceafcda1ead795342cd6efd28b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c82e85ceafcda1ead795342cd6efd28b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Awesome Elixir","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Awesome Elixir","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/85a474f78b1b4d349119f7ce60d1438e","url":"https://daily.dev/sources/awelix"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/broadway-visual-explainer-kqi93ukp0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devops,elixir","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Awesome Elixir","item":"https://daily.dev/sources/awelix"},{"@type":"ListItem","position":3,"name":"Broadway Visual Explainer"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/broadway-visual-explainer-kqi93ukp0#faq","mainEntity":[{"@type":"Question","name":"What does the :partition_by option do in Elixir Broadway?","acceptedAnswer":{"@type":"Answer","text":"The :partition_by option routes all messages sharing a given partition key to the same processor or batch processor, enforcing strict ordering for those messages. This matters because Broadway pipelines process messages and batches concurrently by default and do not preserve ordering. Producers for sources requiring strict ordering, such as Apache Kafka, set :partition_by correctly out of the box. Building ordered Elixir pipelines? daily.dev surfaces Broadway and GenStage deep dives as they appear."}},{"@type":"Question","name":"How does a Broadway batcher decide when to form a batch and send it to handle_batch/4?","acceptedAnswer":{"@type":"Answer","text":"A batcher forms a batch based on two configurable settings, batch_size and batch_timeout, and emits the batch whichever limit is hit first: once the batch fills to batch_size messages, or once batch_timeout elapses. The resulting batch is then handed to a batch processor, which runs the handle_batch/4 callback, with the :concurrency option controlling how many batch processors handle that batcher's output. Tuning batch pipelines in Elixir? daily.dev tracks practical Broadway and GenStage explainers for that work."}},{"@type":"Question","name":"How does adding more producers affect message ordering in a Broadway pipeline?","acceptedAnswer":{"@type":"Answer","text":"Adding more producers increases parallel fetching from the source and can raise throughput, but it breaks ordering guarantees. For example, if multiple producers fetch in parallel from a single Kafka topic or partition, the ordering of events within that topic or partition is lost. Use a single producer, or the :partition_by option, when strict ordering is required. Weighing throughput against ordering in Elixir pipelines is easier with daily.dev's Broadway coverage."}}]}
```

