Messages
Reference for Sequin messages
Message shapes
Sequin converts Postgres changes and rows into JSON messages that are delivered to your sinks.
When you setup a sink, you can choose whether the sink should receive change messages or row messages.
Change messages
A change message has this shape:
A read
operation occurs during backfills when Sequin reads existing rows from your table. Unlike insert
, update
, or delete
operations which happen in real-time, read
operations represent historical data being loaded into your sink.
For update operations, record
contains the new values and changes
contains the previous values of only the fields that changed. For all other operations, changes
is null.
Row messages
A row message has this shape:
For example:
At the moment, row messages only support insert
and update
operations. Soon, we’ll support delete
operations by adding a deleted
boolean column to the message.
Which message shape should you use?
Change messages are the best fit for most use cases. They contain more information about discrete changes to a row and include delete
operations.
If you only need the latest version of a row, and either don’t need deletes or soft-delete rows, consider using row messages. The nice part about row messages is that every message is the same shape, whether it’s an insert, update, or backfill (“read”) message.