Skip to content

Commit

Permalink
Docs for deletions in Estuary (#1723)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonwihl authored Oct 21, 2024
1 parent 75a26e1 commit 884767b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions site/docs/reference/deletions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Handling Deletions in Estuary Flow

Estuary supports two categories of deletions: **soft deletes** and **hard deletes**. These deletion types determine how documents are marked and treated within the system. Below is an explanation of each category.

## Soft Deletes

Soft deletes occur when a document is marked as deleted but is not physically removed from the destination. Instead, it is flagged for deletion with a specific metadata field.

- **Flagging Soft Deletes**: The field `_meta/op` is set to `'d'` to indicate that a document has been marked for deletion.
- **Document Retention**: The document remains in the destination even though it is marked as deleted.
- **Filtering Soft Deleted Documents**: To exclude soft-deleted documents from queries, you can filter out documents where `_meta/op = 'd'`. This ensures that soft-deleted documents are ignored without permanently removing them.

## Hard Deletes

Hard deletes go a step further than soft deletes by permanently removing documents from the destination.

- **Flagging Hard Deletes**: Similar to soft deletes, the `_meta/op` field is set to `'d'` for documents that need to be deleted.
- **Document Removal**: Once a document is flagged, a query is issued to physically remove any document marked with `_meta/op = 'd'` from the destination.
- **Supported Materialization Connectors for Hard Deletes**:
- Snowflake
- Google BigQuery
- Databricks
- Amazon Redshift
- Elastic
- PostgreSQL
- MySQL
- SQL Server
- AlloyDB
- MongoDB
- MotherDuck
- TimescaleDB

0 comments on commit 884767b

Please sign in to comment.