Connecting to Neon
How to connect Sequin to your Neon database.
This guide provides step-by-step instructions to connect your Neon database to Sequin.
Provision a Postgres user for Sequin
When in development, it’s probably fine to supply Sequin with an existing user.
However, when in production, you should create a dedicated user for Sequin. The user needs the following permissions:
connect
permission on the database.select
permission on all the tables you want to connect to Sequin.replication
permission to read from replication slots.
Here’s how to create a dedicated user with the minimum required permissions:
To generate a secure password, if you have OpenSSL installed, you can use the following command:
Enable logical replication on Neon
By default, logical replication is not enabled on Neon. To turn it on, follow these steps:
Navigate to your project's logical replication settings
Open your project in the Neon console. Then, navigate to the Beta section: “Project settings” > “Logical Replication”.
Enable logical replication
Click on the Enable button to activate logical replication.
Learn more about enabling logical replication in Neon here.
Connect Sequin to your Neon database
After enabling logical replication on Neon, you’ll now connect to your Neon database in Sequin.
Enter connection details in Sequin
In the Sequin Console, click on the “Connect Database” button and enter the following details for your Neon database:
You can find these connection details in your Neon project dashboard under the “Connection details” section:
- Host: Your Neon host (e.g.,
ep-cool-snow-123456.us-east-2.aws.neon.tech
) - Port: 5432 (default Postgres port)
- Database: Your database name
- Username: The sequin database user you created earlier
- Password: The password for your sequin database user
Make sure to enable the “SSL” option for secure connection.
Create a publication
Connect to your database using the SQL client of your choice and execute the following SQL query to create a publication:
If you want to publish changes from all tables, you can use:
Create a replication slot
Next, create a replication slot to capture changes from the publication:
Enter the replication slot details in Sequin
Back in the Sequin Console, enter the name of the replication slot (e.g. sequin_slot
) and publication (e.g. sequin_pub
) you just created. Then, name your database and click Create Database.
Create a sink
With your Neon database connected to Sequin, you are ready to create a sink. Follow one of our guides below to get started:
Stream to Webhooks
Send database changes to your HTTP endpoints to trigger workflows and keep services in sync
Stream to Redis
Stream changes to Redis streams for real-time data processing and caching
Stream to Kafka
Publish database changes to Kafka topics for event streaming and processing
Stream to SQS
Send changes to AWS SQS queues to trigger Lambda functions and other AWS services
Stream to GCP Pub/Sub
Send changes to GCP Pub/Sub topics to trigger Cloud Functions and power event-driven architectures
Was this page helpful?