3 ms·
I don't understand the distinction you're making. Bad data in the context of database constraints is data that violates your data model which, in the absence o
by always_good 9y ago
I don't understand the distinction you're making.
Bad data in the context of database constraints is data that violates your data model which, in the absence of constraints, is implicit and tucked away around the application layer in comments and functions and word of mouth. If you're cleaning up data, that means your data integrity has been compromised.
If you're collecting unstructured data from scientists, there's no contradiction. Maybe you make a nullable byte blob column for it. That's generally the most nonthreatening data in the database. Data constraints don't mean you need perfect data.
But the fact that your mental image is the weirdly specific scenario someone deleting data while "their scientists" go "aw snap, I wanted that" indicates a misunderstanding on your part about what's being discussed.
It sounds like you think that the opposite of data constraints is a windfall of valuable data that someone wants. No, exactly the opposite is what you're protecting yourself from with constraints.
- xapata 9y agoTwo different tasks can have two different levels of "integrity" desired. For example, the task of mailing a thank-you note to all customers might not care if one customer accidentally has two addresses or none. For the task of billing customers, we probably want an exact one-to-one customer to mailing address. If someone protects me with the constraint of one-to-one customer to address, then maybe I lose the fact that the customer has just opened a second office. All I'm saying is that database constraints go both ways, they reveal bugs and they cause bugs.