Closed RTLS closed 1 week ago
Notes for discussion:
backfill_query
should live in same place / abide by same mechanism as replays? How do we do replays here?config
-oriented design does not allow for consumers to be dynamic. I guess dynamic consumers is what we'll be building out in non-dep, table-oriented version? (Any good prior art here?)orders
is the name of the consumer, and so is sensitive to changeshandle_message
pretty easily, yeah?max_concurrency
is a v good one)Interestingly, all the deps I can think of use config to setup vs some imperative flow -- makes sense.
Overview
Problem statement
Currently, Sequin requires a separate
messages
table to store stream data. This adds complex lifecycle management and it forces the user to decide read patterns at write time (ie. choose filterable columns). Additionally, a separatemessages
table adds storage and IOPS to the Postgres database.Proposed solution
Develop a Sequin Elixir dependency that enables developers to treat their existing Postgres tables as streams. This library will provide a simple, Oban-like interface for creating consumers that can filter, transform, and react to changes in specified tables.
Consumers will pull directly from user-owned tables for backfill and replays, eliminating the need for a
messages
table. Consumers will then subscribe to WAL messages for real-time processing of inserts, updates, and deletes.Goals / Objectives
Key Concepts
Consumers
Consumers are the core abstraction. A consumer:
Core Features
Example
Configuration
Consuming
Implementation Details
Consumer Messages
The library manages a
consumer_messages
table to track processed messages and ensure exactly-once delivery.