Change Data Capture (CDC) logging
Change Data Capture (CDC) logging captures changes to data.
Upon flushing the memtable to disk, CommitLogSegments that contain data for CDC-enabled tables are moved to the configured cdc_raw directory. After the disk space limit is reached, CDC-enabled tables reject writes until space is freed.
CDC directory location
The location of the CDC directory depends on the type of installation:Package installations | /var/lib/cassandra/cdc_raw |
Tarball installations | /var/lib/cassandra/cdc_raw |
cassandra.yaml
- The cassandra.yaml file is located in the installation_location/conf directory.
Prerequisites
Procedure
-
Enable CDC logging and configure CDC directories and space in
cassandra.yaml.
For example, to enable CDC logging with default values:
cdc_enabled: true cdc_total_space_in_mb: 4096 cdc_free_space_check_interval_ms: 250 cdc_raw_directory: /var/lib/cassandra/cdc_raw
- Optional:
To enable CDC logging for a database table, create or alter the table with the
table property.
For example, to enable CDC logging on the cycling table:
ALTER TABLE cycling WITH cdc=true;