Member-only story

Implementing Soft Delete in Django Application

Rajan Sahu
4 min readJan 27, 2023

--

My article is for everyone! Non-members can click on this link and jump straight into the full text!!

Soft delete is a method of marking records as deleted in a database without actually removing them. This allows for the recovery of accidentally deleted data, as well as auditing and tracking of changes made to the database. When a record is “soft deleted,” it is flagged as deleted in the database, but is still accessible and can be retrieved if needed.

This approach is different from “hard delete,” in which records are permanently removed from the database and cannot be recovered. Soft delete is commonly used in database management systems for sensitive data or where data recovery is important. It is also helpful for maintaining the history of data changes in the database.

Advantages of soft delete

  • The main advantage of soft delete is that it allows for the recovery of accidentally deleted data.
  • And It also decreases the load on the server because it not performing actual delete rather than just updating a field.

Disadvantages of soft delete

  • It can increase the size of the database over time.
  • This can lead to performance issues as the database grows…

--

--

Rajan Sahu
Rajan Sahu

Written by Rajan Sahu

Backend and Data Engineer by Day; Teacher, Friend and Content-Writer by night.

Responses (1)