You hit delete and the file is gone. Except it is not. Here is what really happens on disks, SSDs and databases, and why GDPR erasure is hard.
You hit delete on a 2 GB movie and your phone storage bar barely moves. Or it moves, but the file is "still in the bin". Either way, did the file actually leave?
Short answer: mostly no. Delete usually means "stop pointing at this", not "destroy this". Let's follow one deleted file down the stack and see where it goes.
A file system keeps a list of names and where each file's data lives. Think of a library catalogue card. Throw the card away and the book is still on the shelf, just nobody knows where.
The Linux manual describes unlink() as something that "deletes a name from the filesystem". If that was the last name and nobody has the file open, the space is "made available for reuse". Available for reuse, not wiped.
If some program still has the file open, even the space stays taken until it closes. That's why a disk can look full after you delete a big file. A program is still using it.
Why this matters: the file system only forgets. But phones and laptops use SSDs. Do they behave differently?
An SSD (the flash storage in most phones and laptops) can't just overwrite old data in place the way you'd erase a pencil mark. So the file system can send it a message called TRIM, which means "these blocks aren't used anymore, you can clean them up".
Two things are worth knowing. The ext4 docs say its discard option, which sends TRIM when blocks are freed, is off by default (nodiscard). And the fstrim manual states that it discards unused blocks across a file system, mainly for SSDs, but also notes that not all blocks will be discarded in some cases.
I'm not claiming the data is always recoverable. I'm saying "gone" depends on settings and the drive, and delete alone doesn't promise it.
So disks forget lazily. Databases are even stranger.
In PostgreSQL, the docs say an UPDATE or DELETE "does not immediately remove the old version of the row". The old version stays because other running queries might still need to see it.
A cleaner called VACUUM comes later. The standard version "removes dead row versions in tables and indexes and marks the space available for future reuse", but it does not normally give the space back to the operating system.
Click Next and follow one DELETE through PostgreSQL. Notice that the row is still around after step 2.
You run DELETE on a row
So what: even in a database, DELETE starts a cleanup instead of finishing it. And some databases take that idea further.
Some databases (Cassandra, RocksDB) never edit old files at all. They write new ones. So a delete is just a new record that marks the key as dead. That record is called a tombstone.
Cassandra's docs say it handles a deletion as an insert of a time-stamped marker. By default it keeps tombstones for gc_grace_seconds, which is 864000 seconds (ten days). The real data goes away only when a compaction (merging files and throwing out old stuff) happens after that.
RocksDB's docs say the same: deleting keys one at a time leaves tombstones, space isn't freed until compaction, and a pile of tombstones can slow down reads.
Ten days feels like a long wait. Is Cassandra just lazy?
Cassandra keeps the tombstone on purpose. The docs warn that if a machine is down longer than gc_grace_seconds, its deleted data can be repaired back onto the others and reappear as a zombie.
So the delay isn't laziness. It's how the system makes sure the delete reaches every copy. Now put all of this together with the law.
The GDPR (the EU's data protection law) has Article 17, the "right to erasure". It requires the controller to erase personal data "without undue delay" when one of the listed grounds applies.
Now picture what that means with everything above. One person's data may sit in a main database, replicas, tombstones waiting for compaction, backups, logs and SSD blocks. "Delete the row" touches only the first.
Know every place the data lives, delete in all of them, and write down how long each cleanup takes.
Backups and old files get cleaned only by their own schedules, so "gone" can take a while.
I'm not a lawyer, so I won't say what the law counts as erased. I only know the engineering side: it isn't one command.
I used to think DELETE was a verb with one meaning. Now I treat it as "start the cleanup". For private stuff, I'd ask where else the data is, and how long until each place actually forgets.