Last update: 2025-08-16T22:14:51.000Z
Content:
---
title: "GDPR-Compliant Data Deletion · Tinybird Docs"
theme-color: "#171612"
description: "Learn how to delete user data in Tinybird to maintain GDPR compliance using various methods and best practices."
inkeep:version: "forward"
---




# GDPR-Compliant Data Deletion in Tinybird [¶](https://www.tinybird.co/docs/forward/get-data-in/data-operations/gdpr-compliant-data-deletion#gdpr-compliant-data-deletion-in-tinybird)

Copy as MD Tinybird provides several methods for deleting user data to maintain GDPR compliance. The best approach depends on your data volume and deletion frequency.

## Methods for Data Deletion [¶](https://www.tinybird.co/docs/forward/get-data-in/data-operations/gdpr-compliant-data-deletion#methods-for-data-deletion)

### 1. Using the CLI [¶](https://www.tinybird.co/docs/forward/get-data-in/data-operations/gdpr-compliant-data-deletion#1-using-the-cli)

For smaller datasets or infrequent deletions, you can use the<a href="/docs/forward/dev-reference/commands/tb-datasource"> `tb datasource delete`</a> command:

tb datasource delete [datasource_name] --sql-condition "user_id = 'user_to_delete'" This method is suitable for datasets with up to a few million rows and deletion frequencies of up to 1000 operations per week.

### 2. Using the Delete API Endpoint [¶](https://www.tinybird.co/docs/forward/get-data-in/data-operations/gdpr-compliant-data-deletion#2-using-the-delete-api-endpoint)

For more frequent deletions, you can use the [Delete API endpoint](/docs/api-reference/datasource-api#delete--v0-datasources-(.+)):

POST /v0/datasources/(.+)/delete This method is more efficient for regular deletion operations.

### 3. Implementing a Deletion Queue [¶](https://www.tinybird.co/docs/forward/get-data-in/data-operations/gdpr-compliant-data-deletion#3-implementing-a-deletion-queue)

For large-scale applications with frequent deletion requests:

- Create a `delete_user`   table to queue deletion requests.
- Set up a scheduled job (e.g., weekly) to process the queue and delete user data from all relevant datasources.
- Use partitioning on large datasources to optimize deletion operations.

## Best Practices [¶](https://www.tinybird.co/docs/forward/get-data-in/data-operations/gdpr-compliant-data-deletion#best-practices)

- Ensure deletions cascade to all relevant datasources and materialized views.
- For datasources with millions of rows, consider partitioning to improve deletion performance.
- Monitor the performance impact of deletion operations and adjust your strategy as your data grows.
- Implement TTL (Time to Live) on datasources where appropriate to automatically remove old data.

## Considerations [¶](https://www.tinybird.co/docs/forward/get-data-in/data-operations/gdpr-compliant-data-deletion#considerations)

- Deleting data using `ALTER TABLE ... DELETE WHERE`   can have performance implications on large datasets.
- Balance between immediate deletion for GDPR compliance and system performance.
- Regularly review and optimize your deletion strategy as your data volume grows.


