Skip to content
Databases in Practice

What is Soft Delete & Tombstones?

Marking rows deleted with a timestamp flag instead of removing them, preserving history and undo. BYOB keeps a soft-delete grace window on projects before hard purge, so accidents stay recoverable.

Example

BYOB’s project soft-delete flow stamps deleted_at instead of dropping rows; recovery jobs restore within the grace window while purge jobs later hard-delete expired tombstones.

What people get wrong

Soft-deleting without filtering or purging. Every query must exclude tombstones — ideally via partial indexes — or dead rows silently pollute results and growth.

Frequently asked questions

When should rows hard-delete instead?

When retention expires, privacy law requires erasure, or storage costs bite. Soft delete is a grace window with a purge job, not permanent limbo.

How do queries ignore tombstones?

Filter deleted_at IS NULL on every read, or hide tombstones behind views and partial indexes so application code rarely thinks about them.

Browse all Databases in Practice terms →