Question

Answers

  • user image
    Anurag Srivastava
    Sep 20, 2020, 3:40:18 PM |

    You should always try to soft delete the records as it is good to keep the records that were added to the DB. There are few disadvantages of soft delete like:

    • It will take more disk space if you keep the deleted record.
    • In a data search, this can impact the performance.
    • You have to create a composite unique index by including the deleted flag field.

    But if the above points are manageable then you should always prefer soft delete as it has the following advantages:

    • You can use the deleted data for any audit purpose.
    • You can perform the data analytics if it is required.
    • It helps us to intact the relationship between parent and child tables as the same id can be used for a single unique user.

    Now based on the above explanation you can decide the suitable optionbased on the project you are working on. Still if you go with the hard delete option then you can keep the deleted records in an audit table. That can help you to retrieve the records in case of any audit. Please let me know if you have any further queries.

    0 | 0
  • user image
    Jatin Yadav
    Sep 20, 2020, 11:08:13 AM |

    I think we should soft delete(mark as deleted) so that we can have data for any future use like analytics or any other purpose if the data is usefull or if  data is of not any use than it should be deleted. So soft delete or hard delete depends upon the type of data i.e useful in future or not.

    0 | 0


Related Blogs

Geo distance search using Elasticsearch

May 16, 2020, 8:16:33 PM | Anurag Srivastava

Introduction to OpenAPI Specification

May 9, 2020, 6:58:33 AM | Anurag Srivastava

Creating dynamic presentations using Kibana Canvas

Apr 10, 2020, 3:01:55 PM | Anurag Srivastava

Securing your Elastic Stack

Nov 4, 2019, 7:06:01 PM | Anurag Srivastava

Elasticsearch Installation and Configuration on Ubuntu 14.04

May 7, 2018, 11:55:02 AM | Lovish Sharma

Top Blogs

Geo distance search using Elasticsearch

May 16, 2020, 8:16:33 PM | Anurag Srivastava

Creating dynamic presentations using Kibana Canvas

Apr 10, 2020, 3:01:55 PM | Anurag Srivastava

Securing your Elastic Stack

Nov 4, 2019, 7:06:01 PM | Anurag Srivastava

Introduction to OpenAPI Specification

May 9, 2020, 6:58:33 AM | Anurag Srivastava

Elasticsearch Installation and Configuration on Ubuntu 14.04

May 7, 2018, 11:55:02 AM | Lovish Sharma