Preferred delete rule in production environment

So, in one of my recent interviews, I was asked what delete rule should be used in production environments. My answer was "Delete" since this rule guarantees data consistency or else it depends on requirement of referential integrity. But according to the interviewer, delete rule in production environments should always be "Ignore". 

Could someone please throw some light on this whether it should always be "Ignore" or "Delete" or "Protect" or it depends on the requirement.


Hi @Simran Vaswani 

The choice of delete rule in production environments, whether it should be "Ignore," "Delete," or "Protect," depends on the specific requirements of your application and data integrity. While "Ignore" might be a conservative choice to avoid accidental data loss, "Delete" could be suitable if you want to maintain data consistency by automatically removing related records when a referenced record is deleted. "Protect" is typically used to prevent deletion of a record if there are related records depending on it.

Ultimately, the decision should be based on your application's needs, data relationships, and the potential impact of each rule on data integrity. It's important to carefully consider the implications of each option and choose the one that aligns wit



It depends on the requirements. 

But Delete is not a good choice in general. Because, in the production environment, deleting records should be logged carefully And in almost of cases, for safety purposes, we won't physically delete a record.

So using the Delete rule is not safe because it's done automatically.

furthermore, setting relation rules in Database can cause bad performance, that's why there are many systems don't set any relationships between tables, and all the relation logic is processed by the code.


In my view, there's no universal rule for the delete rule in production environments. It depends on the nature of your application, the relationship between your data, and your business requirements. 

However, deleting data from the production environment is not thought to be a good idea. Some people choose to archive or make something inactive rather than delete it.

Hello Simran,

As everyone said I agree it depends on the nature of the application but I will tell you why it should be Ignore instead of Delete :-

The Protect and Delete options in the Reference Attributes Delete Rule of entities will trigger multiple actions on its referenced data model. This causes database overhead and takes a lot longer to delete records. This happens because a delete rule of an entity record will cause a select or a delete statement for every record in other tables that link to that record through a foreign key constraint. 

Using the Ignore rule in complex data models is the best choice since these delete statements won't be executed but will require manual identification of the records to be deleted in other referenced entities. 

Use the Ignore rule, which may lead to data inconsistency if your application is not working correctly, but is the more performant option by far. If you use this option, it's fundamental that you have a housekeeping strategy on your DB to assure that you get rid of all unindexed data.

Hope it helps you.


Pavan R

Hello @Simran Vaswani 

The choice of delete rule depends on the specific business logic and requirements of your application. In a production environment, it's common to choose a combination of delete rules based on the importance of data, data integrity considerations, and the desired behavior of your application.

It's recommended to carefully analyze your application's data model, use cases, and business requirements before deciding on the appropriate delete rules for your production environment.



Hi Simran Vaswani, 

On the link Below  Refer "Use of the Delete Rules constraints in Entities" for more clarity.


Use of the Delete Rules constraints in Entities:
During the development and testing stages, temporarily setting the constraint to protect could help protect against development errors. Once development and testing are completed, setting the constraint to ignore and adding reminders where the deletes are placed and stating which rules should be revert back to protect during testing are practices that should minimize the risk of data inconsistency. 

Vignesh Prakash.



Actually delete rule in production depends on your choice. There may not be any hard rule for production.

If rule is delete the it ensure the data integrity. But if you want to keep the record or logs of all historical data then you should use protect. In case of protect soft delete will be more useful.

But yes Ignore should not be use as it only leads to garbage data.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.