Using Confluent Cloud and Nile together
Confluent’s Postgres sink connector allows you to stream data from Kafka to Nile. This is great for use cases such as streaming user feedback to Nile for use in RAG, as well as for any case where your application requires real-time data from a wide variety of sources (check out their catalog for an insanely long list). In this guide, we’ll walk you through how to set up Confluent Cloud to stream data to Nile. We’ll use Confluent Cloud’s Datagen connector to generate fake customer feedback data, and then stream it to Nile.Setting Up Nile
Start by signing up for Nile. Once you’ve signed up for Nile, you’ll be promoted to create your first database. Go ahead and do so. You’ll be redirected to the “Query Editor” pageof your new database. This is a good time to create the table we’ll be using in this example:tenants
table that is built-in to Nile.
Next, you’ll want to pick up your database connection string: Navigate to the “Settings” page, select “Connections” and click “Generate credentials”.
Copy the connection string and keep it in a secure location.
Setting Up Confluent Cloud
If you haven’t already, sign up for a Confluent Cloud account. You’ll probably want to walk through their tutorial - they will walk you through creating a cluster, a topic, and a datagen source connector.Quickstart
We’ll assume that you’ve already created a cluster. In your cluster, you’ll want to create a new topic. You can do this by selecting “Topics” from the left-hand side, and clicking on “Add topic”. Call the topicfeedback
, and accept the default settings.
Creating the source connector
Next, you’ll want to create your source connector. You can do this by selecting “Connectors” from the left-hand side, search for “Sample Data” connector and click on it. Click on “additional configuration”, and configure it by following the wizard and using the following settings:- Select “feedback” as the topic.
- Select an API key. If you don’t already have one, you can create a new API key on this page.
- Select “JSON_SR” as the value for “output record value format”.
- Select “Rating” as the schema.
Creating the sink connector
Now we’ll set up the sink connector, to send data from Kafka to Nile. In the connectors page, search for Postgres and make sure you click on the “Postgres Sink” connector. Configure it by following the wizard and using the following settings:- Select “feedback” as the topic.
- Select an API key. You can generate a new one, or use the one you created for the source connector.
- Now enter the details of your Nile database. You have all the information in the connection string you generated in a previous step. Or you can use the Settings page in Nile console to get this information.