📖 Reference Documentation and resources
CDC for Astra DB¶
CDC for Astra DB automatically captures changes in real time, de-duplicates the changes, and streams the clean set of changed data into Astra Streaming where it can be processed by client applications or sent to downstream systems.
Astra Streaming processes data changes via a Pulsar topic. By design, the Change Data Capture (CDC) component is simple, with a 1:1 correspondence between the table and a single Pulsar topic.
This doc will show you how to create a CDC connector for your Astra DB deployment and send change data to an Elasticsearch sink.
Creating a tenant and topic¶
- In astra.datastax.com, select Create Streaming.
Enter the name for your new streaming tenant and select a provider.
Select Create Tenant.
Use the default persistent and non-partitioned topic settings.
Astra Streaming CDC can only be used in a region that supports both Astra Streaming and AstraDB. See Regions for more information.
Creating a table¶
In your Astra Database, create a table with a primary key column:
Confirm you created your table:
Connecting to CDC for Astra DB¶
- Select the CDC tab in your database dashboard.
- Select Enable CDC.
Complete the fields to connect CDC.
Select Enable CDC. Once created, your CDC connector will appear:
Enabling CDC creates a new
astracdcnamespace with two new topics,
log-topic consumes schema changes, processes them, and then writes clean data to the
log-topic is for CDC functionality and should not be used. The
data-topic can be used to consume CDC data in Astra Streaming.
Connecting Elasticsearch sink¶
After creating your CDC connector, connect an Elasticsearch sink to it. DataStax recommends using the default Astra Streaming settings.
Select Add Elastic Search Sink from the database CDC console to enforce the default settings.
Use your Elasticsearch deployment to complete the fields. To find your Elasticsearch URL, navigate to your deployment within the Elastic Common Schema (ECS).
Copy the Elasticsearch endpoint to the Elastic Search URL field.
Complete the remaining fields. Most values will auto-populate. These values are recommended:
When the fields are completed, select Create. If creation is successful,
<sink-name> created successfullyappears at the top of the screen. You can confirm your new sink was created in the Sinks tab.
Let's process some changes with CDC.
- Go to the CQL console.
Modify the table you created.
Confirm the changes you've made:
Confirming ECS is receiving data¶
To confirm ECS is receiving your CDC changes, use a
curl request to your ECS deployment.
Get your index name from your ECS sink tab:
curlrequest with your Elastic
If you have a trial account, the username is
You will receive a JSON response with your changes to the index, which confirms Astra Streaming is sending your CDC changes to your ECS sink.