Leveraging GenStage to Implement Your Own Event Bus
summary
Frame.io replaces RabbitMQ/Kafka with a homegrown GenStage-based Event Bus that broadcasts standardized event structs to ~10–12 consumers, processes about 1.5M events/day (peaks ~2.2M), and keeps API p99 at ~101ms. Implementation uses a GenStage producer with broadcast dispatcher, experimented from fire-and-forget to Task.async_stream to GenStage to a consumer_supervisor spawning per-event workers (final benchmark ~300ms for mocked sleeps). System adds retries and failure logs but lacks durable persistence yet; webhooks were added by creating a new consumer.
AI-written summary · about
chapters (24)
- 0:00Intro
- 1:47Agenda
- 2:05Whats an Event Bus
- 2:22Message Your Event
- 2:46Event Bus Example
- 3:46Event Bus Pros
- 4:43Event Bus Cons
- 5:20Code Snippet
- 6:48Context Function
- 7:31Notify
- 7:54Event
- 8:53Base Consumer
- 9:18Requirements
- 9:40First Example
- 12:44What is GenStage
- 13:11The Event Bus
- 13:53Consumer Changes
- 14:08GenStage Performance
- 14:45BetterAST
- 15:26ConsumerSupervisor
- 15:41Demo
- 17:43Event Bus Performance
- 18:18Webhooks
- 18:39Unit Testing
related talks
45mKEYNOTE: Announcing Broadway
57mGame of Streams: How to Tame and Get the Most from Your Messaging Platforms
40mTurn Hours into Seconds- Concurrent Event Processing
37mLet's build our own message streaming platform
54mGenStage and Flow
58mGame of Streams
55mKeynote: Announcing Broadway
45mMicro Services and Events: Friends or Foes?
