3 ms·
> So you stop the program immediately and allow no more transactions while you debug? Unlikely. You stop the transaction on a constraint violation, not usually
by Slansitartop 9y ago
> So you stop the program immediately and allow no more transactions while you debug? Unlikely.
You stop the transaction on a constraint violation, not usually the entire system.
> Keep the data. Log that it's weird.
I've worked on systems that do that, and they're nightmares.
The problem with that style can be summed up in "if it doesn't look broke, people don't bother fixing it." No one actually watches those logs, and users don't try to fix data that was "accepted" with no errors. The result is bad data piles up, and often causes problems in other parts of the system.
Maybe you (as a developer) love working on support tickets to manually fix bad data the users entered or a buggy process created, but I sure as hell don't.
The solution to this is to fail fast: https://en.wikipedia.org/wiki/Fail-fast https://en.wikipedia.org/wiki/Fail-fast.
- deleted 9y ago[deleted]
- xapata 9y agoI think our practices are closer than you realize. Maybe I didn't explain myself well. The idea that troubles me is including more strict constraints in the database than in the application itself, because that indicates the application isn't fully tested. If the application is well tested, then it doesn't matter where the logic resides, db or app, so there's no standing to the claim that application logic is never enough. Also, there are many kinds of data. Transactions, sure, reject if it doesn't match. Telemetry data, I'd like to hang on to it regardless of how weird it seems.