Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Delete mode #31

Open
mshustov opened this issue Dec 9, 2022 · 1 comment
Open

Support Delete mode #31

mshustov opened this issue Dec 9, 2022 · 1 comment
Labels

Comments

@mshustov
Copy link
Member

mshustov commented Dec 9, 2022

@cwurm requested support for tombstone messages to delete records from the storage.
The use case is essential for customers sharing the same message pipeline among several DB and expecting records to be removed from every destination.

Depends on lightweight deletes ClickHouse/ClickHouse#42126

@mlivirov
Copy link
Contributor

mlivirov commented Dec 6, 2023

I've spent some time figuring out on how to handle this scenario until this feature is yet to be available and just wanna share my findings.

For those who uses debezium to read data from the source database there is an SMT available that adds a field "__deleted" for deleted records.

See for details: https://debezium.io/documentation/reference/stable/transformations/event-flattening.html

This field can be stored along with another fields into ReplacingMergeTree table.

After this a TTL logic can be added to the table which will vacuum clean all the records which are marked for deletion like following:

alter table database.table modify TTL timestamp + interval 1 hour where __deleted = 'true'

@Paultagoras Paultagoras added the cdc label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants