You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/developing/pages/astream-cdc.adoc
+30-63Lines changed: 30 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -269,11 +269,8 @@ After you <<create-tenant,create a tenant>> and <<create-table,create tables>>,
269
269
270
270
You can use these options to enable single-region CDC and <<multi-region-cdc,multi-region CDC>> (if available for your organization).
271
271
272
-
[tabs]
273
-
======
274
-
{astra-ui}::
275
-
+
276
-
--
272
+
==== Enable CDC in the {astra-ui}
273
+
277
274
. In the {astra-ui}, click the name of the database where you want to enable CDC.
278
275
+
279
276
If you created the demo table in <<create-table>>, select the database where you created that table.
@@ -287,15 +284,13 @@ For multi-region databases, you must select a tenant for each region where you w
287
284
. Refresh the page to get the updated list of CDC-enabled tables in this database.
288
285
289
286
. Repeat to enable CDC on additional tables.
290
-
--
291
287
292
-
{product-short} {devops-api}::
293
-
+
294
-
--
288
+
==== Enable CDC with the {product-short} {devops-api}
289
+
295
290
Use the xref:astra-db-serverless:api-reference:devops-api.adoc[{product-short} {devops-api}] to enable CDC on one or more tables in the same database in the same request.
296
291
297
-
[tabs]
298
-
====
292
+
To check the CDC configuration for a database or table, see <<get-cdc>>.
293
+
299
294
`/v3/databases/$DB_ID/cdc`::
300
295
+
301
296
Use the `/v3/databases/$DB_ID/cdc` endpoint to enable CDC on single-region and multi-region databases.
@@ -416,11 +411,8 @@ The tenant must be in the same region as specified in `region`.
416
411
+
417
412
All tables replicated to the new region automatically have CDC enabled.
418
413
The `astracdc` namespace and CDC topics for each table are created in the specified regional tenant.
419
-
====
420
414
421
-
To check the CDC configuration for a database or table, see <<get-cdc>>.
422
-
--
423
-
======
415
+
==== CDC topics
424
416
425
417
When you enable CDC on a database for the first time, {astra-db} automatically creates an `astracdc` namespace in your streaming tenant.
426
418
For each table where you enable CDC, {astra-db} creates two topics in the `astracdc` namespace:
@@ -499,11 +491,9 @@ If your table has more than a few rows, use a more specific `select` statement t
499
491
select * from default_keyspace.cdc_demo;
500
492
----
501
493
+
502
-
.Result
503
-
[%collapsible]
504
-
====
505
494
The demo table now has two rows:
506
-
495
+
+
496
+
.Result
507
497
[source,console]
508
498
----
509
499
key | c1
@@ -513,7 +503,6 @@ The demo table now has two rows:
513
503
514
504
(2 rows)
515
505
----
516
-
====
517
506
518
507
. Verify that the change was passed from CDC to your sink by fetching the data from your sink service deployment.
Replace `**DATA_TOPIC_STRING**` with the `data-` topic string in the format of `**TENANT_NAME**/astracdc/data-**DB_ID**-**KEYSPACE_NAME**.**TABLE_NAME**`.
681
670
+
682
671
.Result
683
-
[%collapsible]
684
-
====
685
672
[source,json]
686
673
----
687
674
{
@@ -721,7 +708,6 @@ Replace `**DATA_TOPIC_STRING**` with the `data-` topic string in the format of `
721
708
"partitions" : { }
722
709
}
723
710
----
724
-
====
725
711
726
712
[#multi-region-cdc]
727
713
== Enable CDC for multi-region databases
@@ -780,25 +766,17 @@ However, be aware of the following limitations:
780
766
781
767
You can check your active CDC configurations in the {astra-ui} or with the {product-short} {devops-api}.
782
768
783
-
[tabs]
784
-
======
785
-
{astra-ui}::
786
-
+
787
-
--
769
+
=== Check CDC status in the {astra-ui}
770
+
788
771
. In the {astra-ui}, click the name of the database that you want to inspect.
789
772
790
773
. Click the *CDC* tab, and then review the list of tables where you have enabled CDC.
791
774
792
775
. Click a table's name to inspect the table's CDC configuration.
793
-
--
794
776
795
-
{product-short} {devops-api}::
796
-
+
797
-
--
798
-
[tabs]
799
-
====
777
+
=== Check CDC status with the {product-short} {devops-api}
778
+
800
779
By database::
801
-
+
802
780
Use `{devops-api-ref-url}#tag/Database-Operations/operation/getCDC[GET /v3/databases/**DB_ID**/cdc]` to get CDC configuration details for an entire database:
803
781
+
804
782
[source,curl,subs="+quotes"]
@@ -845,7 +823,6 @@ For multi-region databases with CDC enabled in multiple regions, the `regions` a
845
823
----
846
824
847
825
By table::
848
-
+
849
826
Use `{devops-api-ref-url}#tag/Database-Operations/operation/getCDC[GET /v3/databases/**DB_ID**/keyspaces/**KEYSPACE_NAME**/tables/**TABLE_NAME**/cdc]` to get CDC configuration details for a specific table:
850
827
+
851
828
[source,curl,subs="+quotes"]
@@ -880,9 +857,6 @@ For multi-region databases with CDC enabled in multiple regions, the `regions` a
880
857
}
881
858
]
882
859
----
883
-
====
884
-
--
885
-
======
886
860
887
861
[#put-cdc]
888
862
=== Update a database's CDC configuration
@@ -961,13 +935,13 @@ You can get these names with the xref:astra-streaming:apis:index.adoc#astra-stre
961
935
. Send the updated configuration to `{devops-api-ref-url}#tag/Database-Operations/operation/updateCDC[PUT /v3/databases/**DB_ID**/cdc]`.
962
936
+
963
937
[IMPORTANT]
964
-
=====
938
+
====
965
939
This is a desired state list.
966
940
967
941
Make sure that you include all existing tables and regions that you want to keep in the CDC configuration.
968
942
969
943
If you omit any existing tables or regions from the request, CDC is disabled for those tables or regions.
970
-
=====
944
+
====
971
945
+
972
946
[source,curl,subs="+quotes"]
973
947
----
@@ -1027,23 +1001,30 @@ CDC is automatically disabled if you drop a table, terminate a database, or remo
1027
1001
You can remove a table's CDC configuration without deleting the table.
1028
1002
For multi-region databases, this disables CDC for the table across all regions.
1029
1003
1030
-
[tabs]
1031
-
======
1032
-
{astra-ui}::
1004
+
Disabling CDC doesn't remove the associated namespace, topics, or {astra-stream} tenant:
1005
+
1006
+
* If you reenable CDC for the same table, the existing topics are reused with the existing records.
1007
+
1008
+
* If you want to discard a table's CDC records, you must manually remove the associated {astra-stream} artifacts after disabling CDC:
1033
1009
+
1034
-
--
1010
+
** If you remove CDC from a table, then you can delete the table's `data-` and `log-` topics from the `astracdc` namespace in the {astra-stream} tenant.
1011
+
For multi-region databases, make sure that you delete the topics in the tenant for each region where the database is deployed
1012
+
** If you remove CDC from all tables in a region, and you no longer need CDC in that region, then you can delete the `astracdc` namespace from the {astra-stream} tenant in that region.
1013
+
Deleting the namespace also deletes the topics within that namespace.
1014
+
** If you remove CDC from all of a database's tables, and you no longer need an {astra-stream} tenant for any reason, you can delete the entire tenant.
1015
+
1016
+
==== Disable CDC in the {astra-ui}
1017
+
1035
1018
. In the {astra-ui}, click the name of the database where you want to disable CDC.
1036
1019
1037
1020
. Click the *CDC* tab.
1038
1021
1039
1022
. In the *Change Data Capture* list, click the table's name.
1040
1023
1041
1024
. Click *Disable* to remove the table's CDC configuration.
1042
-
--
1043
1025
1044
-
{product-short} {devops-api}::
1045
-
+
1046
-
--
1026
+
==== Disable CDC with the {product-short} {devops-api}
1027
+
1047
1028
Use `{devops-api-ref-url}#tag/Database-Operations/operation/deleteCDC[DELETE /v3/databases/**DB_ID**/cdc]` to disable CDC for a table:
1048
1029
1049
1030
[source,curl,subs="+quotes"]
@@ -1074,20 +1055,6 @@ If you want to disable CDC for multiple tables at once, include an object for ea
1074
1055
You can use `PUT /v3/databases/**DB_ID**/cdc` to make multiple changes to a database's CDC configuration in one request, including additions, changes, and removals of tables and regions.
1075
1056
For more information, see <<put-cdc>>.
1076
1057
====
1077
-
--
1078
-
======
1079
-
1080
-
Disabling CDC doesn't remove the associated namespace, topics, or {astra-stream} tenant:
1081
-
1082
-
* If you reenable CDC for the same table, the existing topics are reused with the existing records.
1083
-
1084
-
* If you want to discard a table's CDC records, you must manually remove the associated {astra-stream} artifacts after disabling CDC:
1085
-
+
1086
-
** If you remove CDC from a table, then you can delete the table's `data-` and `log-` topics from the `astracdc` namespace in the {astra-stream} tenant.
1087
-
For multi-region databases, make sure that you delete the topics in the tenant for each region where the database is deployed
1088
-
** If you remove CDC from all tables in a region, and you no longer need CDC in that region, then you can delete the `astracdc` namespace from the {astra-stream} tenant in that region.
1089
-
Deleting the namespace also deletes the topics within that namespace.
1090
-
** If you remove CDC from all of a database's tables, and you no longer need an {astra-stream} tenant for any reason, you can delete the entire tenant.
0 commit comments