Set up change retention
Store and retain change messages in a database table
This guide shows you how to set up change retention in Sequin to store change messages (inserts, updates, and deletes) in your database.
By the end of this guide, you’ll have a table that stores change messages. Then, you can stream those changes to a Sequin sink and have the ability to backfill changes at any time.
Prerequisites
Before you begin, make sure you have:
- Sequin installed and configured in your environment
- Permission to create tables in your database
Steps
Open the Sequin web console and navigate to the Change Retention tab. Click “Create retention”.
Configure source
Select the source table
Select the table you want to capture changes from.
Configure filters
Optionally, specify which operations to capture (e.g., insert
, update
, and/or delete
). You can also add column filters to capture only certain changes.
Configure destination
If you’ve created a change event table previously, you can select it from the list.
Otherwise, click Create new change event table to create a new table. This will open a modal that guides you through creating the table:
Choose a retention policy
Choose a retention policy for change messages.
If you’re not sure what to choose, we recommend selecting “None” and setting up a retention policy later.
Run the DDL commands
Copy the DDL commands from the modal and run them in your database.
Create the retention
Give your change retention a name, and click Create.
For more details on the options available, see the reference.
Verify
Test that changes are being captured correctly:
- Connect to your database
- Make a test change to your source table:
- Verify the change was captured into the destination table:
Next steps
Now that you’ve set up change retention, you can stream changes to a sink. With retention enabled, you can backfill changes to your sink at any time.
For more information about change retention, see the reference.
Was this page helpful?