Volver al ranking

elixir-broadway/broadway

Elixirelixir-broadway.org

Concurrent and multi-stage data ingestion and data processing with Elixir

elixirgenstagedata-ingestiondata-processingconcurrentbroadway
Crecimiento de estrellas
Estrellas
2.7k
Forks
178
Crecimiento semanal
Issues
4
1k2k
ene 2019jul 2021ene 2024jul 2026
README

Broadway

CI

Build concurrent and multi-stage data ingestion and data processing pipelines with Elixir. Broadway allows developers to consume data efficiently from different sources, known as producers, such as Amazon SQS, Apache Kafka, Google Cloud PubSub, RabbitMQ, and others. Broadway pipelines are long-lived, concurrent, and robust, thanks to the Erlang VM and its actors.

Broadway takes its name from the famous Broadway street in New York City, renowned for its stages, actors, and producers.

To learn more and get started, check out our official website and our guides and docs.

Broadway Logo

Built-in features

Broadway takes the burden of defining concurrent GenStage topologies and provides a simple configuration API that automatically defines concurrent producers, concurrent processing, batch handling, and more, leading to both time and cost efficient ingestion and processing of data. It features:

  • Back-pressure
  • Automatic acknowledgements at the end of the pipeline
  • Batching
  • Fault tolerance
  • Graceful shutdown
  • Built-in testing
  • Custom failure handling
  • Ordering and partitioning
  • Rate-limiting
  • Metrics

Producers

There are several producers that you can use to integrate with existing services and technologies. See the docs for detailed how-tos and supported producers.

Installation

Add :broadway to the list of dependencies in mix.exs:

def deps do
  [
    {:broadway, "~> 1.0"}
  ]
end

A quick example: SQS integration

Assuming you have added broadway_sqs as a dependency and configured your SQS credentials accordingly, you can consume Amazon SQS events in only 20 LOCs:

defmodule MyBroadway do
  use Broadway

  alias Broadway.Message

  def start_link(_opts) do
    Broadway.start_link(__MODULE__,
      name: __MODULE__,
      producer: [
        module: {BroadwaySQS.Producer, queue_url: "https://us-east-2.queue.amazonaws.com/100000000001/my_queue"}
      ],
      processors: [
        default: [concurrency: 50]
      ],
      batchers: [
        s3: [concurrency: 5, batch_size: 10, batch_timeout: 1000]
      ]
    )
  end

  def handle_message(_processor_name, message, _context) do
    message
    |> Message.update_data(&process_data/1)
    |> Message.put_batcher(:s3)
  end

  def handle_batch(:s3, messages, _batch_info, _context) do
    # Send batch of messages to S3
  end

  defp process_data(data) do
    # Do some calculations, generate a JSON representation, process images.
  end
end

Once your Broadway module is defined, add it as a child of your application supervision tree as {MyBroadway, []}.

Comparison to Flow

You may also be interested in Flow by Dashbit. Both Broadway and Flow are built on top of GenStage. Flow is a more general abstraction than Broadway that focuses on data as a whole, providing features like aggregation, joins, windows, etc. Broadway focuses on events and on operational features, such as metrics, automatic acknowledgements, failure handling, and so on. Broadway is recommended for continuous, long-running pipelines. Flow works with short- and long-lived data processing.

License

Copyright 2019 Plataformatec
Copyright 2020 Dashbit

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Repositorios relacionados
anoma/anoma

Reference implementation of Anoma

ElixirMIT Licensecryptographyblockchain
anoma.net
33.7k4.1k
plausible/analytics

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

ElixirGNU Affero General Public License v3.0analyticsprivacy
plausible.io
27.9k1.7k
asdf-vm/asdf

Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more

GoGo ModulesMIT Licenseversion-managerruby
asdf-vm.com
25.5k929
phoenixframework/phoenix

Peace of mind from prototype to production

ElixirMIT Licenseelixirweb-framework
phoenixframework.org
23.1k3.1k
electric-sql/electric

The agent platform built on sync.

TypeScriptnpmApache License 2.0elixirpostgres
electric.ax
10.3k349
lk-geimfari/awesomo

Cool open source projects. Choose your project and get involved in Open Source development now.

GoGo ModulesCreative Commons Zero v1.0 Universalawesomeocaml
9.9k690
taskforcesh/bullmq

BullMQ - Message Queue and Batch processing for NodeJS, Python, Elixir and PHP based on Redis

TypeScriptnpmMIT Licensebackground-jobsnodejs
bullmq.io
9.2k655
benawad/dogehouse

Taking voice conversations to the moon 🚀

TypeScriptnpmMIT Licenseelixirreact
dogehouse.tv
9k1.4k
firezone/firezone

Enterprise-ready zero-trust access platform built on WireGuard®.

ElixirApache License 2.0cloudvpn
firezone.dev
8.7k426
xberg-io/xberg

A polyglot document intelligence framework with a Rust core. Extract text, metadata, images, and structured information from PDFs, Office documents, images, and 97+ formats. Available for Rust, Python, Ruby, Java, Go, PHP, Elixir, C#, R, C, TypeScript (Node/Bun/Wasm/Deno)- or use via CLI, REST API, or MCP server.

Rustcrates.ioMIT Licensetext-extractiondocument-intelligence
docs.xberg.io
8.7k525
supabase/realtime

Broadcast, Presence, and Postgres Changes via WebSockets

ElixirApache License 2.0elixirpostgres
supabase.com/realtime
7.6k451
oldratlee/translations

🐼 Chinese translations for classic software development resources

Othertranslationchinese-translation
github.com/oldratlee/translations
6.9k1.5k