# Delete stored data

Efficient data deletion in a distributed storage system is often overlooked, yet it is inherently complex. In many systems, deleting an object requires coordination across multiple nodes to ensure all associated data fragments are removed safely. This coordination can be time-consuming, and in some architectures, the disk space freed by deletes is only reclaimed during deferred maintenance tasks such as compaction or garbage collection. Both issues can lead to slow deletions, delayed space reclamation, and unpredictable storage availability.

UltiHash avoids these drawbacks by maintaining fine-grained reference counting information directly at the level of each storage service instance. When an object is deleted, each instance can immediately determine whether the data fragments it holds are still referenced by any other objects in the cluster. Because this determination is local, there is no need for cluster-wide coordination protocols, which greatly reduces deletion latency.

As soon as a data fragment’s reference count reaches zero, the fragment is removed and the disk space it occupied is reclaimed instantly. This ensures that storage capacity is returned to the system without waiting for background compaction or garbage collection cycles.

This design provides predictable performance for delete-heavy workloads and ensures that available disk space reflects the true live data set at all times.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ultihash.io/operations/4.-fast-and-lightweight-deletion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
