on-internet
← Community

Should the database prevent changes to a value that may need correcting?

Stack Overflow ·

I’ve heard that it’s good to enforce business rules in the database when possible. How does that work for static values? If enforced at the database level, we would not allow values that should be immutable to ever change. But what happens when there's a mistake in the database? Now, the supposedly immutable value has to change because it was saved incorrectly in the first place. For example, suppose a payment processor reports a $10 fee, but our database saves $11 by mistake. If the database blocks changes to the saved fee, how would you correct the mistake? Should you enforce this rule in th

Comments

Sign in or sign up to comment and upvote.

No comments yet.