3 ms·
Deleting a production DB is not the only way to mess up your data. Smart people design systems that alert them when they're about to commit an error because th
by Tainnor 4y ago
Deleting a production DB is not the only way to mess up your data.
Smart people design systems that alert them when they're about to commit an error because they have 500 other priorities on their mind.
- withinboredom 4y agoYeah, we had that. Even where I work now (that has almost no table constraints at all because there is no way to support them at our scale), we have tooling that prevents you from making dumb mistakes and alerting + backups if you manage to do it anyway. Having processes in place to deal with these kinds of issues, and tooling is. That's what I meant by "people problem." No constraint will keep a determined person from deleting the wrong thing (in fact, it might be worse if it cascades). We had someone accidentally fight the "query nanny" once, thinking they were deleting a table in their dev environment... nope, they deleted a production table with hundreds of millions of rows. It took hours to complete the deletion, while all devs worked to delete the feature so we could restore from backup and revert our hacked out code. They still work there. My point is, these are all "people problems" and no technology will save you from them. They might mitigate the issue, or slow people down to get them to realize what they are about to do ... but that is all you can really hope for. A constraint isn't necessarily required to provide that mitigation, but it helps when you can use them.
- Tainnor 4y agoThanks for clarifying, I had misinterpreted your statement. I can see how at huge scales, DB constraints can be impossible to implement. But they do come (almost) for free in terms of development effort, whereas what you describe probably took a long time to implement.